net: Add/fix various annotations
authorSebastian Dröge <sebastian@centricular.com>
Sat, 15 Oct 2022 09:20:08 +0000 (12:20 +0300)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 18 Oct 2022 08:56:58 +0000 (08:56 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3194>

subprojects/gstreamer/libs/gst/net/gstnetaddressmeta.c
subprojects/gstreamer/libs/gst/net/gstnettimepacket.c
subprojects/gstreamer/libs/gst/net/gstnettimeprovider.c
subprojects/gstreamer/libs/gst/net/gstntppacket.c

index 9867cac..139cac7 100644 (file)
@@ -130,7 +130,7 @@ gst_buffer_add_net_address_meta (GstBuffer * buffer, GSocketAddress * addr)
  *
  * Find the #GstNetAddressMeta on @buffer.
  *
- * Returns: (transfer none): the #GstNetAddressMeta or %NULL when there
+ * Returns: (transfer none) (nullable): the #GstNetAddressMeta or %NULL when there
  * is no such metadata on @buffer.
  */
 GstNetAddressMeta *
index f914988..801b17e 100644 (file)
@@ -47,7 +47,7 @@ G_DEFINE_BOXED_TYPE (GstNetTimePacket, gst_net_time_packet,
 
 /**
  * gst_net_time_packet_new:
- * @buffer: (array): a buffer from which to construct the packet, or NULL
+ * @buffer: (array zero-terminated="0" fixed-size="16") (nullable): a buffer from which to construct the packet, or NULL
  *
  * Creates a new #GstNetTimePacket from a buffer received over the network. The
  * caller is responsible for ensuring that @buffer is at least
@@ -58,7 +58,7 @@ G_DEFINE_BOXED_TYPE (GstNetTimePacket, gst_net_time_packet,
  *
  * MT safe. Caller owns return value (gst_net_time_packet_free to free).
  *
- * Returns: The new #GstNetTimePacket.
+ * Returns: (transfer full): The new #GstNetTimePacket.
  */
 GstNetTimePacket *
 gst_net_time_packet_new (const guint8 * buffer)
@@ -98,7 +98,7 @@ gst_net_time_packet_free (GstNetTimePacket * packet)
  *
  * Make a copy of @packet.
  *
- * Returns: a copy of @packet, free with gst_net_time_packet_free().
+ * Returns: (transfer full): a copy of @packet, free with gst_net_time_packet_free().
  */
 GstNetTimePacket *
 gst_net_time_packet_copy (const GstNetTimePacket * packet)
@@ -123,7 +123,7 @@ gst_net_time_packet_copy (const GstNetTimePacket * packet)
  *
  * MT safe. Caller owns return value (g_free to free).
  *
- * Returns: A newly allocated sequence of #GST_NET_TIME_PACKET_SIZE bytes.
+ * Returns: (transfer full) (array zero-terminated="0" fixed-size="16"): A newly allocated sequence of #GST_NET_TIME_PACKET_SIZE bytes.
  */
 guint8 *
 gst_net_time_packet_serialize (const GstNetTimePacket * packet)
@@ -143,7 +143,7 @@ gst_net_time_packet_serialize (const GstNetTimePacket * packet)
 /**
  * gst_net_time_packet_receive:
  * @socket: socket to receive the time packet on
- * @src_address: (out): address of variable to return sender address
+ * @src_address: (out) (optional) (transfer full): address of variable to return sender address
  * @error: return address for a #GError, or NULL
  *
  * Receives a #GstNetTimePacket over a socket. Handles interrupted system
index 1df6959..11f3068 100644 (file)
@@ -456,7 +456,7 @@ gst_net_time_provider_initable_iface_init (gpointer g_iface)
  *
  * Allows network clients to get the current time of @clock.
  *
- * Returns: (transfer full): the new #GstNetTimeProvider, or NULL on error
+ * Returns: (transfer full) (nullable): the new #GstNetTimeProvider, or NULL on error
  */
 GstNetTimeProvider *
 gst_net_time_provider_new (GstClock * clock, const gchar * address, gint port)
@@ -471,7 +471,8 @@ gst_net_time_provider_new (GstClock * clock, const gchar * address, gint port)
       "address", address, "port", port, NULL);
 
   /* Clear floating flag */
-  g_object_ref_sink (ret);
+  if (ret)
+    g_object_ref_sink (ret);
 
   return ret;
 }
index 8d88d75..ecdb792 100644 (file)
@@ -78,7 +78,7 @@ gst_clock_time_to_ntp_timestamp_fraction (GstClockTime gst)
 
 /**
  * gst_ntp_packet_new:
- * @buffer: (array): a buffer from which to construct the packet, or NULL
+ * @buffer: (array zero-terminated="0" fixed-size="48"): a buffer from which to construct the packet, or NULL
  * @error: a #GError
  *
  * Creates a new #GstNtpPacket from a buffer received over the network. The
@@ -182,7 +182,7 @@ gst_ntp_packet_free (GstNtpPacket * packet)
  *
  * Make a copy of @packet.
  *
- * Returns: a copy of @packet, free with gst_ntp_packet_free().
+ * Returns: (transfer full): a copy of @packet, free with gst_ntp_packet_free().
  */
 GstNtpPacket *
 gst_ntp_packet_copy (const GstNtpPacket * packet)
@@ -208,7 +208,7 @@ gst_ntp_packet_copy (const GstNtpPacket * packet)
  *
  * MT safe. Caller owns return value (g_free to free).
  *
- * Returns: A newly allocated sequence of #GST_NTP_PACKET_SIZE bytes.
+ * Returns: (transfer full) (array zero-terminated="0" fixed-size="48"): A newly allocated sequence of #GST_NTP_PACKET_SIZE bytes.
  */
 guint8 *
 gst_ntp_packet_serialize (const GstNtpPacket * packet)
@@ -260,7 +260,7 @@ gst_ntp_packet_serialize (const GstNtpPacket * packet)
 /**
  * gst_ntp_packet_receive:
  * @socket: socket to receive the time packet on
- * @src_address: (out): address of variable to return sender address
+ * @src_address: (out) (optional) (transfer full): address of variable to return sender address
  * @error: return address for a #GError, or NULL
  *
  * Receives a #GstNtpPacket over a socket. Handles interrupted system