diff --git a/gst/gstbuffer.c b/gst/gstbuffer.c index 34c893b84e..ce72b7aba6 100644 --- a/gst/gstbuffer.c +++ b/gst/gstbuffer.c @@ -34,7 +34,8 @@ * created one will typically allocate memory for it and add it to the buffer. * The following example creates a buffer that can hold a given video frame * with a given width, height and bits per plane. - * |[ + * + * ``` C * GstBuffer *buffer; * GstMemory *memory; * gint size, width, height, bpp; @@ -44,7 +45,7 @@ * memory = gst_allocator_alloc (NULL, size, NULL); * gst_buffer_insert_memory (buffer, -1, memory); * ... - * ]| + * ``` * * Alternatively, use gst_buffer_new_allocate() to create a buffer with * preallocated data of a given size. @@ -84,7 +85,7 @@ * * If a plug-in wants to modify the buffer data or metadata in-place, it should * first obtain a buffer that is safe to modify by using - * gst_buffer_make_writable(). This function is optimized so that a copy will + * gst_buffer_make_writable(). This function is optimized so that a copy will * only be made when it is necessary. * * Several flags of the buffer can be set and unset with the @@ -96,7 +97,7 @@ * needed. * * Arbitrary extra metadata can be set on a buffer with gst_buffer_add_meta(). - * Metadata can be retrieved with gst_buffer_get_meta(). See also #GstMeta + * Metadata can be retrieved with gst_buffer_get_meta(). See also #GstMeta. * * An element should either unref the buffer or push it out on a src pad * using gst_pad_push() (see #GstPad). @@ -114,8 +115,8 @@ * using the #GstMemory of the parent buffer, and wants to prevent the parent * buffer from being returned to a buffer pool until the #GstMemory is available * for re-use. (Since: 1.6) - * */ + #define GST_DISABLE_MINIOBJECT_INLINE_FUNCTIONS #include "gst_private.h" @@ -355,7 +356,7 @@ _replace_memory (GstBuffer * buffer, guint len, guint idx, guint length, * gst_buffer_get_flags: * @buffer: a #GstBuffer * - * Get the #GstBufferFlags flags set on this buffer. + * Gets the #GstBufferFlags flags set on this buffer. * * Returns: the flags set on this buffer. * @@ -501,7 +502,7 @@ _priv_gst_buffer_initialize (void) /** * gst_buffer_get_max_memory: * - * Get the maximum amount of memory blocks that a buffer can hold. This is a + * Gets the maximum amount of memory blocks that a buffer can hold. This is a * compile time constant that can be queried with the function. * * When more memory blocks are added, existing memory blocks will be merged @@ -730,7 +731,7 @@ _gst_buffer_copy (const GstBuffer * buffer) * gst_buffer_copy_deep: * @buf: a #GstBuffer. * - * Create a copy of the given buffer. This will make a newly allocated + * Creates a copy of the given buffer. This will make a newly allocated * copy of the data the source buffer contains. * * Returns: (transfer full): a new copy of @buf. @@ -839,8 +840,6 @@ gst_buffer_init (GstBufferImpl * buffer, gsize size) * * Creates a newly allocated buffer without any data. * - * MT safe. - * * Returns: (transfer full): the new #GstBuffer. */ GstBuffer * @@ -871,10 +870,7 @@ gst_buffer_new (void) * * Note that when @size == 0, the buffer will not have memory associated with it. * - * MT safe. - * - * Returns: (transfer full) (nullable): a new #GstBuffer, or %NULL if - * the memory couldn't be allocated. + * Returns: (transfer full) (nullable): a new #GstBuffer */ GstBuffer * gst_buffer_new_allocate (GstAllocator * allocator, gsize size, @@ -972,7 +968,7 @@ no_memory: * @user_data: (allow-none): user_data * @notify: (allow-none) (scope async) (closure user_data): called with @user_data when the memory is freed * - * Allocate a new buffer that wraps the given memory. @data must point to + * Allocates a new buffer that wraps the given memory. @data must point to * @maxsize of memory, the wrapped buffer will have the region from @offset and * @size visible. * @@ -1008,9 +1004,7 @@ gst_buffer_new_wrapped_full (GstMemoryFlags flags, gpointer data, * @size: allocated size of @data * * Creates a new buffer that wraps the given @data. The memory will be freed - * with g_free and will be marked writable. - * - * MT safe. + * with g_free() and will be marked writable. * * Returns: (transfer full): a new #GstBuffer */ @@ -1027,8 +1021,6 @@ gst_buffer_new_wrapped (gpointer data, gsize size) * Creates a new #GstBuffer that wraps the given @bytes. The data inside * @bytes cannot be %NULL and the resulting buffer will be marked as read only. * - * MT safe. - * * Returns: (transfer full): a new #GstBuffer wrapping @bytes * * Since: 1.16 @@ -1051,7 +1043,7 @@ gst_buffer_new_wrapped_bytes (GBytes * bytes) * gst_buffer_n_memory: * @buffer: a #GstBuffer. * - * Get the amount of memory blocks that this buffer has. This amount is never + * Gets the amount of memory blocks that this buffer has. This amount is never * larger than what gst_buffer_get_max_memory() returns. * * Returns: the number of memory blocks this buffer is made of. @@ -1069,7 +1061,7 @@ gst_buffer_n_memory (GstBuffer * buffer) * @buffer: a #GstBuffer. * @mem: (transfer full): a #GstMemory. * - * Prepend the memory block @mem to @buffer. This function takes + * Prepends the memory block @mem to @buffer. This function takes * ownership of @mem and thus doesn't increase its refcount. * * This function is identical to gst_buffer_insert_memory() with an index of 0. @@ -1086,7 +1078,7 @@ gst_buffer_prepend_memory (GstBuffer * buffer, GstMemory * mem) * @buffer: a #GstBuffer. * @mem: (transfer full): a #GstMemory. * - * Append the memory block @mem to @buffer. This function takes + * Appends the memory block @mem to @buffer. This function takes * ownership of @mem and thus doesn't increase its refcount. * * This function is identical to gst_buffer_insert_memory() with an index of -1. @@ -1104,7 +1096,7 @@ gst_buffer_append_memory (GstBuffer * buffer, GstMemory * mem) * @idx: the index to add the memory at, or -1 to append it to the end * @mem: (transfer full): a #GstMemory. * - * Insert the memory block @mem to @buffer at @idx. This function takes ownership + * Inserts the memory block @mem into @buffer at @idx. This function takes ownership * of @mem and thus doesn't increase its refcount. * * Only gst_buffer_get_max_memory() can be added to a buffer. If more memory is @@ -1160,7 +1152,7 @@ _get_mapped (GstBuffer * buffer, guint idx, GstMapInfo * info, * @buffer: a #GstBuffer. * @idx: an index * - * Get the memory block at @idx in @buffer. The memory block stays valid until + * Gets the memory block at @idx in @buffer. The memory block stays valid until * the memory block in @buffer is removed, replaced or merged, typically with * any call that modifies the memory in @buffer. * @@ -1180,10 +1172,10 @@ gst_buffer_peek_memory (GstBuffer * buffer, guint idx) * @buffer: a #GstBuffer. * @idx: an index * - * Get the memory block at index @idx in @buffer. + * Gets the memory block at index @idx in @buffer. * * Returns: (transfer full) (nullable): a #GstMemory that contains the data of the - * memory block at @idx. Use gst_memory_unref () after usage. + * memory block at @idx. */ GstMemory * gst_buffer_get_memory (GstBuffer * buffer, guint idx) @@ -1195,11 +1187,10 @@ gst_buffer_get_memory (GstBuffer * buffer, guint idx) * gst_buffer_get_all_memory: * @buffer: a #GstBuffer. * - * Get all the memory block in @buffer. The memory blocks will be merged + * Gets all the memory blocks in @buffer. The memory blocks will be merged * into one large #GstMemory. * * Returns: (transfer full) (nullable): a #GstMemory that contains the merged memory. - * Use gst_memory_unref () after usage. */ GstMemory * gst_buffer_get_all_memory (GstBuffer * buffer) @@ -1213,13 +1204,13 @@ gst_buffer_get_all_memory (GstBuffer * buffer) * @idx: an index * @length: a length * - * Get @length memory blocks in @buffer starting at @idx. The memory blocks will + * Gets @length memory blocks in @buffer starting at @idx. The memory blocks will * be merged into one large #GstMemory. * * If @length is -1, all memory starting from @idx is merged. * * Returns: (transfer full) (nullable): a #GstMemory that contains the merged data of @length - * blocks starting at @idx. Use gst_memory_unref () after usage. + * blocks starting at @idx. */ GstMemory * gst_buffer_get_memory_range (GstBuffer * buffer, guint idx, gint length) @@ -1270,7 +1261,7 @@ gst_buffer_replace_all_memory (GstBuffer * buffer, GstMemory * mem) * gst_buffer_replace_memory_range: * @buffer: a #GstBuffer. * @idx: an index - * @length: a length should not be 0 + * @length: a length, should not be 0 * @mem: (transfer full): a #GstMemory * * Replaces @length memory blocks in @buffer starting at @idx with @mem. @@ -1306,7 +1297,7 @@ gst_buffer_replace_memory_range (GstBuffer * buffer, guint idx, gint length, * @buffer: a #GstBuffer. * @idx: an index * - * Remove the memory block in @b at index @i. + * Removes the memory block in @b at index @i. */ void gst_buffer_remove_memory (GstBuffer * buffer, guint idx) @@ -1318,7 +1309,7 @@ gst_buffer_remove_memory (GstBuffer * buffer, guint idx) * gst_buffer_remove_all_memory: * @buffer: a #GstBuffer. * - * Remove all the memory blocks in @buffer. + * Removes all the memory blocks in @buffer. */ void gst_buffer_remove_all_memory (GstBuffer * buffer) @@ -1333,7 +1324,7 @@ gst_buffer_remove_all_memory (GstBuffer * buffer) * @idx: an index * @length: a length * - * Remove @length memory blocks in @buffer starting from @idx. + * Removes @length memory blocks in @buffer starting from @idx. * * @length can be -1, in which case all memory starting from @idx is removed. */ @@ -1366,7 +1357,7 @@ gst_buffer_remove_memory_range (GstBuffer * buffer, guint idx, gint length) * @length: (out): pointer to length * @skip: (out): pointer to skip * - * Find the memory blocks that span @size bytes starting from @offset + * Finds the memory blocks that span @size bytes starting from @offset * in @buffer. * * When this function returns %TRUE, @idx will contain the index of the first @@ -1434,9 +1425,9 @@ gst_buffer_find_memory (GstBuffer * buffer, gsize offset, gsize size, * gst_buffer_is_memory_range_writable: * @buffer: a #GstBuffer. * @idx: an index - * @length: a length should not be 0 + * @length: a length, should not be 0 * - * Check if @length memory blocks in @buffer starting from @idx are writable. + * Checks if @length memory blocks in @buffer starting from @idx are writable. * * @length can be -1 to check all the memory blocks after @idx. * @@ -1477,7 +1468,7 @@ gst_buffer_is_memory_range_writable (GstBuffer * buffer, guint idx, gint length) * gst_buffer_is_all_memory_writable: * @buffer: a #GstBuffer. * - * Check if all memory blocks in @buffer are writable. + * Checks if all memory blocks in @buffer are writable. * * Note that this function does not check if @buffer is writable, use * gst_buffer_is_writable() to check that if needed. @@ -1498,7 +1489,7 @@ gst_buffer_is_all_memory_writable (GstBuffer * buffer) * @offset: (out) (allow-none): a pointer to the offset * @maxsize: (out) (allow-none): a pointer to the maxsize * - * Get the total size of the memory blocks in @b. + * Gets the total size of the memory blocks in @buffer. * * When not %NULL, @offset will contain the offset of the data in the * first memory block in @buffer and @maxsize will contain the sum of @@ -1518,7 +1509,7 @@ gst_buffer_get_sizes (GstBuffer * buffer, gsize * offset, gsize * maxsize) * gst_buffer_get_size: * @buffer: a #GstBuffer. * - * Get the total size of the memory blocks in @buffer. + * Gets the total size of the memory blocks in @buffer. * * Returns: total size of the memory blocks in @buffer. */ @@ -1545,7 +1536,7 @@ gst_buffer_get_size (GstBuffer * buffer) * @offset: (out) (allow-none): a pointer to the offset * @maxsize: (out) (allow-none): a pointer to the maxsize * - * Get the total size of @length memory blocks stating from @idx in @buffer. + * Gets the total size of @length memory blocks stating from @idx in @buffer. * * When not %NULL, @offset will contain the offset of the data in the * memory block in @buffer at @idx and @maxsize will contain the sum of the size @@ -1625,7 +1616,7 @@ gst_buffer_get_sizes_range (GstBuffer * buffer, guint idx, gint length, * @offset: the offset adjustment * @size: the new size or -1 to just adjust the offset * - * Set the offset and total size of the memory blocks in @buffer. + * Sets the offset and total size of the memory blocks in @buffer. */ void gst_buffer_resize (GstBuffer * buffer, gssize offset, gssize size) @@ -1638,7 +1629,7 @@ gst_buffer_resize (GstBuffer * buffer, gssize offset, gssize size) * @buffer: a #GstBuffer. * @size: the new size * - * Set the total size of the memory blocks in @buffer. + * Sets the total size of the memory blocks in @buffer. */ void gst_buffer_set_size (GstBuffer * buffer, gssize size) @@ -1654,7 +1645,7 @@ gst_buffer_set_size (GstBuffer * buffer, gssize size) * @offset: the offset adjustment * @size: the new size or -1 to just adjust the offset * - * Set the total size of the @length memory blocks starting at @idx in + * Sets the total size of the @length memory blocks starting at @idx in * @buffer * * Returns: %TRUE if resizing succeeded, %FALSE otherwise. @@ -1760,8 +1751,7 @@ gst_buffer_resize_range (GstBuffer * buffer, guint idx, gint length, * @info: (out caller-allocates): info about the mapping * @flags: flags for the mapping * - * This function fills @info with the #GstMapInfo of all merged memory - * blocks in @buffer. + * Fills @info with the #GstMapInfo of all merged memory blocks in @buffer. * * @flags describe the desired access of the memory. When @flags is * #GST_MAP_WRITE, @buffer should be writable (as returned from @@ -1790,7 +1780,7 @@ gst_buffer_map (GstBuffer * buffer, GstMapInfo * info, GstMapFlags flags) * @info: (out caller-allocates): info about the mapping * @flags: flags for the mapping * - * This function fills @info with the #GstMapInfo of @length merged memory blocks + * Fills @info with the #GstMapInfo of @length merged memory blocks * starting at @idx in @buffer. When @length is -1, all memory blocks starting * from @idx are merged and mapped. * @@ -1887,7 +1877,7 @@ cannot_map: * @buffer: a #GstBuffer. * @info: a #GstMapInfo * - * Release the memory previously mapped with gst_buffer_map(). + * Releases the memory previously mapped with gst_buffer_map(). */ void gst_buffer_unmap (GstBuffer * buffer, GstMapInfo * info) @@ -1910,7 +1900,7 @@ gst_buffer_unmap (GstBuffer * buffer, GstMapInfo * info) * @src: (array length=size) (element-type guint8): the source address * @size: the size to fill * - * Copy @size bytes from @src to @buffer at @offset. + * Copies @size bytes from @src to @buffer at @offset. * * Returns: The amount of bytes copied. This value can be lower than @size * when @buffer did not contain enough data. @@ -1963,7 +1953,7 @@ gst_buffer_fill (GstBuffer * buffer, gsize offset, gconstpointer src, * the destination address * @size: the size to extract * - * Copy @size bytes starting from @offset in @buffer to @dest. + * Copies @size bytes starting from @offset in @buffer to @dest. * * Returns: The amount of bytes extracted. This value can be lower than @size * when @buffer did not contain enough data. @@ -2013,7 +2003,7 @@ gst_buffer_extract (GstBuffer * buffer, gsize offset, gpointer dest, gsize size) * @mem: (array length=size) (element-type guint8): the memory to compare * @size: the size to compare * - * Compare @size bytes starting from @offset in @buffer with the memory in @mem. + * Compares @size bytes starting from @offset in @buffer with the memory in @mem. * * Returns: 0 if the memory is equal. */ @@ -2066,7 +2056,7 @@ gst_buffer_memcmp (GstBuffer * buffer, gsize offset, gconstpointer mem, * @val: the value to set * @size: the size to set * - * Fill @buf with @size bytes with @val starting from @offset. + * Fills @buf with @size bytes with @val starting from @offset. * * Returns: The amount of bytes filled. This value can be lower than @size * when @buffer did not contain enough data. @@ -2125,8 +2115,6 @@ gst_buffer_memset (GstBuffer * buffer, gsize offset, guint8 val, gsize size) * duration and offset end fields are also copied. If not they will be set * to #GST_CLOCK_TIME_NONE and #GST_BUFFER_OFFSET_NONE. * - * MT safe. - * * Returns: (transfer full): the new #GstBuffer or %NULL if the arguments were * invalid. */ @@ -2155,7 +2143,7 @@ gst_buffer_copy_region (GstBuffer * buffer, GstBufferCopyFlags flags, * @buf1: (transfer full): the first source #GstBuffer to append. * @buf2: (transfer full): the second source #GstBuffer to append. * - * Append all the memory from @buf2 to @buf1. The result buffer will contain a + * Appends all the memory from @buf2 to @buf1. The result buffer will contain a * concatenation of the memory of @buf1 and @buf2. * * Returns: (transfer full): the new #GstBuffer that contains the memory @@ -2174,7 +2162,7 @@ gst_buffer_append (GstBuffer * buf1, GstBuffer * buf2) * @offset: the offset in @buf2 * @size: the size or -1 of @buf2 * - * Append @size bytes at @offset from @buf2 to @buf1. The result buffer will + * Appends @size bytes at @offset from @buf2 to @buf1. The result buffer will * contain a concatenation of the memory of @buf1 and the requested region of * @buf2. * @@ -2218,14 +2206,13 @@ gst_buffer_append_region (GstBuffer * buf1, GstBuffer * buf2, gssize offset, * @buffer: a #GstBuffer * @api: the #GType of an API * - * Get the metadata for @api on buffer. When there is no such metadata, %NULL is + * Gets the metadata for @api on buffer. When there is no such metadata, %NULL is * returned. If multiple metadata with the given @api are attached to this * buffer only the first one is returned. To handle multiple metadata with a * given API use gst_buffer_iterate_meta() or gst_buffer_foreach_meta() instead - * and check the meta->info.api member for the API type. + * and check the `meta->info.api` member for the API type. * - * Returns: (transfer none) (nullable): the metadata for @api on - * @buffer. + * Returns: (transfer none) (nullable): the metadata for @api on @buffer. */ GstMeta * gst_buffer_get_meta (GstBuffer * buffer, GType api) @@ -2275,7 +2262,7 @@ gst_buffer_get_n_meta (GstBuffer * buffer, GType api_type) * @info: a #GstMetaInfo * @params: params for @info * - * Add metadata for @info to @buffer using the parameters in @params. + * Adds metadata for @info to @buffer using the parameters in @params. * * Returns: (transfer none) (nullable): the metadata for the api in @info on @buffer. */ @@ -2338,7 +2325,7 @@ init_failed: * @buffer: a #GstBuffer * @meta: a #GstMeta * - * Remove the metadata for @meta on @buffer. + * Removes the metadata for @meta on @buffer. * * Returns: %TRUE if the metadata existed and was removed, %FALSE if no such * metadata was on @buffer. @@ -2392,7 +2379,7 @@ gst_buffer_remove_meta (GstBuffer * buffer, GstMeta * meta) * @buffer: a #GstBuffer * @state: (out caller-allocates): an opaque state pointer * - * Retrieve the next #GstMeta after @current. If @state points + * Retrieves the next #GstMeta after @current. If @state points * to %NULL, the first metadata is returned. * * @state will be updated with an opaque state pointer @@ -2428,7 +2415,7 @@ gst_buffer_iterate_meta (GstBuffer * buffer, gpointer * state) * @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 + * Retrieves the next #GstMeta of type @meta_api_type after the current one * according to @state. If @state points to %NULL, the first metadata of * type @meta_api_type is returned. * @@ -2471,10 +2458,10 @@ gst_buffer_iterate_meta_filtered (GstBuffer * buffer, gpointer * state, * @func: (scope call): a #GstBufferForeachMetaFunc to call * @user_data: (closure): user data passed to @func * - * Call @func with @user_data for each meta in @buffer. + * Calls @func with @user_data for each meta in @buffer. * * @func can modify the passed meta pointer or its contents. The return value - * of @func define if this function returns or if the remaining metadata items + * of @func defines if this function returns or if the remaining metadata items * in the buffer should be skipped. * * Returns: %FALSE when @func returned %FALSE for one of the metadata. @@ -2577,7 +2564,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_parent_buffer_meta_debug); * @buffer: (transfer none): a #GstBuffer * @ref: (transfer none): a #GstBuffer to ref * - * Add a #GstParentBufferMeta to @buffer that holds a reference on + * Adds a #GstParentBufferMeta to @buffer that holds a reference on * @ref until the buffer is freed. * * Returns: (transfer none) (nullable): The #GstParentBufferMeta that was added to the buffer @@ -2676,7 +2663,7 @@ gst_parent_buffer_meta_api_get_type (void) /** * gst_parent_buffer_meta_get_info: * - * Get the global #GstMetaInfo describing the #GstParentBufferMeta meta. + * Gets the global #GstMetaInfo describing the #GstParentBufferMeta meta. * * Returns: (transfer none): The #GstMetaInfo * @@ -2710,7 +2697,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_reference_timestamp_meta_debug); * @timestamp: timestamp * @duration: duration, or %GST_CLOCK_TIME_NONE * - * Add a #GstReferenceTimestampMeta to @buffer that holds a @timestamp and + * Adds a #GstReferenceTimestampMeta to @buffer that holds a @timestamp and * optionally @duration based on a specific timestamp @reference. See the * documentation of #GstReferenceTimestampMeta for details. * @@ -2746,7 +2733,7 @@ gst_buffer_add_reference_timestamp_meta (GstBuffer * buffer, * @buffer: a #GstBuffer * @reference: (allow-none): a reference #GstCaps * - * Find the first #GstReferenceTimestampMeta on @buffer that conforms to + * Finds the first #GstReferenceTimestampMeta on @buffer that conforms to * @reference. Conformance is tested by checking if the meta's reference is a * subset of @reference. * @@ -2848,7 +2835,7 @@ gst_reference_timestamp_meta_api_get_type (void) /** * gst_reference_timestamp_meta_get_info: * - * Get the global #GstMetaInfo describing the #GstReferenceTimestampMeta meta. + * Gets the global #GstMetaInfo describing the #GstReferenceTimestampMeta meta. * * Returns: (transfer none): The #GstMetaInfo * @@ -2909,10 +2896,9 @@ gst_buffer_add_custom_meta (GstBuffer * buffer, const gchar * name) * @buffer: a #GstBuffer * @name: the registered name of the custom meta to retrieve. * - * Find the first #GstCustomMeta on @buffer for the desired @name. + * Finds the first #GstCustomMeta on @buffer for the desired @name. * - * Returns: (transfer none) (nullable): the #GstCustomMeta or %NULL when there - * is no such metadata on @buffer. + * Returns: (transfer none) (nullable): the #GstCustomMeta * * Since: 1.20 */ @@ -2945,7 +2931,7 @@ gst_buffer_get_custom_meta (GstBuffer * buffer, const gchar * name) * of @buf and its metadata, see gst_buffer_is_writable(). * It is important to note that keeping additional references to * GstBuffer instances can potentially increase the number - * of memcpy operations in a pipeline. + * of `memcpy` operations in a pipeline. * * Returns: (transfer full): @buf */ @@ -2991,7 +2977,7 @@ gst_clear_buffer (GstBuffer ** buf_ptr) * gst_buffer_copy: (skip) * @buf: a #GstBuffer. * - * Create a copy of the given buffer. This will only copy the buffer's + * Creates a copy of the given buffer. This will only copy the buffer's * data to a newly allocated memory if needed (if the type of memory * requires it), otherwise the underlying data is just referenced. * Check gst_buffer_copy_deep() if you want to force the data diff --git a/gst/gstbuffer.h b/gst/gstbuffer.h index f2cd71d044..7c47c43d8f 100644 --- a/gst/gstbuffer.h +++ b/gst/gstbuffer.h @@ -47,7 +47,7 @@ typedef struct _GstBufferPool GstBufferPool; * GST_BUFFER_FLAGS: * @buf: a #GstBuffer. * - * A flags word containing #GstBufferFlags flags set on this buffer. + * Returns a flags word containing #GstBufferFlags flags set on this buffer. */ #define GST_BUFFER_FLAGS(buf) GST_MINI_OBJECT_FLAGS(buf) /** @@ -80,25 +80,27 @@ typedef struct _GstBufferPool GstBufferPool; * GST_BUFFER_PTS: * @buf: a #GstBuffer.: * - * The presentation timestamp (pts) in nanoseconds (as a #GstClockTime) + * Gets the presentation timestamp (pts) in nanoseconds (as a #GstClockTime) * of the data in the buffer. This is the timestamp when the media should be * presented to the user. + * * Value will be %GST_CLOCK_TIME_NONE if the pts is unknown. */ #define GST_BUFFER_PTS(buf) (GST_BUFFER_CAST(buf)->pts) /** * GST_BUFFER_DTS: - * @buf: a #GstBuffer.: + * @buf: a #GstBuffer. * - * The decoding timestamp (dts) in nanoseconds (as a #GstClockTime) + * Gets the decoding timestamp (dts) in nanoseconds (as a #GstClockTime) * of the data in the buffer. This is the timestamp when the media should be * decoded or processed otherwise. + * * Value will be %GST_CLOCK_TIME_NONE if the dts is unknown. */ #define GST_BUFFER_DTS(buf) (GST_BUFFER_CAST(buf)->dts) /** * GST_BUFFER_DTS_OR_PTS: - * @buf: a #GstBuffer.: + * @buf: a #GstBuffer. * * Returns the buffer decoding timestamp (dts) if valid, else the buffer * presentation time (pts) @@ -110,7 +112,8 @@ typedef struct _GstBufferPool GstBufferPool; * GST_BUFFER_DURATION: * @buf: a #GstBuffer. * - * The duration in nanoseconds (as a #GstClockTime) of the data in the buffer. + * Gets the duration in nanoseconds (as a #GstClockTime) of the data in the buffer. + * * Value will be %GST_CLOCK_TIME_NONE if the duration is unknown. */ #define GST_BUFFER_DURATION(buf) (GST_BUFFER_CAST(buf)->duration) @@ -118,14 +121,14 @@ typedef struct _GstBufferPool GstBufferPool; * GST_BUFFER_OFFSET: * @buf: a #GstBuffer. * - * The offset in the source file of the beginning of this buffer. + * Gets the offset in the source file of the beginning of this buffer. */ #define GST_BUFFER_OFFSET(buf) (GST_BUFFER_CAST(buf)->offset) /** * GST_BUFFER_OFFSET_END: * @buf: a #GstBuffer. * - * The offset in the source file of the end of this buffer. + * Gets the offset in the source file of the end of this buffer. */ #define GST_BUFFER_OFFSET_END(buf) (GST_BUFFER_CAST(buf)->offset_end) @@ -207,14 +210,6 @@ typedef struct _GstBufferPool GstBufferPool; * @GST_BUFFER_FLAG_DELTA_UNIT: this unit cannot be decoded independently. * @GST_BUFFER_FLAG_TAG_MEMORY: this flag is set when memory of the buffer * is added/removed - * @GST_BUFFER_FLAG_SYNC_AFTER: Elements which write to disk or permanent - * storage should ensure the data is synced after - * writing the contents of this buffer. (Since: 1.6) - * @GST_BUFFER_FLAG_NON_DROPPABLE: This buffer is important and should not be dropped. - * This can be used to mark important buffers, e.g. to flag - * RTP packets carrying keyframes or codec setup data for RTP - * Forward Error Correction purposes, or to prevent still video - * frames from being dropped by elements due to QoS. (Since: 1.14) * @GST_BUFFER_FLAG_LAST: additional media specific flags can be added starting from * this flag. * @@ -232,7 +227,29 @@ typedef enum { GST_BUFFER_FLAG_DROPPABLE = (GST_MINI_OBJECT_FLAG_LAST << 8), GST_BUFFER_FLAG_DELTA_UNIT = (GST_MINI_OBJECT_FLAG_LAST << 9), GST_BUFFER_FLAG_TAG_MEMORY = (GST_MINI_OBJECT_FLAG_LAST << 10), + + /** + * GST_BUFFER_FLAG_SYNC_AFTER: + * + * Elements which write to disk or permanent storage should ensure the data + * is synced after writing the contents of this buffer. + * + * Since: 1.6 + */ GST_BUFFER_FLAG_SYNC_AFTER = (GST_MINI_OBJECT_FLAG_LAST << 11), + + /** + * GST_BUFFER_FLAG_NON_DROPPABLE: + * + * This buffer is important and should not be dropped. + * + * This can be used to mark important buffers, e.g. to flag RTP packets + * carrying keyframes or codec setup data for RTP Forward Error Correction + * purposes, or to prevent still video frames from being dropped by elements + * due to QoS. + * + * Since: 1.14 + */ GST_BUFFER_FLAG_NON_DROPPABLE = (GST_MINI_OBJECT_FLAG_LAST << 12), GST_BUFFER_FLAG_LAST = (GST_MINI_OBJECT_FLAG_LAST << 16) @@ -466,8 +483,6 @@ GstBuffer * gst_buffer_copy_deep (const GstBuffer * buf); * merged * @GST_BUFFER_COPY_META: flag indicating that buffer meta should be * copied - * @GST_BUFFER_COPY_DEEP: flag indicating that memory should always be - * copied instead of reffed (Since: 1.2) * * A set of flags that can be provided to the gst_buffer_copy_into() * function to specify which items should be copied. @@ -479,6 +494,14 @@ typedef enum { GST_BUFFER_COPY_META = (1 << 2), GST_BUFFER_COPY_MEMORY = (1 << 3), GST_BUFFER_COPY_MERGE = (1 << 4), + + /** + * @GST_BUFFER_COPY_DEEP: + * + * flag indicating that memory should always be copied instead of reffed + * + * Since: 1.2 + */ GST_BUFFER_COPY_DEEP = (1 << 5) } GstBufferCopyFlags; @@ -690,7 +713,7 @@ GType gst_parent_buffer_meta_api_get_type (void); * gst_buffer_get_parent_buffer_meta: * @b: a #GstBuffer * - * Find and return a #GstParentBufferMeta if one exists on the + * Finds and returns a #GstParentBufferMeta if one exists on the * buffer */ #define gst_buffer_get_parent_buffer_meta(b) \ @@ -721,10 +744,10 @@ typedef struct _GstReferenceTimestampMeta GstReferenceTimestampMeta; * captured. * * The reference is stored as a #GstCaps in @reference. Examples of valid - * references would be "timestamp/x-drivername-stream" for timestamps that are locally - * generated by some driver named "drivername" when generating the stream, - * e.g. based on a frame counter, or "timestamp/x-ntp, host=pool.ntp.org, - * port=123" for timestamps based on a specific NTP server. + * references would be `timestamp/x-drivername-stream` for timestamps that are locally + * generated by some driver named `drivername` when generating the stream, + * e.g. based on a frame counter, or `timestamp/x-ntp, host=pool.ntp.org, + * port=123` for timestamps based on a specific NTP server. * * Since: 1.14 */ diff --git a/gst/gstprotection.c b/gst/gstprotection.c index af0434a2b7..534b8e566d 100644 --- a/gst/gstprotection.c +++ b/gst/gstprotection.c @@ -134,8 +134,7 @@ gst_protection_meta_get_info (void) * * Attaches protection metadata to a #GstBuffer. * - * Returns: (transfer none): a pointer to the added #GstProtectionMeta if successful; %NULL if - * unsuccessful. + * Returns: (transfer none): a pointer to the added #GstProtectionMeta if successful * * Since: 1.6 */