What am I doing to cause appsrc to hang my pipeline?

Michael Gruner michael.gruner at ridgerun.com
Fri Aug 30 20:25:52 UTC 2019


Hi,

I did not run your code, but at first sight it looks okay. I only have two comments that may be related:

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:
 - call g_main_loop_run from a different thread
 - loop yourself and call g_main_context_iteration on each iteration, 

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.


Michael
www.ridgerun.com



> On Aug 30, 2019, at 1:48 PM, Ben Rush <ben at ben-rush.net> wrote:
> 
> I have made a self-contained example here: https://github.com/kwende/GStreamerExamples/blob/master/Examples/RunInALoop/RunInALoop.cpp <https://github.com/kwende/GStreamerExamples/blob/master/Examples/RunInALoop/RunInALoop.cpp>. The same repo includes a VS2019 solution/project to build it. I hope this helps someone understand my question better. 
> 
> 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): 
> 
> gst_element_send_event(state.pipeline, gst_event_new_eos());
> 
> In addition, I will sporadically get zero-length MP4 files before the hang eventually happens.
> 
> 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. 
> 
> 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. 
> 
> Thanks!
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190830/082fae6e/attachment-0001.html>


More information about the gstreamer-devel mailing list