From 8831e75a65b8831096c569570c5a418ac0de57c0 Mon Sep 17 00:00:00 2001 From: Guenter Bartsch Date: Tue, 26 Nov 2002 02:37:34 +0000 Subject: return of the esd audio output driver CVS patchset: 3374 CVS date: 2002/11/26 02:37:34 --- ChangeLog | 1 + TODO | 1 - src/audio_out/Makefile.am | 15 ++++++----- src/audio_out/audio_esd_out.c | 59 +++++++++++++++++++++++++++++++++++-------- 4 files changed, 57 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8427a626a..53d4d98b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ xine-lib (1.0.0-alpha2/beta0) * use binary real codecs to decode rv20/30 video, sipro/cook audio (experimental) * arts audio output plugin ported to new architecture + * esound audio output plugin ported to new architecture xine-lib (1.0.0-alpha1) * transport stream demuxer fixes diff --git a/TODO b/TODO index f9d9a07da..048ac58fe 100644 --- a/TODO +++ b/TODO @@ -23,7 +23,6 @@ required for 1.0 - xvid decoder plugin (guenter) - faad decoder plugin - opengl video output plugin -- esd audio output plugin (guenter) - irix audio output plugin (matthias) - null audio plugin (or fix null video out) - input_dvd: detect errors, display useful error messages (guenter) diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am index 234ab098a..3af71def1 100644 --- a/src/audio_out/Makefile.am +++ b/src/audio_out/Makefile.am @@ -19,9 +19,9 @@ alsa_module = xineplug_ao_out_alsa.la endif endif -#if HAVE_ESD -#esd_module = xineplug_ao_out_esd.la -#endif +if HAVE_ESD +esd_module = xineplug_ao_out_esd.la +endif if HAVE_SUNAUDIO sun_module = xineplug_ao_out_sun.la @@ -44,7 +44,8 @@ endif lib_LTLIBRARIES = $(oss_module) \ $(alsa_module) \ $(sun_module) \ - $(arts_module) + $(arts_module) \ + $(esd_module) #lib_LTLIBRARIES = \ # $(alsa_module) \ @@ -61,9 +62,9 @@ xineplug_ao_out_alsa_la_SOURCES = audio_alsa_out.c xineplug_ao_out_alsa_la_LIBADD = $(ALSA_LIBS) xineplug_ao_out_alsa_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ -#xineplug_ao_out_esd_la_SOURCES = audio_esd_out.c -#xineplug_ao_out_esd_la_LIBADD = $(ESD_LIBS) -#xineplug_ao_out_esd_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ +xineplug_ao_out_esd_la_SOURCES = audio_esd_out.c +xineplug_ao_out_esd_la_LIBADD = $(ESD_LIBS) +xineplug_ao_out_esd_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ xineplug_ao_out_sun_la_SOURCES = audio_sun_out.c xineplug_ao_out_sun_la_LDFLAGS = -avoid-version -module @XINE_PLUGIN_MIN_SYMS@ diff --git a/src/audio_out/audio_esd_out.c b/src/audio_out/audio_esd_out.c index 2eb93a1f5..1cbd6bb94 100644 --- a/src/audio_out/audio_esd_out.c +++ b/src/audio_out/audio_esd_out.c @@ -17,7 +17,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * - * $Id: audio_esd_out.c,v 1.22 2002/11/20 11:57:39 mroi Exp $ + * $Id: audio_esd_out.c,v 1.23 2002/11/26 02:37:35 guenter Exp $ */ #ifdef HAVE_CONFIG_H @@ -39,7 +39,7 @@ #include "audio_out.h" #include "metronom.h" -#define AO_OUT_ESD_IFACE_VERSION 4 +#define AO_OUT_ESD_IFACE_VERSION 6 #define GAP_TOLERANCE 5000 @@ -72,6 +72,12 @@ typedef struct esd_driver_s { } esd_driver_t; +typedef struct { + audio_driver_class_t driver_class; + + config_values_t *config; +} esd_class_t; + /* * connect to esd @@ -362,9 +368,11 @@ static int ao_esd_ctrl(ao_driver_t *this_gen, int cmd, ...) { return 0; } -static void *init_audio_out_plugin (xine_t *xine, void *data) { +static ao_driver_t *open_plugin (audio_driver_class_t *class_gen, + const void *data) { - config_values_t *config = xine->config; + esd_class_t *class = (esd_class_t *) class_gen; + config_values_t *config = class->config; esd_driver_t *this; int audio_fd; sigset_t vo_mask, vo_mask_orig; @@ -431,22 +439,51 @@ static void *init_audio_out_plugin (xine_t *xine, void *data) { return this; } +/* + * class functions + */ + +static char* get_identifier (audio_driver_class_t *this_gen) { + return "esd"; +} + +static char* get_description (audio_driver_class_t *this_gen) { + return _("xine audio output plugin using esound"); +} + +static void dispose_class (audio_driver_class_t *this_gen) { + + esd_class_t *this = (esd_class_t *) this_gen; + + free (this); +} + +static void *init_class (xine_t *xine, void *data) { + + esd_class_t *this; + + this = (esd_class_t *) malloc (sizeof (esd_class_t)); + + this->driver_class.open_plugin = open_plugin; + this->driver_class.get_identifier = get_identifier; + this->driver_class.get_description = get_description; + this->driver_class.dispose = dispose_class; + + this->config = xine->config; + + return this; +} + static ao_info_t ao_info_esd = { - "xine audio output plugin using esd", 4 }; -ao_info_t *get_audio_out_plugin_info() { - ao_info_esd.description = _("xine audio output plugin using esd"); - return &ao_info_esd; -} - /* * exported plugin catalog entry */ plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_OUT, AO_OUT_ESD_IFACE_VERSION, "esd", XINE_VERSION_CODE, &ao_info_esd, init_audio_out_plugin }, + { PLUGIN_AUDIO_OUT, AO_OUT_ESD_IFACE_VERSION, "esd", XINE_VERSION_CODE, &ao_info_esd, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; -- cgit v1.2.3