After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319862 - Partial mpegstream/dvddemux port
Partial mpegstream/dvddemux port
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-ugly
git master
Other Linux
: Normal enhancement
: 0.9.6
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-26 14:49 UTC by Josef Zlomek
Modified: 2005-11-15 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Partial port of mpegstream (105.11 KB, patch)
2005-10-26 14:51 UTC, Josef Zlomek
none Details | Review
Partial port of mpegstream (2) (106.35 KB, patch)
2005-10-31 15:56 UTC, Josef Zlomek
none Details | Review
Fixed patch (109.10 KB, patch)
2005-11-11 12:05 UTC, Josef Zlomek
committed Details | Review

Description Josef Zlomek 2005-10-26 14:49:43 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.
Comment 1 Josef Zlomek 2005-10-26 14:51:22 UTC
Created attachment 53911 [details] [review]
Partial port of mpegstream
Comment 2 Josef Zlomek 2005-10-31 15:56:44 UTC
Created attachment 54141 [details] [review]
Partial port of mpegstream (2)

I have ported the dvddemux too.
Comment 3 Christian Fredrik Kalager Schaller 2005-11-04 11:50:12 UTC
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. 
Comment 4 Tim-Philipp Müller 2005-11-05 11:26:06 UTC
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
Comment 5 Tim-Philipp Müller 2005-11-05 12:47:26 UTC
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
Comment 6 Josef Zlomek 2005-11-10 14:33:27 UTC
The bug has never appeared when I have been demuxing
http://gstreamer.freedesktop.org/media/medium/alien.mpg
Comment 7 Josef Zlomek 2005-11-11 12:05:51 UTC
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.
Comment 8 Tim-Philipp Müller 2005-11-15 14:22:07 UTC
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