How to get bitrate selected by hlsdemux
Nicolas Dufresne
nicolas at ndufresne.ca
Fri Nov 15 17:27:51 UTC 2019
Le vendredi 15 novembre 2019 à 23:02 +0800, Sirius Wu a écrit :
> Hi,
>
> in gsthlsdemux.c there is the following clause:
>
> gst_element_post_message (GST_ELEMENT_CAST (demux),
> gst_message_new_element (GST_OBJECT_CAST (demux),
> gst_structure_new (GST_ADAPTIVE_DEMUX_STATISTICS_MESSAGE_NAME,
> "manifest-uri", G_TYPE_STRING,
> main_uri, "uri", G_TYPE_STRING,
> uri, "bitrate", G_TYPE_INT, new_bandwidth, NULL)));
>
> Can I get the bitrate of this message with g_signal_connect?
>
> With g_signal_connect (demux, "bitrate", a_callback, data)?
This is a message, so you have to watch for that message on the GstBus
of your pipeline. You can use asynchronous or synchronous message
handles.
This tutorial shows how to handle messages on the bus asynchronously.
https://gstreamer.freedesktop.org/documentation/tutorials/basic/concepts.html
After checking the message type, you can extract the structure using
gst_message_get_structure(), make sure it has the right name (whatever
string is behind GST_ADAPTIVE_DEMUX_STATISTICS_MESSAGE_NAME) and then
you get use gst_structure_get() to extract the bitrate.
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20191115/557965c7/attachment.sig>
More information about the gstreamer-devel
mailing list