Flow of PAUSE request from gstreamer to upper QT application.

Sebastian Dröge sebastian at centricular.com
Mon Dec 2 08:08:57 PST 2013


On Mo, 2013-12-02 at 07:37 -0800, sathish wrote:
> Thanks for the reply Sebastian
> 
> So Phonon doesnt handle it but GSTREAMER handles it.
> 
> Hence to do a test, I left QT - Phonon application. Instead I am using a
> gstreamer media player code available in the gstreamer documentation. Name
> of the file is Basic-tutorial-5.c.
> 
> In this, I am initiating a CORK request.. I have pasted the part of the
> code in which messages on the bus are handled.
> 
>  /* Instruct the bus to emit signals for each received message, and connect
> to the interesting signals */
> 
>   bus = gst_element_get_bus (data.playbin2);
>   gst_bus_add_signal_watch (bus);
>   g_signal_connect (G_OBJECT (bus), "message::error", (GCallback)error_cb,
> &data);
>   g_signal_connect (G_OBJECT (bus), "message::eos", (GCallback)eos_cb,
> &data);
>   g_signal_connect (G_OBJECT (bus), "message::state-changed",
> (GCallback)state_changed_cb, &data);
>   g_signal_connect (G_OBJECT (bus), "message::application",
> (GCallback)application_cb, &data);
>   gst_object_unref (bus);
> 
> My question is how should I handle this in case of the following code
> pasted below
> 
> gst_element_post_message (GST_ELEMENT_CAST (psink),
> > >         gst_message_new_request_state (GST_OBJECT_CAST (psink),
> > >             GST_STATE_PAUSED));
> 
> How would I able to find the bus message. Like in case of End of Stream, we
> get "message::eos", what would it be for the above piece of code ??
> 
> Would I get "GST_STATE_PAUSED" on the bus or something else ??

You would get a GST_MESSAGE_REQUEST_STATE on the bus, and you could
parse the requested state from it via gst_message_parse_request_state().
You would then call gst_element_set_state() on the pipeline for that
state.

-- 
Sebastian Dröge <sebastian at centricular.com>
Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131202/1d30f3a5/attachment.pgp>


More information about the gstreamer-devel mailing list