GNOME Bugzilla – Bug 722289
capsfilter: Sending CAPS event downstream in pull mode
Last modified: 2014-01-16 17:17:13 UTC
Correct case: > gst-launch-1.0 filesrc location=/dev/zero num-buffers=1 ! "audio/mpeg" ! typefind ! fakesink -v > Setting pipeline to PAUSED ... > Pipeline is PREROLLING ... > /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = audio/mpeg > /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:src: caps = audio/mpeg > /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = audio/mpeg > /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:sink: caps = audio/mpeg Broken case: > gst-launch-1.0 filesrc location=test.webm ! "audio/mpeg" ! typefind ! fakesink -v > Setting pipeline to PAUSED ... > Pipeline is PREROLLING ... > /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = audio/mpeg > /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:src: caps = audio/mpeg > /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = audio/mpeg > /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:sink: caps = audio/mpeg > /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:src: caps = video/webm > /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/webm Seems to be a race condition in typefind.
Also working case: > gst-launch-1.0 pushfilesrc real-filesrc::location=test.webm ! "audio/mpeg" ! typefind ! fakesink -v > Setting pipeline to PAUSED ... > Pipeline is PREROLLING ... > /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = audio/mpeg > /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:src: caps = audio/mpeg > /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = audio/mpeg > /GstPipeline:pipeline0/GstTypeFindElement:typefindelement0.GstPad:sink: caps = audio/mpeg
The /dev/zero case is not in pull mode, creating a file with zeroes is even more funny. It first sets audio/mpeg as caps and then fails typefinding ;) Anyway, it's capsfilter's bug. It is sending a CAPS event downstream if in pull mode, which it probably should not do :)
I'm not sure what capsfilter should do in pull mode though. It will have no effect if it does not send a caps event.
commit 210b0629fc2cb56336a63c4b309d5a75a5d94b2d Author: Sebastian Dröge <sebastian@centricular.com> Date: Thu Jan 16 18:16:35 2014 +0100 capsfilter: Only set caps on the srcpad if it's activated in push mode https://bugzilla.gnome.org/show_bug.cgi?id=722289