diff options
author | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-10-17 17:43:41 +0000 |
---|---|---|
committer | Michael Roitzsch <mroi@users.sourceforge.net> | 2002-10-17 17:43:41 +0000 |
commit | 3bb1499e2dd8f9e63494259343968ae71060f6cb (patch) | |
tree | 208a51acd986b4f60aa90e6a61771e9633bbf44f /src/xine-engine | |
parent | 76450053c7fa0b7dac22b5a0d77c287ac1410fca (diff) | |
download | xine-lib-3bb1499e2dd8f9e63494259343968ae71060f6cb.tar.gz xine-lib-3bb1499e2dd8f9e63494259343968ae71060f6cb.tar.bz2 |
move open_plugin function (used to create new plugin instances) from the plugin info
struct to the plugin class struct
small nerby change in libffmpeg decoder plugin:
access to video_out/audio_out in decoders should now be done via the
appropriate members in xine_stream_t
CVS patchset: 2843
CVS date: 2002/10/17 17:43:41
Diffstat (limited to 'src/xine-engine')
-rw-r--r-- | src/xine-engine/audio_decoder.h | 12 | ||||
-rw-r--r-- | src/xine-engine/audio_out.h | 9 | ||||
-rw-r--r-- | src/xine-engine/load_plugins.c | 17 | ||||
-rw-r--r-- | src/xine-engine/video_decoder.h | 10 | ||||
-rw-r--r-- | src/xine-engine/video_out.h | 7 | ||||
-rw-r--r-- | src/xine-engine/xine_plugin.h | 3 |
6 files changed, 37 insertions, 21 deletions
diff --git a/src/xine-engine/audio_decoder.h b/src/xine-engine/audio_decoder.h index 2fd3fcf7f..fff415312 100644 --- a/src/xine-engine/audio_decoder.h +++ b/src/xine-engine/audio_decoder.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_decoder.h,v 1.4 2002/10/14 20:50:17 guenter Exp $ + * $Id: audio_decoder.h,v 1.5 2002/10/17 17:43:44 mroi Exp $ * * xine audio decoder plugin interface * @@ -36,10 +36,16 @@ */ typedef struct audio_decoder_class_s audio_decoder_class_t; +typedef struct audio_decoder_s audio_decoder_t; struct audio_decoder_class_s { /* + * open a new instance of this plugin class + */ + audio_decoder_t* (*open_plugin) (audio_decoder_class_t *this, xine_stream_t *stream); + + /* * return short, human readable identifier for this plugin class */ char* (*get_identifier) (audio_decoder_class_t *this); @@ -54,12 +60,10 @@ struct audio_decoder_class_s { * free all class-related resources */ - void (*dispose) (video_decoder_class_t *this); + void (*dispose) (audio_decoder_class_t *this); }; -typedef struct audio_decoder_s audio_decoder_t; - struct audio_decoder_s { /* diff --git a/src/xine-engine/audio_out.h b/src/xine-engine/audio_out.h index 42cf7889f..c3d7d1090 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.37 2002/10/16 22:54:48 guenter Exp $ + * $Id: audio_out.h,v 1.38 2002/10/17 17:43:44 mroi Exp $ */ #ifndef HAVE_AUDIO_OUT_H #define HAVE_AUDIO_OUT_H @@ -201,7 +201,7 @@ struct ao_instance_s { */ int (*control) (ao_instance_t *this, int cmd, /* arg */ ...); - + /* private stuff */ xine_ao_driver_t *driver; @@ -239,6 +239,11 @@ typedef struct audio_driver_class_s audio_driver_class_t; struct audio_driver_class_s { /* + * open a new instance of this plugin class + */ + xine_ao_driver_t* (*open_plugin) (audio_driver_class_t *this, const void *data); + + /* * return short, human readable identifier for this plugin class */ char* (*get_identifier) (audio_driver_class_t *this); diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 95abc9fb3..da60a5514 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.101 2002/10/16 22:54:48 guenter Exp $ + * $Id: load_plugins.c,v 1.102 2002/10/17 17:43:44 mroi Exp $ * * * Load input/demux/audio_out/video_out/codec plugins @@ -354,7 +354,6 @@ static void *_load_plugin_class(xine_t *this, && !strcasecmp(info->id, target->id) && info->version == target->version){ - target->open = info->open; return info->init(this, data); } info++; @@ -613,7 +612,7 @@ input_plugin_t *find_input_plugin (xine_stream_t *stream, const char *mrl) { while (node) { input_plugin_t *plugin; - if ((plugin = node->info->open (node->plugin_class, stream, mrl))) { + if ((plugin = ((input_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, mrl))) { pthread_mutex_unlock (&catalog->lock); return plugin; } @@ -657,7 +656,7 @@ static demux_plugin_t *probe_demux (xine_stream_t *stream, int method1, int meth while (node) { demux_plugin_t *plugin; - if ((plugin = node->info->open (node->plugin_class, stream, input))) { + if ((plugin = ((demux_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream, input))) { pthread_mutex_unlock (&catalog->lock); return plugin; } @@ -799,7 +798,7 @@ static xine_vo_driver_t *_load_video_driver (xine_t *this, plugin_node_t *node, if (!node->plugin_class) return NULL; - driver = (xine_vo_driver_t *) node->info->open (node->plugin_class, NULL, data); + driver = ((video_driver_class_t *)node->plugin_class)->open_plugin(node->plugin_class, data); if (driver) { driver->node = node; @@ -941,7 +940,7 @@ static xine_ao_driver_t *_load_audio_driver (xine_t *this, plugin_node_t *node, if (!node->plugin_class) return NULL; - driver = (xine_ao_driver_t *) node->info->open (node->plugin_class, NULL, data); + driver = ((audio_driver_class_t *)node->plugin_class)->open_plugin(node->plugin_class, data); if (driver) { driver->node = node; @@ -1114,7 +1113,7 @@ video_decoder_t *get_video_decoder (xine_stream_t *stream, uint8_t stream_type) return NULL; } - vd = (video_decoder_t *) node->info->open (node->plugin_class, stream, NULL); + vd = ((video_decoder_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream); if (vd) { vd->node = node; @@ -1183,7 +1182,7 @@ audio_decoder_t *get_audio_decoder (xine_stream_t *stream, uint8_t stream_type) return NULL; } - ad = (audio_decoder_t *) node->info->open (node->plugin_class, stream, NULL); + ad = ((audio_decoder_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream); if (ad) { ad->node = node; @@ -1251,7 +1250,7 @@ spu_decoder_t *get_spu_decoder (xine_stream_t *stream, uint8_t stream_type) { return NULL; } - sd = (spu_decoder_t *) node->info->open (node->plugin_class, stream, NULL); + sd = ((spu_decoder_class_t *)node->plugin_class)->open_plugin(node->plugin_class, stream); if (sd) { sd->node = node; diff --git a/src/xine-engine/video_decoder.h b/src/xine-engine/video_decoder.h index 150a4528b..24a5f650d 100644 --- a/src/xine-engine/video_decoder.h +++ b/src/xine-engine/video_decoder.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_decoder.h,v 1.4 2002/10/14 19:29:20 guenter Exp $ + * $Id: video_decoder.h,v 1.5 2002/10/17 17:43:44 mroi Exp $ * * xine video decoder plugin interface * @@ -36,10 +36,16 @@ */ typedef struct video_decoder_class_s video_decoder_class_t; +typedef struct video_decoder_s video_decoder_t; struct video_decoder_class_s { /* + * open a new instance of this plugin class + */ + video_decoder_t* (*open_plugin) (video_decoder_class_t *this, xine_stream_t *stream); + + /* * return short, human readable identifier for this plugin class */ char* (*get_identifier) (video_decoder_class_t *this); @@ -58,8 +64,6 @@ struct video_decoder_class_s { }; -typedef struct video_decoder_s video_decoder_t; - struct video_decoder_s { /* diff --git a/src/xine-engine/video_out.h b/src/xine-engine/video_out.h index 5bda23ef6..f97c4a86f 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.66 2002/10/16 22:54:48 guenter Exp $ + * $Id: video_out.h,v 1.67 2002/10/17 17:43:44 mroi Exp $ * * * xine version of video_out.h @@ -315,6 +315,11 @@ typedef struct video_driver_class_s video_driver_class_t; struct video_driver_class_s { /* + * open a new instance of this plugin class + */ + xine_vo_driver_t* (*open_plugin) (video_driver_class_t *this, const void *visual); + + /* * return short, human readable identifier for this plugin class */ char* (*get_identifier) (video_driver_class_t *this); diff --git a/src/xine-engine/xine_plugin.h b/src/xine-engine/xine_plugin.h index 102829d7d..31c94da1b 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.5 2002/10/16 22:54:48 guenter Exp $ + * $Id: xine_plugin.h,v 1.6 2002/10/17 17:43:44 mroi Exp $ * * generic plugin definitions * @@ -43,7 +43,6 @@ typedef struct { uint32_t version; /* version number, increased every release */ void *special_info; /* plugin-type specific, see structs below */ void *(*init)(xine_t *, void *); /* init the plugin class */ - void *(*open)(void *, xine_stream_t *, const void *); /* create an instance*/ } plugin_info_t; |