gst_element_get_state hangs
Mohammad-AL.Gmail
al.mohamed.salim at gmail.com
Thu May 9 05:11:30 PDT 2013
Thanks Stirling,
When gst_element_get_state call returns GST_STATE_CHANGE_ASYNC, I believe,
we can wait and check again the state of pipeline using
gst_element_get_state.
However, when it returns GST_STATE_CHANGE_FAILURE, what action do you
normally take?
Also, what does the function bus_message_handler(app, msg) do?
From:
gstreamer-devel-bounces+al.mohamed.salim=gmail.com at lists.freedesktop.org
[mailto:gstreamer-devel-bounces+al.mohamed.salim=gmail.com at lists.freedesktop
.org] On Behalf Of Stirling Westrup
Sent: Tuesday, May 07, 2013 11:37 PM
To: Discussion of the development of and with GStreamer
Subject: Re: gst_element_get_state hangs
Most likely the pipeline is getting stuck trying to change state. You want
to ensure that you put in a reasonable timeout for the gst_element_get_state
call. If the call does time out (returns GST_STATE_CHANGE_FAILURE or
GST_STATE_CHANGE_ASYNC) then you should check the message bus for errors. I
use this little function for that:
// Returns true is any messages were found on the bus.
static gboolean message_check
( App * app
)
{ gboolean ret = FALSE;
GstBus * bus = gst_pipeline_get_bus(app->pipeline);
GstMessage * msg = gst_bus_pop(bus);
while(msg)
{
ret |= bus_message_handler(app,msg);
gst_message_unref(msg);
msg = gst_bus_pop(bus);
}
gst_object_unref(bus);
return ret;
}
On Tue, May 7, 2013 at 9:30 AM, Mohammad-AL.Gmail
<al.mohamed.salim at gmail.com> wrote:
In my GStreamer (0.10.32) based player, I switch pipeline to PAUSE and then
switch state to NULL instead of READY after playback of a file is finished
and then unref the pipeline.
However, I face a problem, when I play media files in a folder one after
another:
The playback of files goes OK one after another.
However once a while the GStreamer hangs when I turn the status of the
pipeline to GST_STATE_PLAY.
Creation of playbin2, setting uri, and getting message bus goes OK. It
hangs only when state is switch to READY.
I am not able to make out which part / element blocks the pipeline.
Once this happen, the pipeline becomes non-responsive.
Regards,
Salim
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
--
Stirling Westrup
Programmer, Entrepreneur.
https://www.linkedin.com/e/fpf/77228
http://www.linkedin.com/in/swestrup
http://technaut.livejournal.com
http://sourceforge.net/users/stirlingwestrup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130509/52bd4b5d/attachment.html>
More information about the gstreamer-devel
mailing list