Setting Pipeline State to NULL can at time take over 10 seconds

declan harrison harrison.declan at gmail.com
Mon Sep 9 14:18:45 PDT 2013


Hi

I have an application which uses the GStreamer API, in summary the pipeline
transcodes video content in real time over a network stream.  Both the
input source and the output sink are over HTTP.

This works well generally, however under light load when I am cleaning up
the pipeline after it has finished I see great variations of the time taken
to set the Pipeline state to NULL (from playing state).  It varies  from a
few milliseconds to over 14 or 15 seconds.  Took a few pstack during load
and see a number of threads showing the stack traces below.

So Im concerned about why this can happen.  When cleaning up the pipeline.
I perform the following tasks in this order.
1. Set Pipeline state to null.
2. Remove all elements from the pipeline.
3. Explicitly unlink all elements( though removing them above should do
this.

So my question are, Why is setting the state to null on the pieline taking
so long?  Is the order of tasks performed shown above when I cleanup the
pipeline correct?

I have a suspicion that the network stream maybe the cause of the issue
here, Im wondering if the input or output network stream has been removed
before all the elements states have transitioned to a NULL state.  Would
this cause an issue with setting the pipeline state?

Im using GStreamer 0.10, on RHEL 64 bit architecture.


Thanks
Declan


PSTack back trace
===============
#0  0x0000003890a0b43c in pthread_cond_wait@@GLIBC_2.3.2 () from
/lib64/libpthread.so.0
#1  0x00007f619af83c76 in gst_task_join () from /opt/opwv/gstreamer/1.0/lib/
libgstreamer-0.10.so
#2  0x00007f619af538a8 in gst_pad_stop_task () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#3  0x00007f61959d34c6 in gst_queue_src_activate_push () from
/opt/opwv/gstreamer/1.0/lib/gstreamer-0.10/libgstcoreelements.so
#4  0x00007f619af5ce23 in gst_pad_activate_push () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#5  0x00007f619af5dbe6 in gst_pad_set_active () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#6  0x00007f619af3a6ab in activate_pads () from /opt/opwv/gstreamer/1.0/lib/
libgstreamer-0.10.so
#7  0x00007f619af4ced6 in gst_iterator_fold () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#8  0x00007f619af3a616 in iterator_activate_fold_with_resync () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#9  0x00007f619af3cfcf in gst_element_pads_activate () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#10 0x00007f619af3f892 in gst_element_change_state_func () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#11 0x00007f619af3bb6c in gst_element_change_state () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#12 0x00007f619af3f538 in gst_element_set_state_func () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#13 0x00007f619af2b18c in gst_bin_change_state_func () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#14 0x00007f619af604c0 in gst_pipeline_change_state () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#15 0x00007f619af3bb6c in gst_element_change_state () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#16 0x00007f619af3bbef in gst_element_change_state () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
#17 0x00007f619af3f538 in gst_element_set_state_func () from
/opt/opwv/gstreamer/1.0/lib/libgstreamer-0.10.so
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20130909/03f2a1af/attachment.html>


More information about the gstreamer-devel mailing list