From 9fb56a32f51cc5a624d79463ced7ccd74953e3af Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Tue, 13 Feb 2018 12:38:33 +0100 Subject: [PATCH] gst: fix some GIR annotations Mostly related to out parameters and their transfer --- gst/gstbuffer.c | 4 ++-- gst/gstevent.c | 2 +- gst/gstmemory.c | 6 +++--- gst/gstmessage.c | 19 ++++++++++--------- gst/gstquery.c | 4 ++-- gst/gstsegment.c | 2 +- gst/gsttaglist.c | 12 ++++++++++++ gst/gsturi.c | 2 ++ 8 files changed, 33 insertions(+), 18 deletions(-) diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index a1eae0d..3c45cbd 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -2267,7 +2267,7 @@ gst_buffer_remove_meta (GstBuffer * buffer, GstMeta * meta) /** * gst_buffer_iterate_meta: (skip) * @buffer: a #GstBuffer - * @state: an opaque state pointer + * @state: (out caller-allocates): an opaque state pointer * * Retrieve the next #GstMeta after @current. If @state points * to %NULL, the first metadata is returned. @@ -2302,7 +2302,7 @@ gst_buffer_iterate_meta (GstBuffer * buffer, gpointer * state) /** * gst_buffer_iterate_meta_filtered: (skip) * @buffer: a #GstBuffer - * @state: an opaque state pointer + * @state: (out caller-allocates): an opaque state pointer * @meta_api_type: only return #GstMeta of this type * * Retrieve the next #GstMeta of type @meta_api_type after the current one diff --git a/gst/gstevent.c b/gst/gstevent.c index c41a73b..cb26088 100644 --- a/gst/gstevent.c +++ b/gst/gstevent.c @@ -2015,7 +2015,7 @@ gst_event_new_protection (const gchar * system_id, * string uniquely identifying a content protection system. * @data: (out) (allow-none) (transfer none): pointer to store a #GstBuffer * holding protection system specific information. - * @origin: (allow-none) (transfer none): pointer to store a value that + * @origin: (out) (allow-none) (transfer none): pointer to store a value that * indicates where the protection information carried by @event was extracted * from. * diff --git a/gst/gstmemory.c b/gst/gstmemory.c index 0b0dba7..ebdd45e 100644 --- a/gst/gstmemory.c +++ b/gst/gstmemory.c @@ -163,8 +163,8 @@ gst_memory_is_type (GstMemory * mem, const gchar * mem_type) /** * gst_memory_get_sizes: * @mem: a #GstMemory - * @offset: pointer to offset - * @maxsize: pointer to maxsize + * @offset: (out) (allow-none): pointer to offset + * @maxsize: (out) (allow-none): pointer to maxsize * * Get the current @size, @offset and @maxsize of @mem. * @@ -426,7 +426,7 @@ gst_memory_share (GstMemory * mem, gssize offset, gssize size) * gst_memory_is_span: * @mem1: a #GstMemory * @mem2: a #GstMemory - * @offset: a pointer to a result offset + * @offset: (out): a pointer to a result offset * * Check if @mem1 and mem2 share the memory with a common parent memory object * and that the memory is contiguous. diff --git a/gst/gstmessage.c b/gst/gstmessage.c index e02a0c1..31ad649 100644 --- a/gst/gstmessage.c +++ b/gst/gstmessage.c @@ -462,7 +462,7 @@ gst_message_new_error (GstObject * src, GError * error, const gchar * debug) /** * gst_message_parse_error_details: * @message: The message object - * @structure: (out): A pointer to the returned details + * @structure: (transfer none) (out): A pointer to the returned details * * Returns the optional details structure, may be NULL if none. * The returned structure must not be freed. @@ -552,7 +552,7 @@ gst_message_new_warning (GstObject * src, GError * error, const gchar * debug) /** * gst_message_parse_warning_details: * @message: The message object - * @structure: (out): A pointer to the returned details structure + * @structure: (transfer none) (out): A pointer to the returned details structure * * Returns the optional details structure, may be NULL if none * The returned structure must not be freed. @@ -642,7 +642,7 @@ gst_message_new_info (GstObject * src, GError * error, const gchar * debug) /** * gst_message_parse_info_details: * @message: The message object - * @structure: (out): A pointer to the returned details structure + * @structure: (transfer none) (out): A pointer to the returned details structure * * Returns the optional details structure, may be NULL if none * The returned structure must not be freed. @@ -2504,7 +2504,7 @@ gst_message_new_need_context (GstObject * src, const gchar * context_type) /** * gst_message_parse_context_type: * @message: a GST_MESSAGE_NEED_CONTEXT type message - * @context_type: (out) (allow-none): the context type, or %NULL + * @context_type: (out) (transfer none) (allow-none): the context type, or %NULL * * Parse a context type from an existing GST_MESSAGE_NEED_CONTEXT message. * @@ -2721,11 +2721,12 @@ gst_message_new_property_notify (GstObject * src, const gchar * property_name, * @message: a #GstMessage of type %GST_MESSAGE_PROPERTY_NOTIFY * @object: (out) (allow-none) (transfer none): location where to store a * pointer to the object whose property got changed, or %NULL - * @property_name: (out) (allow-none): return location for the name of the - * property that got changed, or %NULL - * @property_value: (out) (allow-none): return location for the new value of - * the property that got changed, or %NULL. This will only be set if the - * property notify watch was told to include the value when it was set up + * @property_name: (out) (transfer none) (allow-none): return location for + * the name of the property that got changed, or %NULL + * @property_value: (out) (transfer none) (allow-none): return location for + * the new value of the property that got changed, or %NULL. This will + * only be set if the property notify watch was told to include the value + * when it was set up * * Parses a property-notify message. These will be posted on the bus only * when set up with gst_element_add_property_notify_watch() or diff --git a/gst/gstquery.c b/gst/gstquery.c index 87e565b..b6dba1a 100644 --- a/gst/gstquery.c +++ b/gst/gstquery.c @@ -993,7 +993,7 @@ gst_query_parse_n_formats (GstQuery * query, guint * n_formats) /** * gst_query_parse_nth_format: * @query: a #GstQuery - * @nth: (out): the nth format to retrieve. + * @nth: the nth format to retrieve. * @format: (out) (allow-none): a pointer to store the nth format * * Parse the format query and retrieve the @nth format from it into @@ -2389,7 +2389,7 @@ gst_query_set_accept_caps_result (GstQuery * query, gboolean result) /** * gst_query_parse_accept_caps_result: * @query: a GST_QUERY_ACCEPT_CAPS type query #GstQuery - * @result: location for the result + * @result: (out) (allow-none): location for the result * * Parse the result from @query and store in @result. */ diff --git a/gst/gstsegment.c b/gst/gstsegment.c index 7b8748c..5248c05 100644 --- a/gst/gstsegment.c +++ b/gst/gstsegment.c @@ -1084,7 +1084,7 @@ gst_segment_position_from_running_time_full (const GstSegment * segment, * Returns: the position in the segment for @running_time. This function returns * -1 when @running_time is -1 or when it is not inside @segment. * - * Deprecated. Use gst_segment_position_from_running_time() instead. + * Deprecated: Use gst_segment_position_from_running_time() instead. */ #ifndef GST_REMOVE_DEPRECATED guint64 diff --git a/gst/gsttaglist.c b/gst/gsttaglist.c index 3713b2c..bdeab58 100644 --- a/gst/gsttaglist.c +++ b/gst/gsttaglist.c @@ -1640,6 +1640,18 @@ TAG_MERGE_FUNCS (int, gint, TRUE); */ TAG_MERGE_FUNCS (uint, guint, TRUE); /** + * gst_tag_list_get_int64: + * @list: a #GstTagList to get the tag from + * @tag: tag to read out + * @value: (out): location for the result + * + * Copies the contents for the given tag into the value, merging multiple values + * into one if multiple values are associated with the tag. + * + * Returns: %TRUE, if a value was copied, %FALSE if the tag didn't exist in the + * given list. + */ +/** * gst_tag_list_get_int64_index: * @list: a #GstTagList to get the tag from * @tag: tag to read out diff --git a/gst/gsturi.c b/gst/gsturi.c index 35fa503..6113902 100644 --- a/gst/gsturi.c +++ b/gst/gsturi.c @@ -498,6 +498,8 @@ gst_uri_get_location (const gchar * uri) * * Returns: (transfer full): a new string for this URI. Returns %NULL if the * given URI protocol is not valid, or the given location is %NULL. + * + * Deprecated: Use GstURI instead. */ #ifndef GST_REMOVE_DEPRECATED gchar * -- 2.7.4