[gst-devel] xvimagesink state change failure

Pavan Kumar Patale pavanpatale at hotmail.com
Tue Dec 19 19:00:56 CET 2006


Hi,

I am recording from live source (audio+video) using simple GTK buttons as 
interface for starting and stopping of recording.

The application initially at startup streams from webcam. Whenever user 
presses start button i am creating a record bin and attaching it to the 
streaming pipeline.

When user presses the stop button i am setting the whole pipleine to NULL, 
remove the record bin and set the streaming pipeline to playing.

This works perfectly.

To put EOS at the end of the recording into the file I tried to implement 
the steps given in control shutdown of livesource.  Everything works fine 
until the record bin is removed.
But after removing it when i tried to set the streaming pipeline to playing 
the application
hangs.

The application logs indicate that xvimagesink is unable to change the state 
from READY to PAUSED.

Appended is the sample code.  Can anyone pls throw some light on this 
problem.

Thanks,
Pavan.



static gboolean stop_cb(GstElement *pipeline)
{
           gst_element_set_state(pipeline,GST_STATE_NULL);
           gst_element_set_locked_state(video_source,FALSE);
           gst_element_set_locked_state(audio_source,FALSE);
           gst_bin_remove(pipeline,record_bin);
           gst_element_set_state(pipeline,GST_STATE_PLAYING);
}


static GstBusSyncReply  bus_sync_cb(GstBus *b,GstMessage *message,GstElement 
*pipeline)
{
    if(GST_MESSAGE_TYPE(message)==GST_MESSAGE_EOS)
    {
               g_idle_add((GSourceFunc)stop_cb,pipeline);
    }

}




void record_stop_cb()
{
  gst_element_set_state(video_source,GST_STATE_NULL);
  gst_element_set_locked_state(video_source,TRUE);
  gst_element_set_state(audio_source,GST_STATE_NULL);
  gst_element_set_locked_state(audio_source,TRUE);
}

_________________________________________________________________
Don't miss the latest sporting action! If it's happening, it must be on MSN 
Sports. Click to catch up! http://content.msn.co.in/Sports/Default





More information about the gstreamer-devel mailing list