<div dir="auto">Thanks for your kind response. I will check the response I am getting when that function does return properly to make sure it's not an error. I will get back to you. <div dir="auto"><br></div><div dir="auto">And yes, I commented out the run to allow an easy way of timing out the code. This is a rough representation of some production code that's misbehaving (it's an attempt to get it to reproduce in a simple example for the benefit of those answering, which it does). My production code does run the main loop on a thread. I will update this sample code to reflect that. </div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 30, 2019, 3:25 PM Michael Gruner <<a href="mailto:michael.gruner@ridgerun.com">michael.gruner@ridgerun.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space">Hi,<div><br></div><div>I did not run your code, but at first sight it looks okay. I only have two comments that may be related:</div><div><br></div><div>1) You are not iterating on the main loop. As such, I’m surprised you even get signals being emitted at all. I wouldn’t rely on undefined behavior and iterate the loop. I imagine you commented out the g_main_loop_run to avoid blocking, so here’s a couple of options:</div><div> - call g_main_loop_run from a different thread</div><div> - loop yourself and call g_main_context_iteration on each iteration, </div><div><br></div><div>2) On the g_bus_timed_pop_filtered, are you checking the message you are receiving is the EOS? Because it could be an error, and you are assuming the EOS was received when it hasn’t.</div><div><br></div><div><br><div>
<div>Michael</div><div><a href="http://www.ridgerun.com" target="_blank" rel="noreferrer">www.ridgerun.com</a></div><div><br></div><br class="m_1150505433452475073Apple-interchange-newline">

</div>

<div><br><blockquote type="cite"><div>On Aug 30, 2019, at 1:48 PM, Ben Rush <<a href="mailto:ben@ben-rush.net" target="_blank" rel="noreferrer">ben@ben-rush.net</a>> wrote:</div><br class="m_1150505433452475073Apple-interchange-newline"><div><div dir="ltr">I have made a self-contained example here: <a href="https://github.com/kwende/GStreamerExamples/blob/master/Examples/RunInALoop/RunInALoop.cpp" target="_blank" rel="noreferrer">https://github.com/kwende/GStreamerExamples/blob/master/Examples/RunInALoop/RunInALoop.cpp</a>. The same repo includes a VS2019 solution/project to build it. I hope this helps someone understand my question better. <br><br>Here is my problem: I think am I doing something wrong in how I'm tearing down the pipeline when using appsrc. If USEAPPSRC is defined in my code, what eventually happens is the code hangs on line 147 (after several iterations): <br><br>gst_element_send_event(state.pipeline, gst_event_new_eos());<br><div><br></div><div>In addition, I will sporadically get zero-length MP4 files before the hang eventually happens.<br><br>On the other hand, if USEAPPSRC isn't defined, and I use videotestsrc, then everything works as planned: no zero-length files and no hangs ever occur: the loop continues and I keep generating files ad nauseam. I've seen a number of discussions about flushing the pipeline, but I'm unsure how this works exactly in the scenario I've got going on with this code. I feel like something isn't getting the EOS signal properly, but how or why, I can't shake out. The heart of the issue is that I'm trying to tear down and rebuild my pipeline in an infinite loop, I've never witnessed this issue unless I'm in a loop like that. </div><div><br></div><div>It's worth noting that I'm using the Intel Media SDK h264 plugin, and so that might be a variable, but everything certainly works fine when using videotestsrc, so I feel like it's got to be something I'm doing in my code. <br><br>Thanks!</div></div>
_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank" rel="noreferrer">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></div></blockquote></div><br></div></div>_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org" target="_blank" rel="noreferrer">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></blockquote></div>