Fwd: [gst-devel] mpeg2dec-0.4.0 & gstreamer-0.6.4 don't mix
Louis Garcia
louisg00 at bellsouth.net
Sat Jan 3 14:47:00 CET 2004
Ok, I've ported this to 0.6.4 and all seems fine now. Here's the patch
in case someone wants it.
--- gst-plugins-0.6.4/ext/mpeg2dec/gstmpeg2dec.c.mpeg2dec-0.4 Fri Jan 2
20:06:51 2004
+++ gst-plugins-0.6.4/ext/mpeg2dec/gstmpeg2dec.c Fri Jan 2 20:24:33 2004
@@ -463,7 +463,11 @@
GST_DEBUG (0, "have pts: %lld (%lld)",
mpeg_pts, MPEGTIME_TO_GSTTIME (mpeg_pts));
+ #if MPEG2_RELEASE >= MPEG2_VERSION(0,4,0)
+ mpeg2_tag_picture (mpeg2dec->decoder, mpeg_pts&0xffffffff,
mpeg_pts>>32);
+ #else
mpeg2_pts (mpeg2dec->decoder, mpeg_pts);
+ #endif
}
else {
GST_DEBUG (GST_CAT_CLOCK, "no pts");
@@ -578,17 +578,24 @@
if (mpeg2dec->discont_state == MPEG2DEC_DISC_NEW_KEYFRAME &&
key_frame)
mpeg2dec->discont_state = MPEG2DEC_DISC_NONE;
+ #if MPEG2_RELEASE < MPEG2_VERSION(0,4,0)
+
if (picture->flags & PIC_FLAG_PTS) {
GstClockTime time = MPEGTIME_TO_GSTTIME (picture->pts);
GST_DEBUG (0, "picture had pts %lld", time);
- GST_BUFFER_TIMESTAMP (outbuf) = time;
-
- mpeg2dec->next_time = time;
+ GST_BUFFER_TIMESTAMP (outbuf) = mpeg2dec->next_time = time;
}
else {
GST_DEBUG (0, "picture didn't have pts using %lld",
mpeg2dec->next_time);
GST_BUFFER_TIMESTAMP (outbuf) = mpeg2dec->next_time;
}
+ #else
+ {
+ GstClockTime time = picture->tag2;
+ time = time <<32 | picture->tag;
+ GST_BUFFER_TIMESTAMP (outbuf) = mpeg2dec->next_time =
MPEGTIME_TO_GSTTIME(time);
+ }
+ #endif
mpeg2dec->next_time += (mpeg2dec->frame_period *
picture->nb_fields) >> 1;
On Sat, 2004-01-03 at 16:20, Mitch wrote:
> Bugger ! Louis is entirely correct. I forgot to decode the PTS tags
> when playing ;-( Like he said it doesn't help that totem doesn't compile
> with gst 0.7 so i couldn't test it, but i've now verified that this patch
> does work by building a gst-launch command line as shown below.
>
> Developers please confirm the new unified patch and apply to cvs. I'm adding
> it also to the bugzilla bug.
>
> Thanks
> Mitch
>
> P.s. Here is the gst-launch command line to test it works.
>
> % gst-launch-0.7 filesrc location="Bond.mpg" \! mpegdemux name=demux \! \{ queue \! mpeg2dec \! xvideosink \} \{ demux. \! queue \! ffdec_mp3 \! osssink \}
>
>
> -------- Original Message --------
> Subject: [gst-devel] mpeg2dec-0.4.0 & gstreamer-0.6.4 don't mix
> Date: Fri, 02 Jan 2004 22:07:11 -0500
> From: Louis Garcia <louisg00 at bellsouth.net>
> To: gstreamer-devel at lists.sourceforge.net
>
> I'm having problems with this combo. I was able to compile gst-plugins
> with the patch sent earlier. Using totem as my media player I can start
> an mpg clip but if I seek the video freezes though I can still here it.
> This dodn't happen with mpeg2dec-0.3.1.
> Was this patch for 0.7.x?
>
> I sure wish gst-player will be ported to gstreamer-0.7.x soon.
>
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IBM Linux Tutorials.
> Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
> Free Linux Tutorials. Learn everything from the bash shell to sys admin.
> Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>
> ______________________________________________________________________
> --- ext/mpeg2dec/gstmpeg2dec.c.orig Sat Jan 3 21:18:09 2004
> +++ ext/mpeg2dec/gstmpeg2dec.c Sat Jan 3 21:18:59 2004
> @@ -436,7 +436,11 @@
> GST_DEBUG ("have pts: %" G_GINT64_FORMAT " (%" G_GINT64_FORMAT ")",
> mpeg_pts, MPEGTIME_TO_GSTTIME (mpeg_pts));
>
> +#if MPEG2_RELEASE >= MPEG2_VERSION(0,4,0)
> + mpeg2_tag_picture (mpeg2dec->decoder, mpeg_pts&0xffffffff, mpeg_pts>>32);
> +#else
> mpeg2_pts (mpeg2dec->decoder, mpeg_pts);
> +#endif
> }
> else {
> GST_DEBUG ("no pts");
> @@ -553,18 +557,24 @@
> if (mpeg2dec->discont_state == MPEG2DEC_DISC_NEW_KEYFRAME && key_frame)
> mpeg2dec->discont_state = MPEG2DEC_DISC_NONE;
>
> +#if MPEG2_RELEASE < MPEG2_VERSION(0,4,0)
> if (picture->flags & PIC_FLAG_PTS) {
> GstClockTime time = MPEGTIME_TO_GSTTIME (picture->pts);
>
> GST_DEBUG ("picture had pts %" G_GINT64_FORMAT, time);
> - GST_BUFFER_TIMESTAMP (outbuf) = time;
> -
> - mpeg2dec->next_time = time;
> + GST_BUFFER_TIMESTAMP (outbuf) = mpeg2dec->next_time = time;
> }
> else {
> GST_DEBUG ("picture didn't have pts using %" G_GINT64_FORMAT, mpeg2dec->next_time);
> GST_BUFFER_TIMESTAMP (outbuf) = mpeg2dec->next_time;
> }
> +#else
> + {
> + GstClockTime time = picture->tag2;
> + time = time <<32 | picture->tag;
> + GST_BUFFER_TIMESTAMP (outbuf) = mpeg2dec->next_time = MPEGTIME_TO_GSTTIME(time);
> + }
> +#endif
> mpeg2dec->next_time += (mpeg2dec->frame_period * picture->nb_fields) >> 1;
>
>
More information about the gstreamer-devel
mailing list