Commit d04d186e authored by Sam Hocevar's avatar Sam Hocevar

  * aRts audio output courtesy of Emmanuel Blindauer <manu@agat.net>.
  * Fix to the esd plugin when esd-config --cflags is nonempty.
parent 06377229
......@@ -29,6 +29,10 @@ N: Billy Biggs
E: vektor@dumbterm.net
D: libdvdcss enhancements
N: Emmanuel Blindauer
E: manu@agat.net
D: aRts audio output
N: Stphane Borel
E: stef@via.ecp.fr
C: stef
......
......@@ -16,6 +16,7 @@ endif
PLUGINS_DIR := ac3_adec \
ac3_spdif \
alsa \
arts \
beos \
darwin \
directx \
......@@ -49,6 +50,7 @@ PLUGINS_DIR := ac3_adec \
PLUGINS_TARGETS := ac3_adec/ac3_adec \
ac3_spdif/ac3_spdif \
alsa/alsa \
arts/arts \
beos/beos \
darwin/darwin \
directx/directx \
......
......@@ -67,6 +67,7 @@ includedir = @includedir@
#
LIB_ALSA = @LIB_ALSA@
LIB_ALTIVEC = @LIB_ALTIVEC@
LIB_ARTS = @LIB_ARTS@
LIB_BEOS = @LIB_BEOS@
LIB_DARWIN = @LIB_DARWIN@
LIB_DVD = @LIB_DVD@
......@@ -94,7 +95,10 @@ LIB_YUV = @LIB_YUV@
#
CFLAGS_ALTIVEC = @CFLAGS_ALTIVEC@
CFLAGS_DVD = @CFLAGS_DVD@
CFLAGS_ARTS = @CFLAGS_ARTS@
CFLAGS_ESD = @CFLAGS_ESD@
CFLAGS_LIBDVDCSS = @CFLAGS_LIBDVDCSS@
CFLAGS_ESD = @CFLAGS_ESD@
CFLAGS_GTK = @CFLAGS_GTK@
CFLAGS_SDL = @CFLAGS_SDL@
CFLAGS_X11 = @CFLAGS_X11@
......
This diff is collapsed.
......@@ -771,10 +771,27 @@ AC_ARG_ENABLE(esd,
if test x${ESD_CONFIG} != xno
then
PLUGINS="${PLUGINS} esd"
CFLAGS_ESD="`${ESD_CONFIG} --cflags`"
LIB_ESD="`${ESD_CONFIG} --libs`"
fi
fi])
dnl
dnl aRts module
dnl
AC_ARG_ENABLE(arts,
[ --enable-arts aRts sound server (default disabled)],
[if test x$enable_arts = xyes
then
AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
if test x${ARTS_CONFIG} != xno
then
PLUGINS="${PLUGINS} arts"
CFLAGS_ARTS="`${ARTS_CONFIG} --cflags`"
LIB_ARTS="`${ARTS_CONFIG} --libs `"
fi
fi])
dnl
dnl Darwin module
dnl
......@@ -1164,6 +1181,7 @@ AC_SUBST(SOFLAGS)
AC_SUBST(LIB)
AC_SUBST(LIB_ALSA)
AC_SUBST(LIB_ALTIVEC)
AC_SUBST(LIB_ARTS)
AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
AC_SUBST(LIB_DVD)
......@@ -1190,6 +1208,8 @@ AC_SUBST(CFLAGS_VLC)
AC_SUBST(CFLAGS_ALTIVEC)
AC_SUBST(CFLAGS_DVD)
AC_SUBST(CFLAGS_LIBDVDCSS)
AC_SUBST(CFLAGS_ARTS)
AC_SUBST(CFLAGS_ESD)
AC_SUBST(CFLAGS_GTK)
AC_SUBST(CFLAGS_SDL)
AC_SUBST(CFLAGS_X11)
......
###############################################################################
# vlc (VideoLAN Client) arts module Makefile
# (c)2001 VideoLAN
###############################################################################
#
# Objects
#
PLUGIN_C = arts.o aout_arts.o
BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
#
# Special plugin modifications
#
CFLAGS += $(CFLAGS_ARTS)
#
# Virtual targets
#
include ../../Makefile.modules
#
# Real targets
#
../arts.so: $(PLUGIN_C)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_ARTS)
../arts.a: $(BUILTIN_C)
ar r $@ $^
$(RANLIB) $@
/*****************************************************************************
* aout_arts.c : aRts functions library
*****************************************************************************
* Copyright (C) 2000 VideoLAN
*
* Authors: Blindauer Emmanuel <manu@agat.net>
*
* 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.
*****************************************************************************/
#define MODULE_NAME arts
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <errno.h> /* ENOMEM */
#include <fcntl.h> /* open(), O_WRONLY */
#include <string.h> /* strerror() */
#include <unistd.h> /* write(), close() */
#include <stdio.h> /* "intf_msg.h" */
#include <stdlib.h> /* calloc(), malloc(), free() */
#include <artsc.h>
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "tests.h"
#include "audio_output.h" /* aout_thread_t */
#include "intf_msg.h" /* intf_DbgMsg(), intf_ErrMsg() */
#include "main.h"
#include "modules.h"
#include "modules_export.h"
/*****************************************************************************
* aout_sys_t: arts audio output method descriptor
*****************************************************************************
* This structure is part of the audio output thread descriptor.
* It describes some arts specific variables.
*****************************************************************************/
typedef struct aout_sys_s
{
arts_stream_t stream;
} aout_sys_t;
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
static void aout_Play ( aout_thread_t *p_aout,
byte_t *buffer, int i_size );
static void aout_Close ( aout_thread_t *p_aout );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Probe: probes the audio device and return a score
*****************************************************************************
* This function tries to open the dps and returns a score to the plugin
* manager so that it can
*****************************************************************************/
static int aout_Probe( probedata_t *p_data )
{
if( TestMethod( AOUT_METHOD_VAR, "arts" ) )
{
return( 999 );
}
/* We don't have to test anything -- if we managed to open this plugin,
* it means we have the appropriate libs. */
return( 50 );
}
/*****************************************************************************
* aout_Open: initialize arts connection to server
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
{
int i_err = 0;
p_aout->i_format = AOUT_FORMAT_DEFAULT;
p_aout->i_channels = 1 + main_GetIntVariable( AOUT_STEREO_VAR, AOUT_STEREO_DEFAULT );
p_aout->l_rate = AOUT_RATE_DEFAULT;
i_err = arts_init();
if (i_err < 0)
{
fprintf(stderr, "arts_init error: %s\n", arts_error_text(i_err));
return(-1);
}
p_aout->p_sys->stream =
arts_play_stream( p_aout->l_rate, 16, p_aout->i_channels, "vlc" );
return( 0 );
}
/*****************************************************************************
* aout_SetFormat: set the output format
*****************************************************************************/
static int aout_SetFormat( aout_thread_t *p_aout )
{
/*Not ready*/
/* p_aout->i_latency = esd_get_latency(i_fd);*/
p_aout->i_latency = 0;
intf_WarnMsg(2, "aout_arts_latency: %d",p_aout->i_latency);
return( 0 );
}
/*****************************************************************************
* aout_GetBufInfo: buffer status query
*****************************************************************************/
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
/* arbitrary value that should be changed */
return( l_buffer_limit );
}
/*****************************************************************************
* aout_Play: play a sound samples buffer
*****************************************************************************
* This function writes a buffer of i_length bytes in the socket
*****************************************************************************/
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_err = arts_write( p_aout->p_sys->stream, buffer, i_size );
if(i_err < 0)
{
fprintf(stderr, "arts_write error: %s\n", arts_error_text(i_err));
}
}
/*****************************************************************************
* aout_Close: close the Esound socket
*****************************************************************************/
static void aout_Close( aout_thread_t *p_aout )
{
arts_close_stream( p_aout->p_sys->stream );
}
/*****************************************************************************
* arts.c : aRts module
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
*
* Authors: Emmanuel Blindauer <manu@agat.net>
*
* 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.
*****************************************************************************/
#define MODULE_NAME arts
#include "modules_inner.h"
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strdup() */
#include "config.h"
#include "common.h" /* boolean_t, byte_t */
#include "threads.h"
#include "mtime.h"
#include "modules.h"
#include "modules_export.h"
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
void _M( aout_getfunctions )( function_list_t * p_function_list );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for arts module" )
ADD_FRAME( "aRts" )
ADD_COMMENT( "This module does not need configuration" )
MODULE_CONFIG_STOP
MODULE_INIT_START
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_AOUT;
p_module->psz_longname = "arts audio module";
MODULE_INIT_STOP
MODULE_ACTIVATE_START
_M( aout_getfunctions )( &p_module->p_functions->aout );
MODULE_ACTIVATE_STOP
MODULE_DEACTIVATE_START
MODULE_DEACTIVATE_STOP
......@@ -12,6 +12,12 @@ BUILTIN_C = $(PLUGIN_C:%.o=BUILTIN_%.o)
ALL_OBJ = $(PLUGIN_C) $(BUILTIN_C)
#
# Special plugin modifications
#
CFLAGS += $(CFLAGS_ESD)
#
# Virtual targets
#
......
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