Commit a7dd995f authored by Henri Fallon's avatar Henri Fallon

Added : alsa support
Todo : - test it on several cards
       - support more than Stereo s16
       - make configure check for alsa
parent 884bfabe
......@@ -18,4 +18,5 @@
Stphane Borel <stef@via.ecp.fr>
Renaud Dartus <reno@via.ecp.fr>
Henri Fallon <henri@via.ecp.fr>
......@@ -17,6 +17,7 @@
advantage of the SMP machines.
* Added --enable-debug, --enable-stats, and --disable-optims in the
GNU configure stuff.
* Added alsa audio support (plugin)
Mon, 28 Aug 2000 02:34:18 +0200
0.1.99i :
......
......@@ -11,7 +11,7 @@ A typical way to configure the vlc is :
For a full compilation, you may try :
./configure --prefix=/usr --enable-mmx --enable-gnome --enable-fb \
--enable-glide --enable-ggi --enable-mga --enable-esd
--enable-glide --enable-ggi --enable-mga --enable-esd --enable-alsa
See `./configure --help' for more information.
......
......@@ -339,10 +339,13 @@ PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
plugins/yuvmmx/video_yuv24.o \
plugins/yuvmmx/video_yuv32.o
PLUGIN_ALSA = plugins/alsa/alsa.o \
plugins/alsa/aout_alsa.o
PLUGIN_OBJ = $(PLUGIN_BEOS) $(PLUGIN_DSP) $(PLUGIN_DUMMY) $(PLUGIN_ESD) \
$(PLUGIN_FB) $(PLUGIN_GGI) $(PLUGIN_GLIDE) $(PLUGIN_GNOME) \
$(PLUGIN_MGA) $(PLUGIN_X11) $(PLUGIN_YUV) $(PLUGIN_YUVMMX) \
$(PLUGIN_SDL)
$(PLUGIN_SDL) $(PLUGIN_ALSA)
#
# Other lists of files
#
......@@ -475,6 +478,11 @@ lib/dsp.so: $(PLUGIN_DSP)
$(PLUGIN_DSP): %.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
lib/alsa.so: $(PLUGIN_ALSA)
ld -shared -o $@ $^
$(PLUGIN_ALSA): %.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
lib/dummy.so: $(PLUGIN_DUMMY)
ld -shared -o $@ $^
$(PLUGIN_DUMMY): %.o: %.c
......
......@@ -157,7 +157,7 @@ Urgency: Normal
Description: ALSA audio output support
ALSA is the Advanced Linux Sound Architecture and is believed to be
technically superior to the usual OSS support found in the Linux kernel.
Status: Todo
Status: Done ( henri )
Task: 0x28
Difficulty: Guru
......
This diff is collapsed.
......@@ -115,6 +115,9 @@ AC_ARG_ENABLE(glide,
AC_ARG_ENABLE(gnome,
[ --enable-gnome Gnome support (default disabled)],
[if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi])
AC_ARG_ENABLE(alsa,
[ --enable-alsa Alsa sound drivers supprt (default disabled)],
[if test x$enable_alsa = xyes; then PLUGINS=${PLUGINS}"alsa "; fi])
AC_ARG_ENABLE(x11,
[ --enable-x11 X11 support (default enabled)])
if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi
......
/*****************************************************************************
* dsp.c : OSS /dev/dsp plugin for vlc
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors:
* Henri Fallon <henri@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#include "defs.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/asoundlib.h> /* for alsa :) */
#include <fcntl.h>
#include <stdlib.h> /* malloc(), free() */
// #include <unistd.h> /* close() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "plugins.h"
#include "interface.h"
#include "audio_output.h"
#include "video.h"
#include "video_output.h"
#include "main.h"
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static void aout_GetPlugin( p_aout_thread_t p_aout );
/* Audio output */
int aout_AlsaOpen ( aout_thread_t *p_aout );
int aout_AlsaReset ( aout_thread_t *p_aout );
int aout_AlsaSetFormat ( aout_thread_t *p_aout );
int aout_AlsaSetChannels ( aout_thread_t *p_aout );
int aout_AlsaSetRate ( aout_thread_t *p_aout );
long aout_AlsaGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
void aout_AlsaPlaySamples ( aout_thread_t *p_aout, byte_t *buffer,
int i_size );
void aout_AlsaClose ( aout_thread_t *p_aout );
/*****************************************************************************
* GetConfig: get the plugin structure and configuration
*****************************************************************************/
plugin_info_t * GetConfig( void )
{
int i_fd;
plugin_info_t * p_info = (plugin_info_t *) malloc( sizeof(plugin_info_t) );
p_info->psz_name = "Alsa plugin";
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = aout_GetPlugin;
p_info->vout_GetPlugin = NULL;
p_info->intf_GetPlugin = NULL;
p_info->yuv_GetPlugin = NULL;
/* TODO : test if alsa is available */
p_info->i_score = 0x100;
/* If this plugin was requested, score it higher */
if( TestMethod( AOUT_METHOD_VAR, "alsa" ) )
{
p_info->i_score += 0x200;
}
return( p_info );
}
/*****************************************************************************
* Following functions are only called through the p_info structure
*****************************************************************************/
static void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_sys_open = aout_AlsaOpen;
p_aout->p_sys_reset = aout_AlsaReset;
p_aout->p_sys_setformat = aout_AlsaSetFormat;
p_aout->p_sys_setchannels = aout_AlsaSetChannels;
p_aout->p_sys_setrate = aout_AlsaSetRate;
p_aout->p_sys_getbufinfo = aout_AlsaGetBufInfo;
p_aout->p_sys_playsamples = aout_AlsaPlaySamples;
p_aout->p_sys_close = aout_AlsaClose;
}
This diff is collapsed.
......@@ -107,6 +107,7 @@ void bank_Init( plugin_bank_t * p_bank )
/* Audio pluins */
SEEK_PLUGIN( "dsp" );
SEEK_PLUGIN( "esd" );
SEEK_PLUGIN( "alsa" );
/* Dummy plugin */
SEEK_PLUGIN( "dummy" );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment