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.htmlAfter 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
>
[hidden email]
>
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel