From 601c772447b0bada8e54d097088b8ea51ecba09a Mon Sep 17 00:00:00 2001
From: Matthew Waters <matthew@centricular.com>
Date: Thu, 3 Apr 2025 13:43:55 +1100
Subject: [PATCH] webrtc: Add missing Since markers to new ICE API

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8698>
---
 girs/GstWebRTC-1.0.gir                        | 10 ++-
 .../gst-plugins-bad/gst-libs/gst/webrtc/ice.h | 73 +++++++++++++++++--
 2 files changed, 71 insertions(+), 12 deletions(-)

diff --git a/girs/GstWebRTC-1.0.gir b/girs/GstWebRTC-1.0.gir
index acf46f8dc7..cf16dfb305 100644
--- a/girs/GstWebRTC-1.0.gir
+++ b/girs/GstWebRTC-1.0.gir
@@ -1573,9 +1573,11 @@ stops automatic ICE gathering.</doc>
         </parameters>
       </glib:signal>
     </class>
-    <record name="WebRTCICECandidateStats" c:type="GstWebRTCICECandidateStats" glib:type-name="GstWebRTCICECandidateStats" glib:get-type="gst_webrtc_ice_candidate_stats_get_type" c:symbol-prefix="webrtc_ice_candidate_stats">
+    <record name="WebRTCICECandidateStats" c:type="GstWebRTCICECandidateStats" version="1.22" glib:type-name="GstWebRTCICECandidateStats" glib:get-type="gst_webrtc_ice_candidate_stats_get_type" c:symbol-prefix="webrtc_ice_candidate_stats">
       <source-position filename="../subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h"/>
       <field name="ipaddr" writable="1">
+        <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h">A string containing the address of the candidate. This value may be
+         an IPv4 address, an IPv6 address, or a fully-qualified domain name (Since: 1.22)</doc>
         <type name="utf8" c:type="gchar*"/>
       </field>
       <field name="port" writable="1">
@@ -1584,7 +1586,7 @@ stops automatic ICE gathering.</doc>
       </field>
       <field name="stream_id" writable="1">
         <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h">A string that uniquely identifies the object that is being
- monitored to produce this set of statistics (Since: 1.22)</doc>
+            monitored to produce this set of statistics (Since: 1.22)</doc>
         <type name="guint" c:type="guint"/>
       </field>
       <field name="type" writable="1">
@@ -1593,7 +1595,7 @@ stops automatic ICE gathering.</doc>
       </field>
       <field name="proto" writable="1">
         <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h">A string specifying the protocol (tcp or udp) used to transmit data
-on the @port (Since: 1.22)</doc>
+        on the @port (Since: 1.22)</doc>
         <type name="utf8" c:type="const gchar*"/>
       </field>
       <field name="relay_proto" writable="1">
@@ -1605,7 +1607,7 @@ on the @port (Since: 1.22)</doc>
       </field>
       <field name="url" writable="1">
         <doc xml:space="preserve" filename="../subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h">For local candidates, the url property is the URL of the ICE server
-from which the candidate was received (Since: 1.22)</doc>
+      from which the candidate was received (Since: 1.22)</doc>
         <type name="utf8" c:type="gchar*"/>
       </field>
       <union name="ABI" c:type="ABI">
diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h
index 32e21fbc62..cd2ab982dc 100644
--- a/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h
+++ b/subprojects/gst-plugins-bad/gst-libs/gst/webrtc/ice.h
@@ -49,27 +49,28 @@ struct _GstWebRTCICE
 
 /**
  * GstWebRTCICECandidateStats:
- * @ipadd: A string containing the address of the candidate. This value may be
- * an IPv4 address, an IPv6 address, or a fully-qualified domain name (Since: 1.22)
+ * @ipaddr: A string containing the address of the candidate. This value may be
+ *          an IPv4 address, an IPv6 address, or a fully-qualified domain name (Since: 1.22)
  * @port: The network port number used by the candidate (Since: 1.22)
  * @stream_id: A string that uniquely identifies the object that is being
- *  monitored to produce this set of statistics (Since: 1.22)
+ *             monitored to produce this set of statistics (Since: 1.22)
  * @type: The candidate type (Since: 1.22)
  * @proto: A string specifying the protocol (tcp or udp) used to transmit data
- * on the @port (Since: 1.22)
+ *         on the @port (Since: 1.22)
  * @replay_proto: A string identifying the protocol used by the endpoint for
- * communicating with the TURN server; valid values are tcp, udp, and tls (Since: 1.22)
+ *                communicating with the TURN server; valid values are tcp, udp, and tls (Since: 1.22)
  * @prio: The candidate's priority, corresponding to RTCIceCandidate.priority (Since: 1.22)
  * @url: For local candidates, the url property is the URL of the ICE server
- * from which the candidate was received (Since: 1.22)
+ *       from which the candidate was received (Since: 1.22)
  * @foundation: The ICE foundation as defined in RFC5245 section 15.1 (Since: 1.28)
  * @related_address: The ICE rel-addr defined in RFC5245 section 15.1 Only
- * set for serverreflexive, peerreflexive and relay candidates. (Since: 1.28)
+ *                   set for serverreflexive, peerreflexive and relay candidates. (Since: 1.28)
  * @related_port: The ICE rel-addr defined in RFC5245 section 15.1. Only set
- * for serverreflexive, peerreflexive and relay candidates. (Since: 1.28)
+ *                for serverreflexive, peerreflexive and relay candidates. (Since: 1.28)
  * @username_fragment: The ICE username fragment as defined in RFC5245 section 7.1.2.3 (Since: 1.28)
  * @tcp_type: The ICE candidate TCP type, (Since: 1.28)
  *
+ * Since: 1.22
  */
 struct _GstWebRTCICECandidateStats
 {
@@ -82,12 +83,68 @@ struct _GstWebRTCICECandidateStats
   guint                             prio;
   gchar                            *url;
 
+  /**
+   * GstWebRTCICECandidateStats.ABI: (attributes doc.skip=true)
+   *
+   * ABI compatibility union
+   *
+   * Since: 1.28
+   */
   union {
+    /**
+     * GstWebRTCICECandidateStats.ABI.abi: (attributes doc.skip=true)
+     *
+     * ABI compatibility struct
+     *
+     * Since: 1.28
+     */
     struct {
+      /**
+       * GstWebRTCICECandidateStats.ABI.abi.foundation:
+       *
+       * The foundation of the ICE candidate.
+       *
+       * Since: 1.28
+       */
       gchar *foundation;
+
+      /**
+       * GstWebRTCICECandidateStats.ABI.abi.related_address:
+       *
+       * The related address (STUN or TURN server) of the candidate. Will be
+       * NULL for host candidates.
+       *
+       * Since: 1.28
+       */
       gchar *related_address;
+
+      /**
+       * GstWebRTCICECandidateStats.ABI.abi.related_port:
+       *
+       * The related port (STUN or TURN server) of the candidate. Will be
+       * 0 for host candidates.
+       *
+       * Since: 1.28
+       */
       guint related_port;
+
+      /**
+       * GstWebRTCICECandidateStats.ABI.abi.username_fragment:
+       *
+       * The ICE username for this candidate.
+       *
+       * Since: 1.28
+       */
       gchar *username_fragment;
+
+      /**
+       * GstWebRTCICECandidateStats.ABI.abi.tcp_type:
+       *
+       * The type of TCP candidate. Will be NULL if the candidate is not a TCP
+       * candidate.
+       *
+       * Since: 1.28
+       */
       const gchar *tcp_type;
     } abi;
     /*< private >*/