<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
set_state(Gst.State.NULL) should work, you probably want to collect
a stacktrace<br>
at hang time and figure out what's blocking :)<br>
<br>
<div class="moz-cite-prefix">On 9/9/19 4:57 PM, pisymbol . wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAPpy_fEsZouou0tqgR8CTAjCrAFgHUpMFWsUBuRAMF0tixazaw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>I have an application that worked fine on Ubuntu 16.04 but
now hangs on Ubuntu 18.04 when I try to stop my pipeline.</div>
<div><br>
</div>
<div>Here is how I am initializing my pipeline;:</div>
<div><br>
</div>
<div>self.recorderBin =
Gst.parse_bin_from_description(RECORD_PIPELINE, False)</div>
<div>self.recorderPipeline = Gst.Pipeline()</div>
<div>self.recorderPipeline.add(self.recorderBin)</div>
<div>bus = self.recorderPipeline.get_bus()</div>
<div>bus.add_watch(GLib.PRIORITY_DEFAULT, self._on_message)</div>
<div><br>
</div>
<div>At some point, the application starts recording and the bus
is set into the PLAYING state which succeeds, recording
begins.<br>
</div>
<div><br>
</div>
<div>Now when the user presses the stop button:</div>
<div><br>
</div>
<div>self.recorderPipeline.send_event(Gst.Event.new_eos())</div>
<div><br>
</div>
<div>When the EOS is sent to the bus and self._on_message is
triggered and caught:</div>
<div><br>
</div>
<div>self.recorderPipeline.set_state(Gst.State.NULL)</div>
<div>HANG</div>
<div><br>
</div>
<div>Am I doing something wrong? I looked at the gst-launch-1.0
code and it seems to be using an event_loop() that polls for
messages instead of the callback approach above. Also,
gst-launch-1.0 PAUSES the bus, sets the bus state back into
the READY state, before actually setting it to the NULL state,
de-referencing it, and exiting. I actually tried it that as
well but when I set the bus state to PAUSE then READY is hangs
again.</div>
<div><br>
</div>
<div>Why does the Python code above hang when setting the state
while the C code seems to work? Do I need to poll for bus
messages and not rely on the auto main loop created underneath
me? I can't find a singe Python example that polls for
messages. Almost all of them are some flavor of connecting to
the bus via callbacks.</div>
<div><br>
</div>
<div>Some guidance would be appreciated,<br>
</div>
<div><br>
</div>
<div>-aps<br>
</div>
<div><br>
</div>
<br>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gstreamer-devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a class="moz-txt-link-freetext" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></pre>
</blockquote>
</body>
</html>