summaryrefslogtreecommitdiff
path: root/src/audio_out
diff options
context:
space:
mode:
authorGuenter Bartsch <guenter@users.sourceforge.net>2002-10-16 22:54:47 +0000
committerGuenter Bartsch <guenter@users.sourceforge.net>2002-10-16 22:54:47 +0000
commitb2c55490db29a9aaae431c899e2b6806305482c0 (patch)
treeb75b328e18c3885c443b16982b74ec7ed1036cc3 /src/audio_out
parent3156b0d743d15ad39978713167e375373265fdfc (diff)
downloadxine-lib-b2c55490db29a9aaae431c899e2b6806305482c0.tar.gz
xine-lib-b2c55490db29a9aaae431c899e2b6806305482c0.tar.bz2
introduce audio/video_driver_class_t, adapt oss audio output plugin, exclude other audio output plugin from build process
CVS patchset: 2841 CVS date: 2002/10/16 22:54:47
Diffstat (limited to 'src/audio_out')
-rw-r--r--src/audio_out/Makefile.am81
-rw-r--r--src/audio_out/audio_oss_out.c59
2 files changed, 88 insertions, 52 deletions
diff --git a/src/audio_out/Makefile.am b/src/audio_out/Makefile.am
index ddd57c0c9..692ce728b 100644
--- a/src/audio_out/Makefile.am
+++ b/src/audio_out/Makefile.am
@@ -14,66 +14,65 @@ if HAVE_OSS
oss_module = xineplug_ao_out_oss.la
endif
-if HAVE_ALSA
-if HAVE_ALSA09
-alsa_module = xineplug_ao_out_alsa.la
-endif
-endif
+#if HAVE_ALSA
+#if HAVE_ALSA09
+#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
-endif
+#if HAVE_SUNAUDIO
+#sun_module = xineplug_ao_out_sun.la
+#endif
-if HAVE_IRIXAL
-irixal_module = xineplug_ao_out_irixal.la
-endif
+#if HAVE_IRIXAL
+#irixal_module = xineplug_ao_out_irixal.la
+#endif
-if HAVE_ARTS
-arts_module = xineplug_ao_out_arts.la
-endif
+#if HAVE_ARTS
+#arts_module = xineplug_ao_out_arts.la
+#endif
##
# IMPORTANT:
# ---------
-# All of xine audio out plugins should be named like the
+# all xine audio out plugins should be named like the
# scheme "xineplug_ao_out_"
#
-#lib_LTLIBRARIES = $(oss_module) $(alsa_module) $(sun_module) \
-# $(arts_module) $(esd_module)
+lib_LTLIBRARIES = $(oss_module)
-lib_LTLIBRARIES = \
- $(alsa_module) \
- $(arts_module) \
- $(esd_module) \
- $(irixal_module) \
- $(oss_module) \
- $(sun_module)
+#lib_LTLIBRARIES = \
+# $(alsa_module) \
+# $(arts_module) \
+# $(esd_module) \
+# $(irixal_module) \
+# $(oss_module) \
+# $(sun_module)
xineplug_ao_out_oss_la_SOURCES = audio_oss_out.c
xineplug_ao_out_oss_la_LDFLAGS = -avoid-version -module
-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
+#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
-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
+#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
-xineplug_ao_out_sun_la_SOURCES = audio_sun_out.c
-xineplug_ao_out_sun_la_LDFLAGS = -avoid-version -module
+#xineplug_ao_out_sun_la_SOURCES = audio_sun_out.c
+#xineplug_ao_out_sun_la_LDFLAGS = -avoid-version -module
-xineplug_ao_out_irixal_la_SOURCES = audio_irixal_out.c
-xineplug_ao_out_irixal_la_LIBADD = $(IRIXAL_LIBS)
-xineplug_ao_out_irixal_la_LDFLAGS = -avoid-version -module
+#xineplug_ao_out_irixal_la_SOURCES = audio_irixal_out.c
+#xineplug_ao_out_irixal_la_LIBADD = $(IRIXAL_LIBS)
+#xineplug_ao_out_irixal_la_LDFLAGS = -avoid-version -module
-xineplug_ao_out_arts_la_SOURCES = audio_arts_out.c
-xineplug_ao_out_arts_la_LIBADD = $(ARTS_LIBS)
-xineplug_ao_out_arts_la_LDFLAGS = -avoid-version -module
+#xineplug_ao_out_arts_la_SOURCES = audio_arts_out.c
+#xineplug_ao_out_arts_la_LIBADD = $(ARTS_LIBS)
+#xineplug_ao_out_arts_la_LDFLAGS = -avoid-version -module
noinst_HEADERS = \
audio_alsa_out.h \
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c
index 53b0155c4..3b62989f0 100644
--- a/src/audio_out/audio_oss_out.c
+++ b/src/audio_out/audio_oss_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_oss_out.c,v 1.73 2002/09/05 20:44:38 mroi Exp $
+ * $Id: audio_oss_out.c,v 1.74 2002/10/16 22:54:47 guenter Exp $
*
* 20-8-2001 First implementation of Audio sync and Audio driver separation.
* Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk
@@ -83,7 +83,7 @@
# define AFMT_AC3 0x00000400
#endif
-#define AO_OUT_OSS_IFACE_VERSION 4
+#define AO_OUT_OSS_IFACE_VERSION 5
#define AUDIO_NUM_FRAGMENTS 15
#define AUDIO_FRAGMENT_SIZE 8192
@@ -138,6 +138,12 @@ typedef struct oss_driver_s {
struct timeval start_time;
} oss_driver_t;
+typedef struct {
+ audio_driver_class_t driver_class;
+
+ config_values_t *config;
+} oss_class_t;
+
/*
* open the audio device for writing to
*/
@@ -611,9 +617,11 @@ static int ao_oss_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) {
return 0;
}
-static void *init_audio_out_plugin (xine_t *xine, void *data) {
+static void *open_plugin (void *class_gen, xine_stream_t *stream,
+ const void *data) {
- config_values_t *config = xine->config;
+ oss_class_t *class = (oss_class_t *) class_gen;
+ config_values_t *config = class->config;
oss_driver_t *this;
int caps;
#ifdef CONFIG_DEVFS_FS
@@ -914,22 +922,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 "oss";
+}
+
+static char* get_description (audio_driver_class_t *this_gen) {
+ return _("xine audio output plugin using oss-compliant audio devices/drivers");
+}
+
+static void dispose_class (audio_driver_class_t *this_gen) {
+
+ oss_class_t *this = (oss_class_t *) this_gen;
+
+ free (this);
+}
+
+static void *init_class (xine_t *xine, void *data) {
+
+ oss_class_t *this;
+
+ this = (oss_class_t *) malloc (sizeof (oss_class_t));
+
+ 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_oss = {
- "xine audio output plugin using oss-compliant audio devices/drivers",
10
};
-ao_info_t *get_audio_out_plugin_info() {
- ao_info_oss.description = _("xine audio output plugin using oss-compliant audio devices/drivers");
- return &ao_info_oss;
-}
-
/*
* exported plugin catalog entry
*/
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_AUDIO_OUT, AO_OUT_OSS_IFACE_VERSION, "oss", XINE_VERSION_CODE, &ao_info_oss, init_audio_out_plugin },
+ { PLUGIN_AUDIO_OUT, AO_OUT_OSS_IFACE_VERSION, "oss", XINE_VERSION_CODE, &ao_info_oss,
+ init_class, open_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};