summaryrefslogtreecommitdiff
path: root/src/libffmpeg/xine_decoder.c
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-10-17 17:43:41 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-10-17 17:43:41 +0000
commit3bb1499e2dd8f9e63494259343968ae71060f6cb (patch)
tree208a51acd986b4f60aa90e6a61771e9633bbf44f /src/libffmpeg/xine_decoder.c
parent76450053c7fa0b7dac22b5a0d77c287ac1410fca (diff)
downloadxine-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/libffmpeg/xine_decoder.c')
-rw-r--r--src/libffmpeg/xine_decoder.c34
1 files changed, 15 insertions, 19 deletions
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 }
};