Unable to change state GST_STATE_PLAYING

Arun Raghavan arun at arunraghavan.net
Wed Jun 1 10:31:33 UTC 2016



On Tue, 31 May 2016, at 04:32 PM, amitchawla wrote:
> Hi,
> 
> I am using the following pipeline, where I am reading from the network
> 
> "tcpserversrc blocksize=4194304 host=192.168.100.58 port=3000 ! 
>  decodebin async-handling=true name=demux ! 
>  autoaudiosink async-handling=true demux. ! 
>  imxeglvivsink async=false"
> 
> I need to restart the pipeline, when new data is coming through the
> network. 
> The initial state is that, the above pipeline is playing normally -- the
> pipeline is in GST_STATE_PLAYING.
> 
> then, I do the following operations : -
> 
>      set_pipeline_state(GST_STATE_PAUSED);
>      set_pipeline_state(GST_STATE_READY);
>      set_pipeline_state(GST_STATE_NULL);
>      --- enable_fresh_data_from_network --- ;
>      set_pipeline_state(GST_STATE_READY) ;
>      set_pipeline_state(GST_STATE_PAUSED) ;
>      set_pipeline_state(GST_STATE_PLAYING) ;

You don't need to set each intermediate state. Setting the state from X
to Y makes sure that the pipeline goes through all the intermediate
states.

> It goes to GST_STATE_NULL normally.
> But I notice that the pipeline state never changes to GST_STATE_PLAYING
> from
> GST_STATE_PAUSED. It is stuck at GST_STATE_PAUSED. 
> The status of the operation returns  GST_STATE_CHANGE_ASYNC always. I
> have
> used gst_element_get_state but it always returns GST_STATE_CHANGE_ASYNC.
> 
> I enabled GST_STATES debug output. The log output shows all the elements
> moving to GST_STATE_PLAYING eventually but the, the stream doesn't start
> playing. 
> 
> But when I tried to grab the bus messages, I noticed that I don't get
> state
> change message to PLAYING on the bus, I only get state change message
> upto
> PAUSED.  

This suggests that a sink is waiting for some data to arrive from the
source, and this never happens.

-- Arun


More information about the gstreamer-devel mailing list