[gst-devel] How to pause a playbin after the first frame is displayed?

wl2776 wl2776 at gmail.com
Fri Dec 18 09:10:44 CET 2009




Stefan Kost wrote:
> 
>> Now I need an analog of StopWhenReady functionality. 
> 
> register a signal handler to the message bus of the pipeline and wait for
> the
> READY_TO_PAUSED state change message for the pipeline.
> Stefan
> 

Stefan, thank you for the answer. However, I am missing something. 
Where should I look for this message?
I've found the enum GstStateChange in headers and in reference. Which
variable (structure member) is assigned these values?

Here is how I do currently:

// initialization
player = gst_element_factory_make("playbin2","playbin0");
GstElement *bus = (GstElement *)gst_pipeline_get_bus(GST_PIPELINE(player));
gst_bus_set_sync_handler (GST_BUS(bus),
(GstBusSyncHandler)gst_bus_sync_handler, this);
gst_bus_add_watch (GST_BUS(bus), bus_call, this);
gst_object_unref(bus);

//handlers
GstBusSyncReply CControlMainDialog::bus_sync_handler(GstBus * bus,
GstMessage * message)
{
  g_print("bus_sync_handler: message %s(%d) from
%s\n",GST_MESSAGE_TYPE_NAME(messaef),GST_MESSAGE_TYPE(message),GST_MESSAGE_SRC_NAME(message));

  switch (GST_MESSAGE_TYPE (message)) {
// process message
  }
  gst_message_unref (message);
  return GST_BUS_DROP;	
}

gboolean CControlMainDialog::bus_watch(GstBus* bus, GstMessage *msg)
{
 g_print("bus_watch: message %s(%d) from
%s\n",GST_MESSAGE_TYPE_NAME(msg),GST_MESSAGE_TYPE(msg),GST_MESSAGE_SRC_NAME(msg));
  switch (GST_MESSAGE_TYPE (msg)) {
// process message
  }
  gst_message_unref (msg);
  return TRUE;	
}


However, I didn't see any hints about that state change.

-- 
View this message in context: http://n4.nabble.com/How-to-pause-a-playbin-after-the-first-frame-is-displayed-tp974285p974632.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.




More information about the gstreamer-devel mailing list