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 349068 - multipart demuxer improvements
multipart demuxer improvements
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
0.10.x
Other Linux
: Normal normal
: 0.10.5
Assigned To: Wim Taymans
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-28 10:56 UTC by Sjoerd Simons
Modified: 2006-08-17 15:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch (18.03 KB, patch)
2006-07-28 10:56 UTC, Sjoerd Simons
committed Details | Review
Accept leading whitespace before the boundary (1.31 KB, patch)
2006-08-08 08:12 UTC, Sjoerd Simons
committed Details | Review
accept some extra whitespace before the multipart boundary (1.24 KB, patch)
2006-08-08 08:14 UTC, Sjoerd Simons
committed Details | Review

Description Sjoerd Simons 2006-07-28 10:56:02 UTC
I've made a patch to improve the multipartdemuxer somewhat, in the end it became almost a complete rewrite

Features:
* Uses GstAdapter instead of own buffering
* Actually parses the mime-type correctly (In tests the mime-type was always "" with the old version)
* Uses the Content-length header if available to speed up things
* Reliably autoscan's the boundary name by default, so when combined with the    patch from #348916 pipelines like ``gnomevfssrc location=<camurl> ! decodebin ! xvimagesink'' become possible
Comment 1 Sjoerd Simons 2006-07-28 10:56:47 UTC
Created attachment 69813 [details] [review]
Proposed patch
Comment 2 Wim Taymans 2006-07-28 16:16:32 UTC
Thanks! Comitting already because it's much better than what there currently is. 

I think it does the wrong thing if the stream starts in the middle of a data packet. It will first scan for a \n, which is the end of the data packet and will then fail because there is no boundary marker in front of it. Maybe scanning for [r]\n--<marker>[\r]\n would work better.


        Patch by: Sjoerd Simons <sjoerd at luon dot net>

        * gst/multipart/multipartdemux.c: (gst_multipart_demux_base_init),
        (gst_multipart_demux_class_init), (gst_multipart_demux_init),
        (gst_multipart_demux_finalize), (get_line_end),
        (multipart_parse_header), (multipart_find_boundary),
        (gst_multipart_demux_chain), (gst_multipart_demux_change_state),
        (gst_multipart_set_property), (gst_multipart_get_property):
        Uses GstAdapter instead of own buffering.
        Actually parses the mime-type correctly (In tests the mime-type was
        always "" with the old version).
        Uses the Content-length header if available to speed up things.
        Reliably autoscans the boundary name by default.
        Almost fixes #349068.

        * gst/multipart/multipartmux.c: (gst_multipart_mux_collected):
        Don't start the stream with a \n.
Comment 3 Sjoerd Simons 2006-08-08 08:12:13 UTC
Created attachment 70464 [details] [review]
Accept leading whitespace before the boundary

This patch makes the demuxer allow some whitespace before the actual boundary. This makes the demuxer work with the ``old'' gstreamer multipartmuxer again (which placed an extra \n before the start of the stream)
Comment 4 Sjoerd Simons 2006-08-08 08:14:58 UTC
Created attachment 70465 [details] [review]
accept some extra whitespace before the multipart boundary

This patch makest he multipart typefind functions accept some extra whitespace (at most 14 chars) before the actual boundary. This makes the typefind function work on streams created by the old gstreamer multipart muxer
Comment 5 Tim-Philipp Müller 2006-08-08 08:47:43 UTC
Committed typefinding improvements:

 2006-08-08  Tim-Philipp Müller  <tim at centricular dot net>

       Patch by: Sjoerd Simons  <sjoerd at luon net>

       * gst/typefind/gsttypefindfunctions.c: (multipart_type_find):
         Better detection for multipart/x-mixed-replace: accept leading
         whitespaces before the boundary marker as well (as our very own
         multipartmux used to produce) (#349068).
Comment 6 Wim Taymans 2006-08-17 15:52:09 UTC
        Patch by: Sjoerd Simons <sjoerd at luon dot net>

        * gst/multipart/multipartdemux.c: (multipart_parse_header):
        Accept leading whitespace before the boundary
        This patch makes the demuxer allow some whitespace before the actual
        boundary. This makes the demuxer work with the ``old'' gstreamer
        multipartmuxer again (which placed an extra \n before the start
        of the stream) Fixes #349068.