summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/audio_out/Makefile.am81
-rw-r--r--src/audio_out/audio_oss_out.c59
-rw-r--r--src/video_out/video_out_xv.c52
-rw-r--r--src/xine-engine/audio_out.h24
-rw-r--r--src/xine-engine/load_plugins.c4
-rw-r--r--src/xine-engine/video_out.c4
-rw-r--r--src/xine-engine/video_out.h32
-rw-r--r--src/xine-engine/xine_plugin.h4
8 files changed, 178 insertions, 82 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 }
};
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c
index 2a125b721..c333afb44 100644
--- a/src/video_out/video_out_xv.c
+++ b/src/video_out/video_out_xv.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: video_out_xv.c,v 1.139 2002/10/16 21:20:19 guenter Exp $
+ * $Id: video_out_xv.c,v 1.140 2002/10/16 22:54:47 guenter Exp $
*
* video_out_xv.c, X11 video extension interface for xine
*
@@ -135,10 +135,12 @@ struct xv_driver_s {
};
typedef struct {
- config_values_t *config;
- XvPortID xv_port;
- XvAdaptorInfo *adaptor_info;
- unsigned int adaptor_num;
+ video_driver_class_t driver_class;
+
+ config_values_t *config;
+ XvPortID xv_port;
+ XvAdaptorInfo *adaptor_info;
+ unsigned int adaptor_num;
} xv_class_t;
int gX11Fail;
@@ -940,7 +942,7 @@ static int xv_gui_data_exchange (xine_vo_driver_t *this_gen,
return 0;
}
-static void xv_exit (xine_vo_driver_t *this_gen) {
+static void xv_dispose (xine_vo_driver_t *this_gen) {
xv_driver_t *this = (xv_driver_t *) this_gen;
int i;
@@ -1138,7 +1140,7 @@ static void *open_plugin (void *class_gen, xine_stream_t *stream,
this->vo_driver.set_property = xv_set_property;
this->vo_driver.get_property_min_max = xv_get_property_min_max;
this->vo_driver.gui_data_exchange = xv_gui_data_exchange;
- this->vo_driver.exit = xv_exit;
+ this->vo_driver.dispose = xv_dispose;
this->vo_driver.redraw_needed = xv_redraw_needed;
/*
@@ -1230,11 +1232,6 @@ static void *open_plugin (void *class_gen, xine_stream_t *stream,
}
/*
- * FIXME: move to class dispose
- * XvFreeAdaptorInfo (class->adaptor_info);
- */
-
- /*
* check supported image formats
*/
@@ -1277,6 +1274,27 @@ static void *open_plugin (void *class_gen, xine_stream_t *stream,
return &this->vo_driver;
}
+/*
+ * class functions
+ */
+
+static char* get_identifier (video_driver_class_t *this_gen) {
+ return "Xv";
+}
+
+static char* get_description (video_driver_class_t *this_gen) {
+ return _("xine video output plugin using the MIT X video extension");
+}
+
+static void dispose_class (video_driver_class_t *this_gen) {
+
+ xv_class_t *this = (xv_class_t *) this_gen;
+
+ XvFreeAdaptorInfo (this->adaptor_info);
+
+ free (this);
+}
+
static void *init_class (xine_t *xine, void *visual_gen) {
x11_visual_t *visual = (x11_visual_t *) visual_gen;
@@ -1347,6 +1365,10 @@ static void *init_class (xine_t *xine, void *visual_gen) {
*/
this = (xv_class_t *) malloc (sizeof (xv_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;
this->xv_port = xv_port;
this->adaptor_info = adaptor_info;
@@ -1357,15 +1379,9 @@ static void *init_class (xine_t *xine, void *visual_gen) {
static vo_info_t vo_info_xv = {
9, /* priority */
- "xine video output plugin using the MIT X video extension", /* description */
XINE_VISUAL_TYPE_X11 /* visual type */
};
-vo_info_t *get_video_out_plugin_info() {
- vo_info_xv.description = _("xine video output plugin using the MIT X video extension");
- return &vo_info_xv;
-}
-
/*
* exported plugin catalog entry
*/
diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h
index 30a8e4133..42cf7889f 100644
--- a/src/xine-engine/audio_out.h
+++ b/src/xine-engine/audio_out.h
@@ -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_out.h,v 1.36 2002/10/16 14:19:43 guenter Exp $
+ * $Id: audio_out.h,v 1.37 2002/10/16 22:54:48 guenter Exp $
*/
#ifndef HAVE_AUDIO_OUT_H
#define HAVE_AUDIO_OUT_H
@@ -234,6 +234,28 @@ struct ao_instance_s {
int64_t passthrough_offset;
};
+typedef struct audio_driver_class_s audio_driver_class_t;
+
+struct audio_driver_class_s {
+
+ /*
+ * return short, human readable identifier for this plugin class
+ */
+ char* (*get_identifier) (audio_driver_class_t *this);
+
+ /*
+ * return human readable (verbose = 1 line) description for
+ * this plugin class
+ */
+ char* (*get_description) (audio_driver_class_t *this);
+
+ /*
+ * free all class-related resources
+ */
+
+ void (*dispose) (audio_driver_class_t *this);
+};
+
/*
* this initiates the audio_out sync routines
* found in ./src/xine-engine/audio_out.c
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c
index a71f50010..95abc9fb3 100644
--- a/src/xine-engine/load_plugins.c
+++ b/src/xine-engine/load_plugins.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: load_plugins.c,v 1.100 2002/10/16 21:10:56 guenter Exp $
+ * $Id: load_plugins.c,v 1.101 2002/10/16 22:54:48 guenter Exp $
*
*
* Load input/demux/audio_out/video_out/codec plugins
@@ -149,7 +149,6 @@ static void _insert_plugin (xine_t *this,
vo_old = info->special_info;
vo_new = xine_xmalloc(sizeof(vo_info_t));
priority = vo_new->priority = vo_old->priority;
- vo_new->description = _strclone(vo_old->description);
vo_new->visual_type = vo_old->visual_type;
entry->info->special_info = vo_new;
break;
@@ -158,7 +157,6 @@ static void _insert_plugin (xine_t *this,
ao_old = info->special_info;
ao_new = xine_xmalloc(sizeof(ao_info_t));
priority = ao_new->priority = ao_old->priority;
- ao_new->description = _strclone(ao_old->description);
entry->info->special_info = ao_new;
break;
diff --git a/src/xine-engine/video_out.c b/src/xine-engine/video_out.c
index 879059fb8..8c10a1b1f 100644
--- a/src/xine-engine/video_out.c
+++ b/src/xine-engine/video_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: video_out.c,v 1.105 2002/10/14 15:47:41 guenter Exp $
+ * $Id: video_out.c,v 1.106 2002/10/16 22:54:48 guenter Exp $
*
* frame allocation / queuing / scheduling / output functions
*/
@@ -851,7 +851,7 @@ static void vo_exit (vo_instance_t *this_gen) {
vo_free_img_buffers (this_gen);
- this->driver->exit (this->driver);
+ this->driver->dispose (this->driver);
#ifdef LOG
printf ("video_out: vo_exit... done\n");
diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h
index 90bb61565..5bda23ef6 100644
--- a/src/xine-engine/video_out.h
+++ b/src/xine-engine/video_out.h
@@ -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: video_out.h,v 1.65 2002/10/16 14:19:44 guenter Exp $
+ * $Id: video_out.h,v 1.66 2002/10/16 22:54:48 guenter Exp $
*
*
* xine version of video_out.h
@@ -295,18 +295,44 @@ struct xine_vo_driver_s {
int (*gui_data_exchange) (xine_vo_driver_t *this, int data_type,
void *data);
- void (*exit) (xine_vo_driver_t *this);
-
/* check if a redraw is needed (due to resize)
* this is only used for still frames, normal video playback
* must call that inside display_frame() function.
*/
int (*redraw_needed) (xine_vo_driver_t *this);
+ /*
+ * free all resources, close driver
+ */
+
+ void (*dispose) (xine_vo_driver_t *this);
+
void *node; /* needed by plugin_loader */
+};
+
+typedef struct video_driver_class_s video_driver_class_t;
+
+struct video_driver_class_s {
+
+ /*
+ * return short, human readable identifier for this plugin class
+ */
+ char* (*get_identifier) (video_driver_class_t *this);
+
+ /*
+ * return human readable (verbose = 1 line) description for
+ * this plugin class
+ */
+ char* (*get_description) (video_driver_class_t *this);
+ /*
+ * free all class-related resources
+ */
+
+ void (*dispose) (video_driver_class_t *this);
};
+
typedef struct rle_elem_s {
uint16_t len;
uint16_t color;
diff --git a/src/xine-engine/xine_plugin.h b/src/xine-engine/xine_plugin.h
index 16845dbf0..102829d7d 100644
--- a/src/xine-engine/xine_plugin.h
+++ b/src/xine-engine/xine_plugin.h
@@ -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: xine_plugin.h,v 1.4 2002/10/14 15:47:46 guenter Exp $
+ * $Id: xine_plugin.h,v 1.5 2002/10/16 22:54:48 guenter Exp $
*
* generic plugin definitions
*
@@ -50,13 +50,11 @@ typedef struct {
/* special_info for a video output plugin */
typedef struct {
int priority; /* priority of this plugin for auto-probing */
- char *description; /* human-readable description of this plugin */
int visual_type; /* visual type supported by this plugin */
} vo_info_t;
/* special info for a audio output plugin */
typedef struct {
- char *description;
int priority;
} ao_info_t ;