play: Improve play message API inconsistencies

* Consistently name parse functions according to their message type and
    deprecate the misnamed ones,
  * Add missing parse functions,
  * Check for the correct message type when parsing
  * Use correct field name for warning message details

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/7754>
This commit is contained in:
Sebastian Dröge 2024-10-26 11:42:48 +03:00 committed by GStreamer Marge Bot
parent eb825574f4
commit 5da635c2da
3 changed files with 287 additions and 60 deletions

View file

@ -1812,8 +1812,8 @@ See also #gst_play_get_message_bus()</doc-version>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>
<function name="parse_buffering_percent" c:identifier="gst_play_message_parse_buffering_percent" version="1.20"> <function name="parse_buffering" c:identifier="gst_play_message_parse_buffering" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given buffering-percent @msg and extract the corresponding value</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given buffering @msg and extract the corresponding value</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1829,8 +1829,44 @@ See also #gst_play_get_message_bus()</doc-version>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>
<function name="parse_duration_updated" c:identifier="gst_play_message_parse_duration_updated" version="1.20"> <function name="parse_buffering_percent" c:identifier="gst_play_message_parse_buffering_percent" version="1.20" deprecated="1" deprecated-version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given duration @msg and extract the corresponding #GstClockTime</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given buffering @msg and extract the corresponding value</doc>
<doc-deprecated xml:space="preserve">Use gst_play_message_parse_buffering().</doc-deprecated>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="percent" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting buffering percent</doc>
<type name="guint" c:type="guint*"/>
</parameter>
</parameters>
</function>
<function name="parse_duration_changed" c:identifier="gst_play_message_parse_duration_changed" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given duration-changed @msg and extract the corresponding #GstClockTime</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="duration" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting duration</doc>
<type name="Gst.ClockTime" c:type="GstClockTime*"/>
</parameter>
</parameters>
</function>
<function name="parse_duration_updated" c:identifier="gst_play_message_parse_duration_updated" version="1.20" deprecated="1" deprecated-version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given duration-changed @msg and extract the corresponding #GstClockTime</doc>
<doc-deprecated xml:space="preserve">Use gst_play_message_parse_duration_changed().</doc-deprecated>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1868,7 +1904,7 @@ See also #gst_play_get_message_bus()</doc-version>
</parameters> </parameters>
</function> </function>
<function name="parse_media_info_updated" c:identifier="gst_play_message_parse_media_info_updated" version="1.20"> <function name="parse_media_info_updated" c:identifier="gst_play_message_parse_media_info_updated" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding media information</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given media-info-updated @msg and extract the corresponding media information</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1885,7 +1921,7 @@ See also #gst_play_get_message_bus()</doc-version>
</parameters> </parameters>
</function> </function>
<function name="parse_muted_changed" c:identifier="gst_play_message_parse_muted_changed" version="1.20"> <function name="parse_muted_changed" c:identifier="gst_play_message_parse_muted_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding audio muted state</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given mute-changed @msg and extract the corresponding audio muted state</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1902,7 +1938,24 @@ See also #gst_play_get_message_bus()</doc-version>
</parameters> </parameters>
</function> </function>
<function name="parse_position_updated" c:identifier="gst_play_message_parse_position_updated" version="1.20"> <function name="parse_position_updated" c:identifier="gst_play_message_parse_position_updated" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given position @msg and extract the corresponding #GstClockTime</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given position-updated @msg and extract the corresponding #GstClockTime</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="position" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting position</doc>
<type name="Gst.ClockTime" c:type="GstClockTime*"/>
</parameter>
</parameters>
</function>
<function name="parse_seek_done" c:identifier="gst_play_message_parse_seek_done" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given seek-done @msg and extract the corresponding #GstClockTime</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1919,7 +1972,7 @@ See also #gst_play_get_message_bus()</doc-version>
</parameters> </parameters>
</function> </function>
<function name="parse_state_changed" c:identifier="gst_play_message_parse_state_changed" version="1.20"> <function name="parse_state_changed" c:identifier="gst_play_message_parse_state_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given state @msg and extract the corresponding #GstPlayState</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given state-changed @msg and extract the corresponding #GstPlayState</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1952,8 +2005,25 @@ See also #gst_play_get_message_bus()</doc-version>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>
<function name="parse_uri_loaded" c:identifier="gst_play_message_parse_uri_loaded" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given uri-loaded @msg and extract the corresponding value</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="uri" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting URI</doc>
<type name="utf8" c:type="gchar**"/>
</parameter>
</parameters>
</function>
<function name="parse_video_dimensions_changed" c:identifier="gst_play_message_parse_video_dimensions_changed" version="1.20"> <function name="parse_video_dimensions_changed" c:identifier="gst_play_message_parse_video_dimensions_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding video dimensions</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given video-dimensions-changed @msg and extract the corresponding video dimensions</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1974,7 +2044,7 @@ See also #gst_play_get_message_bus()</doc-version>
</parameters> </parameters>
</function> </function>
<function name="parse_volume_changed" c:identifier="gst_play_message_parse_volume_changed" version="1.20"> <function name="parse_volume_changed" c:identifier="gst_play_message_parse_volume_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding audio volume</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given volume-changed @msg and extract the corresponding audio volume</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -1991,7 +2061,7 @@ See also #gst_play_get_message_bus()</doc-version>
</parameters> </parameters>
</function> </function>
<function name="parse_warning" c:identifier="gst_play_message_parse_warning" version="1.20"> <function name="parse_warning" c:identifier="gst_play_message_parse_warning" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given error @msg and extract the corresponding #GError warning</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given warning @msg and extract the corresponding #GError</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2755,8 +2825,8 @@ freed using gst_play_visualization_free().</doc>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_buffering_percent" c:identifier="gst_play_message_parse_buffering_percent" moved-to="PlayMessage.parse_buffering_percent" version="1.20"> <function name="play_message_parse_buffering" c:identifier="gst_play_message_parse_buffering" moved-to="PlayMessage.parse_buffering" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given buffering-percent @msg and extract the corresponding value</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given buffering @msg and extract the corresponding value</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2772,8 +2842,44 @@ freed using gst_play_visualization_free().</doc>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_duration_updated" c:identifier="gst_play_message_parse_duration_updated" moved-to="PlayMessage.parse_duration_updated" version="1.20"> <function name="play_message_parse_buffering_percent" c:identifier="gst_play_message_parse_buffering_percent" moved-to="PlayMessage.parse_buffering_percent" version="1.20" deprecated="1" deprecated-version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given duration @msg and extract the corresponding #GstClockTime</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given buffering @msg and extract the corresponding value</doc>
<doc-deprecated xml:space="preserve">Use gst_play_message_parse_buffering().</doc-deprecated>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="percent" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting buffering percent</doc>
<type name="guint" c:type="guint*"/>
</parameter>
</parameters>
</function>
<function name="play_message_parse_duration_changed" c:identifier="gst_play_message_parse_duration_changed" moved-to="PlayMessage.parse_duration_changed" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given duration-changed @msg and extract the corresponding #GstClockTime</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="duration" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting duration</doc>
<type name="Gst.ClockTime" c:type="GstClockTime*"/>
</parameter>
</parameters>
</function>
<function name="play_message_parse_duration_updated" c:identifier="gst_play_message_parse_duration_updated" moved-to="PlayMessage.parse_duration_updated" version="1.20" deprecated="1" deprecated-version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given duration-changed @msg and extract the corresponding #GstClockTime</doc>
<doc-deprecated xml:space="preserve">Use gst_play_message_parse_duration_changed().</doc-deprecated>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2811,7 +2917,7 @@ freed using gst_play_visualization_free().</doc>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_media_info_updated" c:identifier="gst_play_message_parse_media_info_updated" moved-to="PlayMessage.parse_media_info_updated" version="1.20"> <function name="play_message_parse_media_info_updated" c:identifier="gst_play_message_parse_media_info_updated" moved-to="PlayMessage.parse_media_info_updated" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding media information</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given media-info-updated @msg and extract the corresponding media information</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2828,7 +2934,7 @@ freed using gst_play_visualization_free().</doc>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_muted_changed" c:identifier="gst_play_message_parse_muted_changed" moved-to="PlayMessage.parse_muted_changed" version="1.20"> <function name="play_message_parse_muted_changed" c:identifier="gst_play_message_parse_muted_changed" moved-to="PlayMessage.parse_muted_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding audio muted state</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given mute-changed @msg and extract the corresponding audio muted state</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2845,7 +2951,24 @@ freed using gst_play_visualization_free().</doc>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_position_updated" c:identifier="gst_play_message_parse_position_updated" moved-to="PlayMessage.parse_position_updated" version="1.20"> <function name="play_message_parse_position_updated" c:identifier="gst_play_message_parse_position_updated" moved-to="PlayMessage.parse_position_updated" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given position @msg and extract the corresponding #GstClockTime</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given position-updated @msg and extract the corresponding #GstClockTime</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="position" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting position</doc>
<type name="Gst.ClockTime" c:type="GstClockTime*"/>
</parameter>
</parameters>
</function>
<function name="play_message_parse_seek_done" c:identifier="gst_play_message_parse_seek_done" moved-to="PlayMessage.parse_seek_done" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given seek-done @msg and extract the corresponding #GstClockTime</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2862,7 +2985,7 @@ freed using gst_play_visualization_free().</doc>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_state_changed" c:identifier="gst_play_message_parse_state_changed" moved-to="PlayMessage.parse_state_changed" version="1.20"> <function name="play_message_parse_state_changed" c:identifier="gst_play_message_parse_state_changed" moved-to="PlayMessage.parse_state_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given state @msg and extract the corresponding #GstPlayState</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given state-changed @msg and extract the corresponding #GstPlayState</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2895,8 +3018,25 @@ freed using gst_play_visualization_free().</doc>
</parameter> </parameter>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_uri_loaded" c:identifier="gst_play_message_parse_uri_loaded" moved-to="PlayMessage.parse_uri_loaded" version="1.26">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given uri-loaded @msg and extract the corresponding value</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none">
<type name="none" c:type="void"/>
</return-value>
<parameters>
<parameter name="msg" transfer-ownership="none">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">A #GstMessage</doc>
<type name="Gst.Message" c:type="GstMessage*"/>
</parameter>
<parameter name="uri" direction="out" caller-allocates="0" transfer-ownership="full" optional="1" allow-none="1">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">the resulting URI</doc>
<type name="utf8" c:type="gchar**"/>
</parameter>
</parameters>
</function>
<function name="play_message_parse_video_dimensions_changed" c:identifier="gst_play_message_parse_video_dimensions_changed" moved-to="PlayMessage.parse_video_dimensions_changed" version="1.20"> <function name="play_message_parse_video_dimensions_changed" c:identifier="gst_play_message_parse_video_dimensions_changed" moved-to="PlayMessage.parse_video_dimensions_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding video dimensions</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given video-dimensions-changed @msg and extract the corresponding video dimensions</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2917,7 +3057,7 @@ freed using gst_play_visualization_free().</doc>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_volume_changed" c:identifier="gst_play_message_parse_volume_changed" moved-to="PlayMessage.parse_volume_changed" version="1.20"> <function name="play_message_parse_volume_changed" c:identifier="gst_play_message_parse_volume_changed" moved-to="PlayMessage.parse_volume_changed" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given @msg and extract the corresponding audio volume</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given volume-changed @msg and extract the corresponding audio volume</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>
@ -2934,7 +3074,7 @@ freed using gst_play_visualization_free().</doc>
</parameters> </parameters>
</function> </function>
<function name="play_message_parse_warning" c:identifier="gst_play_message_parse_warning" moved-to="PlayMessage.parse_warning" version="1.20"> <function name="play_message_parse_warning" c:identifier="gst_play_message_parse_warning" moved-to="PlayMessage.parse_warning" version="1.20">
<doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given error @msg and extract the corresponding #GError warning</doc> <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.c">Parse the given warning @msg and extract the corresponding #GError</doc>
<source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/> <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/play/gstplay.h"/>
<return-value transfer-ownership="none"> <return-value transfer-ownership="none">
<type name="none" c:type="void"/> <type name="none" c:type="void"/>

View file

@ -4696,9 +4696,12 @@ gst_play_is_play_message (GstMessage * msg)
return g_str_equal (gst_structure_get_name (data), GST_PLAY_MESSAGE_DATA); return g_str_equal (gst_structure_get_name (data), GST_PLAY_MESSAGE_DATA);
} }
#define PARSE_MESSAGE_FIELD(msg, field, value_type, value) G_STMT_START { \ #define PARSE_MESSAGE_FIELD(msg, expected_msg_type, field, value_type, value) G_STMT_START { \
const GstStructure *data = NULL; \ const GstStructure *data = NULL; \
GstPlayMessage msg_type; \
g_return_if_fail (gst_play_is_play_message (msg)); \ g_return_if_fail (gst_play_is_play_message (msg)); \
gst_play_message_parse_type (msg, &msg_type); \
g_return_if_fail (msg_type == expected_msg_type); \
data = gst_message_get_structure (msg); \ data = gst_message_get_structure (msg); \
gst_structure_get (data, field, value_type, value, NULL); \ gst_structure_get (data, field, value_type, value, NULL); \
} G_STMT_END } G_STMT_END
@ -4715,8 +4718,44 @@ gst_play_is_play_message (GstMessage * msg)
void void
gst_play_message_parse_type (GstMessage * msg, GstPlayMessage * type) gst_play_message_parse_type (GstMessage * msg, GstPlayMessage * type)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_TYPE, const GstStructure *data = NULL;
GST_TYPE_PLAY_MESSAGE, type); g_return_if_fail (gst_play_is_play_message (msg));
data = gst_message_get_structure (msg);
gst_structure_get (data, GST_PLAY_MESSAGE_DATA_TYPE, GST_TYPE_PLAY_MESSAGE,
type, NULL);
}
/**
* gst_play_message_parse_uri_loaded:
* @msg: A #GstMessage
* @uri: (out) (optional) (transfer full): the resulting URI
*
* Parse the given uri-loaded @msg and extract the corresponding value
*
* Since: 1.26
*/
void
gst_play_message_parse_uri_loaded (GstMessage * msg, gchar ** uri)
{
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_URI_LOADED,
GST_PLAY_MESSAGE_DATA_URI, G_TYPE_STRING, uri);
}
/**
* gst_play_message_parse_duration_changed:
* @msg: A #GstMessage
* @duration: (out) (optional): the resulting duration
*
* Parse the given duration-changed @msg and extract the corresponding #GstClockTime
*
* Since: 1.26
*/
void
gst_play_message_parse_duration_changed (GstMessage * msg,
GstClockTime * duration)
{
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DURATION_CHANGED,
GST_PLAY_MESSAGE_DATA_DURATION, GST_TYPE_CLOCK_TIME, duration);
} }
/** /**
@ -4724,16 +4763,17 @@ gst_play_message_parse_type (GstMessage * msg, GstPlayMessage * type)
* @msg: A #GstMessage * @msg: A #GstMessage
* @duration: (out) (optional): the resulting duration * @duration: (out) (optional): the resulting duration
* *
* Parse the given duration @msg and extract the corresponding #GstClockTime * Parse the given duration-changed @msg and extract the corresponding #GstClockTime
* *
* Since: 1.20 * Since: 1.20
*
* Deprecated: 1.26: Use gst_play_message_parse_duration_changed().
*/ */
void void
gst_play_message_parse_duration_updated (GstMessage * msg, gst_play_message_parse_duration_updated (GstMessage * msg,
GstClockTime * duration) GstClockTime * duration)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_DURATION, gst_play_message_parse_duration_changed (msg, duration);
GST_TYPE_CLOCK_TIME, duration);
} }
/** /**
@ -4741,7 +4781,7 @@ gst_play_message_parse_duration_updated (GstMessage * msg,
* @msg: A #GstMessage * @msg: A #GstMessage
* @position: (out) (optional): the resulting position * @position: (out) (optional): the resulting position
* *
* Parse the given position @msg and extract the corresponding #GstClockTime * Parse the given position-updated @msg and extract the corresponding #GstClockTime
* *
* Since: 1.20 * Since: 1.20
*/ */
@ -4749,8 +4789,8 @@ void
gst_play_message_parse_position_updated (GstMessage * msg, gst_play_message_parse_position_updated (GstMessage * msg,
GstClockTime * position) GstClockTime * position)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_POSITION, PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_POSITION_UPDATED,
GST_TYPE_CLOCK_TIME, position); GST_PLAY_MESSAGE_DATA_POSITION, GST_TYPE_CLOCK_TIME, position);
} }
/** /**
@ -4758,15 +4798,31 @@ gst_play_message_parse_position_updated (GstMessage * msg,
* @msg: A #GstMessage * @msg: A #GstMessage
* @state: (out) (optional): the resulting play state * @state: (out) (optional): the resulting play state
* *
* Parse the given state @msg and extract the corresponding #GstPlayState * Parse the given state-changed @msg and extract the corresponding #GstPlayState
* *
* Since: 1.20 * Since: 1.20
*/ */
void void
gst_play_message_parse_state_changed (GstMessage * msg, GstPlayState * state) gst_play_message_parse_state_changed (GstMessage * msg, GstPlayState * state)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_PLAY_STATE, PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_STATE_CHANGED,
GST_TYPE_PLAY_STATE, state); GST_PLAY_MESSAGE_DATA_PLAY_STATE, GST_TYPE_PLAY_STATE, state);
}
/**
* gst_play_message_parse_buffering:
* @msg: A #GstMessage
* @percent: (out) (optional): the resulting buffering percent
*
* Parse the given buffering @msg and extract the corresponding value
*
* Since: 1.26
*/
void
gst_play_message_parse_buffering (GstMessage * msg, guint * percent)
{
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_BUFFERING,
GST_PLAY_MESSAGE_DATA_BUFFERING_PERCENT, G_TYPE_UINT, percent);
} }
/** /**
@ -4774,15 +4830,16 @@ gst_play_message_parse_state_changed (GstMessage * msg, GstPlayState * state)
* @msg: A #GstMessage * @msg: A #GstMessage
* @percent: (out) (optional): the resulting buffering percent * @percent: (out) (optional): the resulting buffering percent
* *
* Parse the given buffering-percent @msg and extract the corresponding value * Parse the given buffering @msg and extract the corresponding value
* *
* Since: 1.20 * Since: 1.20
*
* Deprecated: 1.26: Use gst_play_message_parse_buffering().
*/ */
void void
gst_play_message_parse_buffering_percent (GstMessage * msg, guint * percent) gst_play_message_parse_buffering_percent (GstMessage * msg, guint * percent)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_BUFFERING_PERCENT, gst_play_message_parse_buffering (msg, percent);
G_TYPE_UINT, percent);
} }
/** /**
@ -4799,9 +4856,10 @@ void
gst_play_message_parse_error (GstMessage * msg, GError ** error, gst_play_message_parse_error (GstMessage * msg, GError ** error,
GstStructure ** details) GstStructure ** details)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_ERROR, G_TYPE_ERROR, error); PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_ERROR, GST_PLAY_MESSAGE_DATA_ERROR,
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_ERROR_DETAILS, G_TYPE_ERROR, error);
GST_TYPE_STRUCTURE, details); PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_ERROR,
GST_PLAY_MESSAGE_DATA_ERROR_DETAILS, GST_TYPE_STRUCTURE, details);
} }
/** /**
@ -4810,7 +4868,7 @@ gst_play_message_parse_error (GstMessage * msg, GError ** error,
* @error: (out) (optional) (transfer full): the resulting warning * @error: (out) (optional) (transfer full): the resulting warning
* @details: (out) (optional) (nullable) (transfer full): A #GstStructure containing additional details about the warning * @details: (out) (optional) (nullable) (transfer full): A #GstStructure containing additional details about the warning
* *
* Parse the given error @msg and extract the corresponding #GError warning * Parse the given warning @msg and extract the corresponding #GError
* *
* Since: 1.20 * Since: 1.20
*/ */
@ -4818,9 +4876,10 @@ void
gst_play_message_parse_warning (GstMessage * msg, GError ** error, gst_play_message_parse_warning (GstMessage * msg, GError ** error,
GstStructure ** details) GstStructure ** details)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_WARNING, G_TYPE_ERROR, error); PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_WARNING,
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_WARNING, GST_TYPE_STRUCTURE, GST_PLAY_MESSAGE_DATA_WARNING, G_TYPE_ERROR, error);
details); PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_WARNING,
GST_PLAY_MESSAGE_DATA_WARNING_DETAILS, GST_TYPE_STRUCTURE, details);
} }
/** /**
@ -4829,7 +4888,7 @@ gst_play_message_parse_warning (GstMessage * msg, GError ** error,
* @width: (out) (optional): the resulting video width * @width: (out) (optional): the resulting video width
* @height: (out) (optional): the resulting video height * @height: (out) (optional): the resulting video height
* *
* Parse the given @msg and extract the corresponding video dimensions * Parse the given video-dimensions-changed @msg and extract the corresponding video dimensions
* *
* Since: 1.20 * Since: 1.20
*/ */
@ -4837,10 +4896,10 @@ void
gst_play_message_parse_video_dimensions_changed (GstMessage * msg, gst_play_message_parse_video_dimensions_changed (GstMessage * msg,
guint * width, guint * height) guint * width, guint * height)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_VIDEO_WIDTH, PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED,
G_TYPE_UINT, width); GST_PLAY_MESSAGE_DATA_VIDEO_WIDTH, G_TYPE_UINT, width);
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_VIDEO_HEIGHT, PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_VIDEO_DIMENSIONS_CHANGED,
G_TYPE_UINT, height); GST_PLAY_MESSAGE_DATA_VIDEO_HEIGHT, G_TYPE_UINT, height);
} }
/** /**
@ -4848,7 +4907,7 @@ gst_play_message_parse_video_dimensions_changed (GstMessage * msg,
* @msg: A #GstMessage * @msg: A #GstMessage
* @info: (out) (optional) (transfer full): the resulting media info * @info: (out) (optional) (transfer full): the resulting media info
* *
* Parse the given @msg and extract the corresponding media information * Parse the given media-info-updated @msg and extract the corresponding media information
* *
* Since: 1.20 * Since: 1.20
*/ */
@ -4856,8 +4915,8 @@ void
gst_play_message_parse_media_info_updated (GstMessage * msg, gst_play_message_parse_media_info_updated (GstMessage * msg,
GstPlayMediaInfo ** info) GstPlayMediaInfo ** info)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_MEDIA_INFO, PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_MEDIA_INFO_UPDATED,
GST_TYPE_PLAY_MEDIA_INFO, info); GST_PLAY_MESSAGE_DATA_MEDIA_INFO, GST_TYPE_PLAY_MEDIA_INFO, info);
} }
/** /**
@ -4865,15 +4924,15 @@ gst_play_message_parse_media_info_updated (GstMessage * msg,
* @msg: A #GstMessage * @msg: A #GstMessage
* @volume: (out) (optional): the resulting audio volume * @volume: (out) (optional): the resulting audio volume
* *
* Parse the given @msg and extract the corresponding audio volume * Parse the given volume-changed @msg and extract the corresponding audio volume
* *
* Since: 1.20 * Since: 1.20
*/ */
void void
gst_play_message_parse_volume_changed (GstMessage * msg, gdouble * volume) gst_play_message_parse_volume_changed (GstMessage * msg, gdouble * volume)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_VOLUME, G_TYPE_DOUBLE, PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_VOLUME_CHANGED,
volume); GST_PLAY_MESSAGE_DATA_VOLUME, G_TYPE_DOUBLE, volume);
} }
/** /**
@ -4881,13 +4940,29 @@ gst_play_message_parse_volume_changed (GstMessage * msg, gdouble * volume)
* @msg: A #GstMessage * @msg: A #GstMessage
* @muted: (out) (optional): the resulting audio muted state * @muted: (out) (optional): the resulting audio muted state
* *
* Parse the given @msg and extract the corresponding audio muted state * Parse the given mute-changed @msg and extract the corresponding audio muted state
* *
* Since: 1.20 * Since: 1.20
*/ */
void void
gst_play_message_parse_muted_changed (GstMessage * msg, gboolean * muted) gst_play_message_parse_muted_changed (GstMessage * msg, gboolean * muted)
{ {
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_DATA_IS_MUTED, G_TYPE_BOOLEAN, PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_MUTE_CHANGED,
muted); GST_PLAY_MESSAGE_DATA_IS_MUTED, G_TYPE_BOOLEAN, muted);
}
/**
* gst_play_message_parse_seek_done:
* @msg: A #GstMessage
* @position: (out) (optional): the resulting position
*
* Parse the given seek-done @msg and extract the corresponding #GstClockTime
*
* Since: 1.26
*/
void
gst_play_message_parse_seek_done (GstMessage * msg, GstClockTime * position)
{
PARSE_MESSAGE_FIELD (msg, GST_PLAY_MESSAGE_SEEK_DONE,
GST_PLAY_MESSAGE_DATA_POSITION, GST_TYPE_CLOCK_TIME, position);
} }

