GNOME Bugzilla – Bug 349068
multipart demuxer improvements
Last modified: 2006-08-17 15:52:09 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
Created attachment 69813 [details] [review] Proposed patch
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.
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)
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
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).
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.