<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 26, 2014 at 9:09 AM, Sebastian Dröge <span dir="ltr"><<a href="mailto:sebastian@centricular.com" target="_blank">sebastian@centricular.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mi, 2014-06-25 at 11:14 +0200, Haakon Sporsheim wrote:<br>
> Hi<br>
><br>
> I'm working on a product that uses GStreamer for real time communication<br>
> (read: VoIP). We started out using GStreamer 0.10 a couple of years ago,<br>
> and now have ported our elements to 1.0.<br>
><br>
> For GStremer 0.10 we developed a pretty large test suite for testing and<br>
> stressing both stock GStreamer elements and our own to check that they are<br>
> 'compliant' (or at least doesn't crash, leak or does stupid things). Some<br>
> of these tests used a test tool called GstHarness [1] that was presented by<br>
> Håvard Graff at GStreamer conference 2013 [2].<br>
> This tool basically starts some threads which all prod an element or a set<br>
> of elements. An example would be pushing buffers in one thread, sending<br>
> events in the second and changing state in the third.<br>
><br>
> After porting this to GStreamer 1.0 this is somewhat harder because of the<br>
> requirement of GST_EVENT_START_STREAM and GST_EVENT_SEGMENT being present<br>
> before data flow. Going to GST_STATE_NULL will deactivate its pads, which<br>
> again will remove all sticky events.<br>
> I've found that if a buffer is on its way between two elements and pads in<br>
> a streaming thread; the downstream element goes to GST_STATE_NULL then up<br>
> again to GST_STATE_PLAYING in an application thread, it will not have any<br>
> sticky events and you'll get the g_warning: "Got data flow before<br>
> stream-start event".<br>
><br>
> I guess this is a very unlikely scenario for a real life pipeline, but I'd<br>
> like to get someones view on it. Is this something that should work? Should<br>
> it be possible to pick out an element in a pipeline, take the element down<br>
> in state, then up again and expect everything to just proceed as normal<br>
> after that?<br>
><br>
> I'll try to get some time later this week to add a test case to<br>
> prove/showcase what I'm trying to describe here without the use of<br>
> GstHarness.<br>
<br>
</div></div>A testcase would be great to have, yes :)<br></blockquote><div>See the two patches I attached. Second patch (_relink) will unlink and link the two pads. This actually causes the test to pass, which I find a bit weird. I guess this is what I'm trying to point at. If you say this is as expected I guess I'm happy with that.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
But the problem here seems to be that you don't block the srcpad in<br>
front of the element that you remove (or deactivate). So buffers are<br>
just flowing with any control. That can give you all kinds of errors.<br>
Do you still have this problem if you first block the srcpad in front of<br>
the element you deactivate, then deactivate the element, then activate<br>
it again, then unblock the srcpad again?<br></blockquote><div>Yes, blocking the srcpad would help! However, what we are trying to do here is testing whether or not an element is thread safe. When we have tested elements like this we have found many issues that might only happen once in a blue moon.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Sebastian Dröge, Centricular Ltd - <a href="http://www.centricular.com" target="_blank">http://www.centricular.com</a><br>
Expertise, Straight from the Source<br>
</font></span><br>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
<br></blockquote></div><br></div></div>