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 | |
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
-rw-r--r-- | src/audio_out/audio_oss_out.c | 11 | ||||
-rw-r--r-- | src/demuxers/demux.h | 10 | ||||
-rw-r--r-- | src/demuxers/demux_avi.c | 13 | ||||
-rw-r--r-- | src/input/input_file.c | 13 | ||||
-rw-r--r-- | src/input/input_plugin.h | 10 | ||||
-rw-r--r-- | src/libffmpeg/xine_decoder.c | 34 | ||||
-rw-r--r-- | src/libmad/xine_decoder.c | 19 | ||||
-rw-r--r-- | src/libspudec/spu_decoder_api.h | 32 | ||||
-rw-r--r-- | src/video_out/video_out_xv.c | 8 | ||||
-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 |
15 files changed, 123 insertions, 85 deletions
diff --git a/src/audio_out/audio_oss_out.c b/src/audio_out/audio_oss_out.c index 3b62989f0..361489261 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.74 2002/10/16 22:54:47 guenter Exp $ + * $Id: audio_oss_out.c,v 1.75 2002/10/17 17:43:41 mroi Exp $ * * 20-8-2001 First implementation of Audio sync and Audio driver separation. * Copyright (C) 2001 James Courtier-Dutton James@superbug.demon.co.uk @@ -617,8 +617,7 @@ static int ao_oss_ctrl(xine_ao_driver_t *this_gen, int cmd, ...) { return 0; } -static void *open_plugin (void *class_gen, xine_stream_t *stream, - const void *data) { +static xine_ao_driver_t *open_plugin (audio_driver_class_t *class_gen, const void *data) { oss_class_t *class = (oss_class_t *) class_gen; config_values_t *config = class->config; @@ -919,7 +918,7 @@ static void *open_plugin (void *class_gen, xine_stream_t *stream, this->ao_driver.get_gap_tolerance = ao_oss_get_gap_tolerance; this->ao_driver.control = ao_oss_ctrl; - return this; + return &this->ao_driver; } /* @@ -947,6 +946,7 @@ static void *init_class (xine_t *xine, void *data) { this = (oss_class_t *) malloc (sizeof (oss_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; @@ -966,7 +966,6 @@ static ao_info_t ao_info_oss = { 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_class, open_plugin }, + { PLUGIN_AUDIO_OUT, AO_OUT_OSS_IFACE_VERSION, "oss", XINE_VERSION_CODE, &ao_info_oss, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/demuxers/demux.h b/src/demuxers/demux.h index 7234a64fd..c5c74896e 100644 --- a/src/demuxers/demux.h +++ b/src/demuxers/demux.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: demux.h,v 1.20 2002/10/14 15:47:12 guenter Exp $ + * $Id: demux.h,v 1.21 2002/10/17 17:43:42 mroi Exp $ */ #ifndef HAVE_DEMUX_H @@ -43,10 +43,16 @@ #define METHOD_BY_EXTENSION 2 typedef struct demux_class_s demux_class_t ; +typedef struct demux_plugin_s demux_plugin_t; struct demux_class_s { /* + * open a new instance of this plugin class + */ + demux_plugin_t* (*open_plugin) (demux_class_t *this, xine_stream_t *stream, input_plugin_t *input); + + /* * return human readable (verbose = 1 line) description for this plugin */ char* (*get_description) (demux_class_t *this); @@ -83,8 +89,6 @@ struct demux_class_s { * any demux plugin must implement these functions */ -typedef struct demux_plugin_s demux_plugin_t; - struct demux_plugin_s { /* diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 3f7d7d224..3205f6d71 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.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: demux_avi.c,v 1.115 2002/10/16 14:09:12 guenter Exp $ + * $Id: demux_avi.c,v 1.116 2002/10/17 17:43:42 mroi Exp $ * * demultiplexer for avi streams * @@ -1508,8 +1508,8 @@ static int demux_avi_get_stream_length (demux_plugin_t *this_gen) { return 0; } -static void* open_plugin (void *class_gen, xine_stream_t *stream, - const void *input_gen) { +static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *stream, + input_plugin_t *input_gen) { input_plugin_t *input = (input_plugin_t *) input_gen; demux_avi_t *this; @@ -1593,7 +1593,7 @@ static void* open_plugin (void *class_gen, xine_stream_t *stream, printf ("demux_avi: %ld frames\n", this->avi->video_idx.video_frames); - return this; + return &this->demux_plugin; } static char *get_description (demux_class_t *this_gen) { @@ -1628,6 +1628,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->config = xine->config; this->xine = xine; + this->demux_class.open_plugin = open_plugin; this->demux_class.get_description = get_description; this->demux_class.get_identifier = get_identifier; this->demux_class.get_mimetypes = get_mimetypes; @@ -1643,6 +1644,6 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_DEMUX, 14, "avi", XINE_VERSION_CODE, NULL, init_plugin, open_plugin }, - { PLUGIN_NONE, 0, "", 0, NULL, NULL, NULL } + { PLUGIN_DEMUX, 14, "avi", XINE_VERSION_CODE, NULL, init_plugin }, + { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/input_file.c b/src/input/input_file.c index 365950ecc..123610682 100644 --- a/src/input/input_file.c +++ b/src/input/input_file.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: input_file.c,v 1.62 2002/10/16 14:09:13 guenter Exp $ + * $Id: input_file.c,v 1.63 2002/10/17 17:43:43 mroi Exp $ */ #ifdef HAVE_CONFIG_H @@ -234,13 +234,13 @@ static void file_plugin_dispose (input_plugin_t *this_gen ) { free (this); } -static void *open_plugin (void *cls_gen, xine_stream_t *stream, - const void *data) { +static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *stream, + const char *data) { file_input_class_t *cls = (file_input_class_t *) cls_gen; file_input_plugin_t *this; - char *mrl = strdup ((char *) data); FILE *sub; + char *mrl = strdup(data); char *filename, *subtitle; int fh; @@ -288,7 +288,7 @@ static void *open_plugin (void *cls_gen, xine_stream_t *stream, this->input_plugin.get_optional_data = file_plugin_get_optional_data; this->input_plugin.dispose = file_plugin_dispose; - return this; + return &this->input_plugin; } @@ -808,6 +808,7 @@ static void *init_plugin (xine_t *xine, void *data) { this->config = xine->config; config = xine->config; + this->input_class.open_plugin = open_plugin; this->input_class.get_dir = file_class_get_dir; this->input_class.get_description = file_class_get_description; this->input_class.get_autoplay_list = NULL; @@ -844,7 +845,7 @@ static void *init_plugin (xine_t *xine, void *data) { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_INPUT, 9, "file", XINE_VERSION_CODE, NULL, init_plugin, open_plugin }, + { PLUGIN_INPUT, 9, "file", XINE_VERSION_CODE, NULL, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/input/input_plugin.h b/src/input/input_plugin.h index 20ce70653..dc00593a6 100644 --- a/src/input/input_plugin.h +++ b/src/input/input_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: input_plugin.h,v 1.32 2002/10/14 15:47:19 guenter Exp $ + * $Id: input_plugin.h,v 1.33 2002/10/17 17:43:43 mroi Exp $ */ #ifndef HAVE_INPUT_PLUGIN_H @@ -32,10 +32,16 @@ #define INPUT_PLUGIN_IFACE_VERSION 9 typedef struct input_class_s input_class_t ; +typedef struct input_plugin_s input_plugin_t; struct input_class_s { /* + * open a new instance of this plugin class + */ + input_plugin_t* (*open_plugin) (input_class_t *this, xine_stream_t *stream, const char *mrl); + + /* * return short, human readable identifier for this plugin class */ char* (*get_identifier) (input_class_t *this); @@ -71,8 +77,6 @@ struct input_class_s { int (*eject_media) (input_class_t *this); }; -typedef struct input_plugin_s input_plugin_t; - struct input_plugin_s { /* diff --git a/src/libffmpeg/xine_decoder.c b/src/libffmpeg/xine_decoder.c index 64e74940c..cbcb4b0e4 100644 --- a/src/libffmpeg/xine_decoder.c +++ b/src/libffmpeg/xine_decoder.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: xine_decoder.c,v 1.57 2002/10/14 20:47:31 guenter Exp $ + * $Id: xine_decoder.c,v 1.58 2002/10/17 17:43:43 mroi Exp $ * * xine decoder plugin using ffmpeg * @@ -59,7 +59,6 @@ typedef struct ff_decoder_s { ff_class_t *class; xine_stream_t *stream; - vo_instance_t *video_out; int video_step; int decoder_ok; @@ -103,7 +102,7 @@ static void init_codec (ff_decoder_t *this, AVCodec *codec) { } this->decoder_ok = 1; - this->video_out->open (this->video_out); + this->stream->video_out->open (this->stream->video_out); /* needed to play streams generated by MS ISO MPEG4 codec. Michael Niedermayer explained: @@ -371,7 +370,7 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { } this->decoder_ok = 1; - this->video_out->open (this->video_out); + this->stream->video_out->open (this->stream->video_out); /* needed to play streams generated by MS ISO MPEG4 codec. Michael Niedermayer explained: @@ -465,13 +464,13 @@ static void ff_decode_data (video_decoder_t *this_gen, buf_element_t *buf) { ratio = XINE_VO_ASPECT_DONT_TOUCH; } - img = this->video_out->get_frame (this->video_out, - /* this->av_picture.linesize[0], */ - this->bih.biWidth, - this->bih.biHeight, - ratio, - XINE_IMGFMT_YV12, - VO_BOTH_FIELDS); + img = this->stream->video_out->get_frame (this->stream->video_out, + /* this->av_picture.linesize[0], */ + this->bih.biWidth, + this->bih.biHeight, + ratio, + XINE_IMGFMT_YV12, + VO_BOTH_FIELDS); img->pts = buf->pts; buf->pts = 0; @@ -605,7 +604,7 @@ static void ff_dispose (video_decoder_t *this_gen) { if (this->decoder_ok) { avcodec_close (&this->context); - this->video_out->close(this->video_out); + this->stream->video_out->close(this->stream->video_out); this->decoder_ok = 0; } @@ -616,11 +615,9 @@ static void ff_dispose (video_decoder_t *this_gen) { free (this_gen); } -void * open_plugin (void *class_gen, xine_stream_t *stream, - const void *vo_gen) { +static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream) { ff_decoder_t *this ; - vo_instance_t *vo = (vo_instance_t *) vo_gen; this = (ff_decoder_t *) malloc (sizeof (ff_decoder_t)); @@ -635,7 +632,6 @@ void * open_plugin (void *class_gen, xine_stream_t *stream, this->chunk_buffer = xine_xmalloc (SLICE_BUFFER_SIZE + 4); - this->video_out = vo; this->decoder_ok = 0; this->buf = NULL; @@ -645,7 +641,7 @@ void * open_plugin (void *class_gen, xine_stream_t *stream, this->is_continous = 0; - return (video_decoder_t *) this; + return &this->video_decoder; } /* @@ -676,6 +672,7 @@ static void *init_plugin (xine_t *xine, void *data) { this = (ff_class_t *) malloc (sizeof (ff_class_t)); + this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; this->decoder_class.get_description = get_description; this->decoder_class.dispose = dispose_class; @@ -711,7 +708,6 @@ static decoder_info_t dec_info_ffmpeg = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_DECODER, 11, "ffmpeg", XINE_VERSION_CODE, &dec_info_ffmpeg, - init_plugin, open_plugin }, + { PLUGIN_VIDEO_DECODER, 11, "ffmpeg", XINE_VERSION_CODE, &dec_info_ffmpeg, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libmad/xine_decoder.c b/src/libmad/xine_decoder.c index 63e28f4c2..526eb75f3 100644 --- a/src/libmad/xine_decoder.c +++ b/src/libmad/xine_decoder.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: xine_decoder.c,v 1.28 2002/10/16 23:13:19 guenter Exp $ + * $Id: xine_decoder.c,v 1.29 2002/10/17 17:43:43 mroi Exp $ * * stuff needed to turn libmad into a xine decoder plugin */ @@ -250,11 +250,9 @@ static void mad_dispose (audio_decoder_t *this_gen) { free (this_gen); } -void * open_plugin (void *class_gen, xine_stream_t *stream, - const void *ao_gen) { +static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream) { mad_decoder_t *this ; - ao_instance_t *ao = (ao_instance_t *) ao_gen; this = (mad_decoder_t *) malloc (sizeof (mad_decoder_t)); @@ -262,7 +260,6 @@ void * open_plugin (void *class_gen, xine_stream_t *stream, this->audio_decoder.reset = mad_reset; this->audio_decoder.dispose = mad_dispose; - this->audio_out = ao; this->output_open = 0; this->bytes_in_buffer = 0; @@ -274,22 +271,22 @@ void * open_plugin (void *class_gen, xine_stream_t *stream, printf ("libmad: init\n"); #endif - return this; + return &this->audio_decoder; } /* * mad plugin class */ -static char *get_identifier (video_decoder_class_t *this) { +static char *get_identifier (audio_decoder_class_t *this) { return "mad"; } -static char *get_description (video_decoder_class_t *this) { +static char *get_description (audio_decoder_class_t *this) { return "libmad based mpeg audio layer 1/2/3 decoder plugin"; } -static void dispose_class (video_decoder_class_t *this) { +static void dispose_class (audio_decoder_class_t *this) { free (this); } @@ -299,6 +296,7 @@ static void *init_plugin (xine_t *xine, void *data) { this = (mad_class_t *) malloc (sizeof (mad_class_t)); + this->decoder_class.open_plugin = open_plugin; this->decoder_class.get_identifier = get_identifier; this->decoder_class.get_description = get_description; this->decoder_class.dispose = dispose_class; @@ -317,7 +315,6 @@ static decoder_info_t dec_info_audio = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_AUDIO_DECODER, 10, "mad", XINE_VERSION_CODE, &dec_info_audio, - init_plugin, open_plugin }, + { PLUGIN_AUDIO_DECODER, 10, "mad", XINE_VERSION_CODE, &dec_info_audio, init_plugin }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; diff --git a/src/libspudec/spu_decoder_api.h b/src/libspudec/spu_decoder_api.h index 937bc7507..d17f32a7b 100644 --- a/src/libspudec/spu_decoder_api.h +++ b/src/libspudec/spu_decoder_api.h @@ -31,14 +31,36 @@ /* * generic xine spu decoder plugin interface - * - * for a dynamic plugin make sure you provide this function call: - * spu_decoder_t *init_spu_decoder_plugin (int iface_version, - * xine_t *xine); */ +typedef struct spu_decoder_class_s spu_decoder_class_t; typedef struct spu_decoder_s spu_decoder_t; +struct spu_decoder_class_s { + + /* + * open a new instance of this plugin class + */ + spu_decoder_t* (*open_plugin) (spu_decoder_class_t *this, xine_stream_t *stream); + + /* + * return short, human readable identifier for this plugin class + */ + char* (*get_identifier) (spu_decoder_class_t *this); + + /* + * return human readable (verbose = 1 line) description for + * this plugin class + */ + char* (*get_description) (spu_decoder_class_t *this); + + /* + * free all class-related resources + */ + void (*dispose) (spu_decoder_class_t *this); +}; + + struct spu_decoder_s { void (*init) (spu_decoder_t *this, vo_instance_t *video_out); @@ -49,8 +71,6 @@ struct spu_decoder_s { void (*close) (spu_decoder_t *this); - char* (*get_identifier) (void); - void (*dispose) (spu_decoder_t *this); int (*get_nav_pci) (spu_decoder_t *this, pci_t *nav_pci); diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index c333afb44..b574fb4ea 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.140 2002/10/16 22:54:47 guenter Exp $ + * $Id: video_out_xv.c,v 1.141 2002/10/17 17:43:43 mroi Exp $ * * video_out_xv.c, X11 video extension interface for xine * @@ -1074,8 +1074,7 @@ static void xv_update_XV_DOUBLE_BUFFER(void *this_gen, xine_cfg_entry_t *entry) } -static void *open_plugin (void *class_gen, xine_stream_t *stream, - const void *visual_gen) { +static xine_vo_driver_t *open_plugin (video_driver_class_t *class_gen, const void *visual_gen) { xv_class_t *class = (xv_class_t *) class_gen; config_values_t *config = class->config; @@ -1365,6 +1364,7 @@ static void *init_class (xine_t *xine, void *visual_gen) { */ this = (xv_class_t *) malloc (sizeof (xv_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; @@ -1388,7 +1388,7 @@ static vo_info_t vo_info_xv = { plugin_info_t xine_plugin_info[] = { /* type, API, "name", version, special_info, init_function */ - { PLUGIN_VIDEO_OUT, 10, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class, open_plugin }, + { PLUGIN_VIDEO_OUT, 10, "xv", XINE_VERSION_CODE, &vo_info_xv, init_class }, { PLUGIN_NONE, 0, "", 0, NULL, NULL } }; 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; |