GNOME Bugzilla – Bug 319862
Partial mpegstream/dvddemux port
Last modified: 2005-11-15 14:22:07 UTC
I have ported part of mpegstream (mpegparse and mpegdemux) to gstreamer 0.9. I used the CVS version from the 0.8 branch for porting. The mpegdemux uses chain function to process data, and it can be used for sources that do not support seeking. Not everything in mpegparse and mpegdemux is ported, I have not ported seeking, quering and maybe something more. The mpegstream module can be compiled now. The basic functionality of mpegparse and mpegdemux works. The patch is attached.
Created attachment 53911 [details] [review] Partial port of mpegstream
Created attachment 54141 [details] [review] Partial port of mpegstream (2) I have ported the dvddemux too.
Hi Josef, I tried merging this into gst-plugins-bad today as a starting point. But the code still have some gcc4 issues. Compilation stopped for me at: cc1: warnings being treated as errors gstmpegparse.c: In function 'gst_mpeg_parse_handle_discont': gstmpegparse.c:325: warning: pointer targets in passing argument 5 of 'gst_event_parse_newsegment' differ in signedness I hope you have time to update the patch for gcc4 issues and I will try to merge the patch for you.
The only change needed for gcc4 to shut up is in gstmegparse.c, line 317: static GstFlowReturn gst_mpeg_parse_handle_discont (GstMPEGParse * mpeg_parse, GstEvent * event) { GstFlowReturn result = GST_FLOW_OK;; GstFormat format; - GstClockTime time; + gint64 time; I am happy to look over it and apply it as well, I just thought maybe our resident MPEG guru might have wanted to review it. Cheers -Tim
Can't say this works too well for me: With almost all .mpg files I get crashes like this: (gst-launch-0.9:18655): GStreamer-CRITICAL **: gst_buffer_create_sub: assertion `buffer->size >= offset + size' failed Program received signal SIGSEGV, Segmentation fault. [Switching to Thread -1217569872 (LWP 18658)] gst_mpeg_demux_send_subbuffer (mpeg_demux=0x80da720, outstream=0x80cf448, buffer=0x80e2850, timestamp=The value of variable 'timestamp' is distributed across several locations, and GDB cannot access its value. ) at gstmpegdemux.c:1051 1051 GST_BUFFER_TIMESTAMP (outbuf) = timestamp; (in this case because outbuf is NULL because of the assertion failure of course). The assertion isn't thrown all the time though. Sometimes it works to some extent (with the same files). I've tried the alien file from http://gstreamer.freedesktop.org/media/medium/alien.mpg and others. I haven't looked at the code really, but I noticed that the return value of gst_pad_push() is not always passed back to the caller. There were also instances of GST_PAD_IS_USABLE() - it might be worth double checking that those are used correctly in 0.9 - the usage has changed slightly (I _think_ that you usually wouldn't use GST_PAD_IS_USABLE(), but just check the return value of gst_pad_alloc_buffer() and bail out if that is not GST_FLOW_OK). Cheers -Tim
The bug has never appeared when I have been demuxing http://gstreamer.freedesktop.org/media/medium/alien.mpg
Created attachment 54629 [details] [review] Fixed patch The bug mentioned above appeared when I used fdsrc as the data source. This patch fixes the problem. I have not removed usage of GST_PAD_IS_USABLE because I am not sure whether all pads of demuxer have to be linked.
This has been committed now, thanks! 2005-11-14 Martin Soto <soto@localhost.localdomain> * gst/mpegstream/Makefile.am (noinst_HEADERS): Add gstrfc2250enc.h. 2005-11-14 Martin Soto <martinsoto@users.sourceforge.net> * configure.ac: * gst/mpegstream/Makefile.am: * gst/mpegstream/gstdvddemux.c: * gst/mpegstream/gstdvddemux.h: * gst/mpegstream/gstmpegdemux.c: * gst/mpegstream/gstmpegdemux.h: * gst/mpegstream/gstmpegpacketize.c: * gst/mpegstream/gstmpegpacketize.h: * gst/mpegstream/gstmpegparse.c: * gst/mpegstream/gstmpegparse.h: * gst/mpegstream/gstmpegstream.c: * gst/mpegstream/gstrfc2250enc.c: * gst/mpegstream/gstrfc2250enc.h: Applied patch from Josef Zlomek <josef.zlomek@xeris.cz> to partially port the mpegstream plugin to GStreamer 0.9. Cheers -Tim