MultipartDemux and JpegDec are not linking
Tim Müller
tim at centricular.com
Thu Mar 3 20:19:29 UTC 2016
On Wed, 2016-03-02 at 08:08 -0800, RobAtBCIS wrote:
Hi,
> I am getting a 'Could not demultiplex stream' when trying to use the
> souphttpsrc for a camera source sending MJPEG.
> I believe the issue is because unable to link the MultipartDemux and
> JpegDec.
>
> Wireshark shows the JPEG image packets coming from the source but
> they will
> stop after a few with a "TCP Window Full" and "Tcp ZeroWindow"
> Wireshark
> messages. Assuming this is because I am not processing the packets.
>
> Code Samples
> source = gst_element_factory_make("souphttpsrc", "http-src");
> multidemux = gst_element_factory_make("multipartdemux",
> "demuxer");
> jpegdec = gst_element_factory_make("jpegdec", "jpegdec");
> vsink = gst_element_factory_make("autovideosink", "videosink");
> ...
> gst_bin_add_many(GST_BIN(mPipeline), source, multidemux, jpegdec,
> vsink,
> NULL);
> ...
> if (gst_element_link(multidemux, jpegdec) == FALSE)
> {
> DebugMessage("Link between multidemux, jpegdec failed.\n");
> }
This is because multipartdemux has so-called 'sometimes' pads, which is
pads that are only added once data flow starts, so you can't link
multipartdemux and jpegdec yet at that point, because multipartdemux
doesn't have any output pads yet at that point.
You have to g_signal_connect() to the "pad-added" signal and then link
the pad to jpegdec in the callback.
Or use gst_parse_launch() and friends to create your pipeline, it will
just handle this automatically.
Cheers
-Tim
--
Tim Müller, Centricular Ltd - http://www.centricular.com
More information about the gstreamer-devel
mailing list