summaryrefslogtreecommitdiff
path: root/src/libmpeg2
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2002-11-20 11:57:38 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2002-11-20 11:57:38 +0000
commit4e95a4f5224e241075b8cd86b4423c85c1d0ee26 (patch)
treecd9287e15591dce94560663ad66fc4005d006012 /src/libmpeg2
parent74893748b868ecc6ae539fa66e326e06947c4ac9 (diff)
downloadxine-lib-4e95a4f5224e241075b8cd86b4423c85c1d0ee26.tar.gz
xine-lib-4e95a4f5224e241075b8cd86b4423c85c1d0ee26.tar.bz2
engine modifications to allow post plugin layer:
* new public output interface xine_{audio,video}_port_t instead of xine_{ao,vo}_driver_t, old names kept as aliases for compatibility * modified the engine to allow multiple streams per output * renaming of some internal structures according to public changes * moving SCR out of per-stream-metronom into a global metronom_clock_t residing in xine_t and therefore easily available to the output layer * adapting all available plugins (note to external projects: the compiler will help you a lot, if a plugin compiles, it is adapted, because all changes add new parameters to some functions) * bump up all interface versions because of xine_t and xine_stream_t changes CVS patchset: 3312 CVS date: 2002/11/20 11:57:38
Diffstat (limited to 'src/libmpeg2')
-rw-r--r--src/libmpeg2/decode.c13
-rw-r--r--src/libmpeg2/mpeg2.h4
-rw-r--r--src/libmpeg2/xine_decoder.c10
3 files changed, 14 insertions, 13 deletions
diff --git a/src/libmpeg2/decode.c b/src/libmpeg2/decode.c
index f0674512f..5e6d73ca1 100644
--- a/src/libmpeg2/decode.c
+++ b/src/libmpeg2/decode.c
@@ -51,7 +51,7 @@
static void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer);
void mpeg2_init (mpeg2dec_t * mpeg2dec,
- vo_instance_t * output)
+ xine_video_port_t * output)
{
static int do_init = 1;
uint32_t mm_accel;
@@ -258,12 +258,13 @@ static inline int parse_chunk (mpeg2dec_t * mpeg2dec, int code,
picture->current_frame->pts = 0;
get_frame_duration(mpeg2dec, picture->current_frame);
- mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame);
+ mpeg2dec->frames_to_drop = picture->current_frame->draw (picture->current_frame, mpeg2dec->stream);
picture->current_frame->drawn = 1;
}
} else if (picture->forward_reference_frame && !picture->forward_reference_frame->drawn) {
get_frame_duration(mpeg2dec, picture->forward_reference_frame);
- mpeg2dec->frames_to_drop = picture->forward_reference_frame->draw (picture->forward_reference_frame);
+ mpeg2dec->frames_to_drop = picture->forward_reference_frame->draw (picture->forward_reference_frame,
+ mpeg2dec->stream);
picture->forward_reference_frame->drawn = 1;
}
}
@@ -631,7 +632,7 @@ void mpeg2_flush (mpeg2dec_t * mpeg2dec) {
get_frame_duration(mpeg2dec, picture->current_frame);
picture->current_frame->pts = 0;
- picture->current_frame->draw(picture->current_frame);
+ picture->current_frame->draw(picture->current_frame, mpeg2dec->stream);
}
}
@@ -657,7 +658,7 @@ void mpeg2_close (mpeg2dec_t * mpeg2dec)
printf ("libmpeg2: blasting out current frame on close\n");
picture->current_frame->pts = 0;
get_frame_duration(mpeg2dec, picture->current_frame);
- picture->current_frame->draw (picture->current_frame);
+ picture->current_frame->draw (picture->current_frame, mpeg2dec->stream);
picture->current_frame->drawn = 1;
}
@@ -679,7 +680,7 @@ void mpeg2_close (mpeg2dec_t * mpeg2dec)
printf ("libmpeg2: blasting out backward reference frame on close\n");
picture->backward_reference_frame->pts = 0;
get_frame_duration(mpeg2dec, picture->backward_reference_frame);
- picture->backward_reference_frame->draw (picture->backward_reference_frame);
+ picture->backward_reference_frame->draw (picture->backward_reference_frame, mpeg2dec->stream);
picture->backward_reference_frame->drawn = 1;
}
picture->backward_reference_frame->free (picture->backward_reference_frame);
diff --git a/src/libmpeg2/mpeg2.h b/src/libmpeg2/mpeg2.h
index 38e868919..993bdffc4 100644
--- a/src/libmpeg2/mpeg2.h
+++ b/src/libmpeg2/mpeg2.h
@@ -22,7 +22,7 @@
/* Structure for the mpeg2dec decoder */
typedef struct mpeg2dec_s {
- vo_instance_t * output;
+ xine_video_port_t * output;
/* this is where we keep the state of the decoder */
struct picture_s * picture, *picture_base;
@@ -52,7 +52,7 @@ typedef struct mpeg2dec_s {
/* initialize mpegdec with a opaque user pointer */
void mpeg2_init (mpeg2dec_t * mpeg2dec,
- vo_instance_t * output);
+ xine_video_port_t * output);
/* destroy everything which was allocated, shutdown the output */
void mpeg2_close (mpeg2dec_t * mpeg2dec);
diff --git a/src/libmpeg2/xine_decoder.c b/src/libmpeg2/xine_decoder.c
index 07034af72..ae634fd87 100644
--- a/src/libmpeg2/xine_decoder.c
+++ b/src/libmpeg2/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.43 2002/11/12 18:40:52 miguelfreitas Exp $
+ * $Id: xine_decoder.c,v 1.44 2002/11/20 11:57:44 mroi Exp $
*
* stuff needed to turn libmpeg2 into a xine decoder plugin
*/
@@ -50,7 +50,7 @@ typedef struct mpeg2dec_decoder_s {
mpeg2dec_t mpeg2;
mpeg2_class_t *class;
xine_stream_t *stream;
- vo_instance_t *video_out;
+ xine_video_port_t *video_out;
pthread_mutex_t lock; /* mutex for async flush */
} mpeg2dec_decoder_t;
@@ -135,7 +135,7 @@ static void mpeg2dec_dispose (video_decoder_t *this_gen) {
mpeg2_close (&this->mpeg2);
- this->video_out->close(this->video_out);
+ this->video_out->close(this->video_out, this->stream);
pthread_mutex_unlock (&this->lock);
@@ -162,7 +162,7 @@ static video_decoder_t *open_plugin (video_decoder_class_t *class_gen, xine_stre
pthread_mutex_lock (&this->lock);
mpeg2_init (&this->mpeg2, stream->video_out);
- stream->video_out->open(stream->video_out);
+ stream->video_out->open(stream->video_out, stream);
this->video_out = stream->video_out;
this->mpeg2.force_aspect = 0;
@@ -213,6 +213,6 @@ static decoder_info_t dec_info_mpeg2 = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER, 12, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin },
+ { PLUGIN_VIDEO_DECODER, 13, "mpeg2", XINE_VERSION_CODE, &dec_info_mpeg2, init_plugin },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};