View file

@ -415,17 +415,26 @@ GST_PLAY_API
void gst_play_message_parse_type (GstMessage *msg, GstPlayMessage *type); void gst_play_message_parse_type (GstMessage *msg, GstPlayMessage *type);
GST_PLAY_API GST_PLAY_API
void gst_play_message_parse_uri_loaded (GstMessage *msg, gchar **uri);
GST_PLAY_DEPRECATED_FOR(gst_play_message_parse_duration_changed)
void gst_play_message_parse_duration_updated (GstMessage *msg, GstClockTime *duration); void gst_play_message_parse_duration_updated (GstMessage *msg, GstClockTime *duration);
GST_PLAY_API
void gst_play_message_parse_duration_changed (GstMessage *msg, GstClockTime *duration);
GST_PLAY_API GST_PLAY_API
void gst_play_message_parse_position_updated (GstMessage *msg, GstClockTime *position); void gst_play_message_parse_position_updated (GstMessage *msg, GstClockTime *position);
GST_PLAY_API GST_PLAY_API
void gst_play_message_parse_state_changed (GstMessage *msg, GstPlayState *state); void gst_play_message_parse_state_changed (GstMessage *msg, GstPlayState *state);
GST_PLAY_API GST_PLAY_DEPRECATED_FOR(gst_play_message_parse_buffering_percent)
void gst_play_message_parse_buffering_percent (GstMessage *msg, guint *percent); void gst_play_message_parse_buffering_percent (GstMessage *msg, guint *percent);
GST_PLAY_API
void gst_play_message_parse_buffering (GstMessage *msg, guint *percent);
GST_PLAY_API GST_PLAY_API
void gst_play_message_parse_error (GstMessage *msg, GError **error, GstStructure **details); void gst_play_message_parse_error (GstMessage *msg, GError **error, GstStructure **details);
@ -444,6 +453,9 @@ void gst_play_message_parse_volume_changed (GstMessage *ms
GST_PLAY_API GST_PLAY_API
void gst_play_message_parse_muted_changed (GstMessage *msg, gboolean *muted); void gst_play_message_parse_muted_changed (GstMessage *msg, gboolean *muted);
GST_PLAY_API
void gst_play_message_parse_seek_done (GstMessage *msg, GstClockTime *position);
G_END_DECLS G_END_DECLS
#endif /* __GST_PLAY_H__ */ #endif /* __GST_PLAY_H__ */