mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-09 05:38:58 +00:00
meta: add some docs
This commit is contained in:
parent
d68f2d4694
commit
65d2d56f03
2 changed files with 55 additions and 16 deletions
|
@ -35,7 +35,22 @@ gst_meta_video_get_info (void)
|
||||||
return meta_video_info;
|
return meta_video_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_buffer_add_meta_video:
|
||||||
|
* @buffer: a #GstBuffer
|
||||||
|
* @flags: #GstVideoFlags
|
||||||
|
* @format: a #GstVideoFormat
|
||||||
|
* @width: the width
|
||||||
|
* @height: the height
|
||||||
|
*
|
||||||
|
* Attaches GstVideoMeta metadata to @buffer with the given parameters and the
|
||||||
|
* default offsets and strides for @format and @width x @height.
|
||||||
|
*
|
||||||
|
* This function calculates the default offsets and strides and then calls
|
||||||
|
* gst_buffer_add_meta_video_full() with them.
|
||||||
|
*
|
||||||
|
* Returns: the #GstMetaVideo on @buffer.
|
||||||
|
*/
|
||||||
GstMetaVideo *
|
GstMetaVideo *
|
||||||
gst_buffer_add_meta_video (GstBuffer * buffer, GstVideoFlags flags,
|
gst_buffer_add_meta_video (GstBuffer * buffer, GstVideoFlags flags,
|
||||||
GstVideoFormat format, guint width, guint height)
|
GstVideoFormat format, guint width, guint height)
|
||||||
|
@ -51,6 +66,21 @@ gst_buffer_add_meta_video (GstBuffer * buffer, GstVideoFlags flags,
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_buffer_add_meta_video_full:
|
||||||
|
* @buffer: a #GstBuffer
|
||||||
|
* @flags: #GstVideoFlags
|
||||||
|
* @format: a #GstVideoFormat
|
||||||
|
* @width: the width
|
||||||
|
* @height: the height
|
||||||
|
* @n_planes: number of planes
|
||||||
|
* @offset: offset of each plane
|
||||||
|
* @stride: stride of each plane
|
||||||
|
*
|
||||||
|
* Attaches GstVideoMeta metadata to @buffer with the given parameters.
|
||||||
|
*
|
||||||
|
* Returns: the #GstMetaVideo on @buffer.
|
||||||
|
*/
|
||||||
GstMetaVideo *
|
GstMetaVideo *
|
||||||
gst_buffer_add_meta_video_full (GstBuffer * buffer, GstVideoFlags flags,
|
gst_buffer_add_meta_video_full (GstBuffer * buffer, GstVideoFlags flags,
|
||||||
GstVideoFormat format, guint width, guint height,
|
GstVideoFormat format, guint width, guint height,
|
||||||
|
@ -74,7 +104,6 @@ gst_buffer_add_meta_video_full (GstBuffer * buffer, GstVideoFlags flags,
|
||||||
meta->offset[i] = offset[i];
|
meta->offset[i] = offset[i];
|
||||||
meta->stride[i] = stride[i];
|
meta->stride[i] = stride[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return meta;
|
return meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,6 +130,18 @@ find_mem_for_offset (GstBuffer * buffer, guint * offset, GstMapFlags flags)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_meta_video_map:
|
||||||
|
* @meta: a #GstVideoMeta
|
||||||
|
* @plane: a plane
|
||||||
|
* @stride: result stride
|
||||||
|
* @flags: @GstMapFlags
|
||||||
|
*
|
||||||
|
* Map the video plane with index @plane in @meta and return a pointer to the
|
||||||
|
* first byte of the plane and the stride of the plane.
|
||||||
|
*
|
||||||
|
* Returns: a pointer to the first byte of the plane data
|
||||||
|
*/
|
||||||
gpointer
|
gpointer
|
||||||
gst_meta_video_map (GstMetaVideo * meta, guint plane, gint * stride,
|
gst_meta_video_map (GstMetaVideo * meta, guint plane, gint * stride,
|
||||||
GstMapFlags flags)
|
GstMapFlags flags)
|
||||||
|
@ -127,12 +168,22 @@ gst_meta_video_map (GstMetaVideo * meta, guint plane, gint * stride,
|
||||||
* the plane offset */
|
* the plane offset */
|
||||||
mem = find_mem_for_offset (buffer, &offset, flags);
|
mem = find_mem_for_offset (buffer, &offset, flags);
|
||||||
|
|
||||||
/* move to the right offset inside the block */
|
|
||||||
base = gst_memory_map (mem, NULL, NULL, flags);
|
base = gst_memory_map (mem, NULL, NULL, flags);
|
||||||
|
|
||||||
|
/* move to the right offset inside the block */
|
||||||
return base + offset;
|
return base + offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* gst_meta_video_unmap:
|
||||||
|
* @meta: a #GstVideoMeta
|
||||||
|
* @plane: a plane
|
||||||
|
* @data: the data to unmap
|
||||||
|
*
|
||||||
|
* Unmap previously mapped data with gst_video_meta_map().
|
||||||
|
*
|
||||||
|
* Returns: TRUE if the memory was successfully unmapped.
|
||||||
|
*/
|
||||||
gboolean
|
gboolean
|
||||||
gst_meta_video_unmap (GstMetaVideo * meta, guint plane, gpointer data)
|
gst_meta_video_unmap (GstMetaVideo * meta, guint plane, gpointer data)
|
||||||
{
|
{
|
||||||
|
@ -170,15 +221,3 @@ gst_meta_video_crop_get_info (void)
|
||||||
}
|
}
|
||||||
return meta_video_crop_info;
|
return meta_video_crop_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
GstMetaVideoCrop *
|
|
||||||
gst_buffer_add_meta_video_crop (GstBuffer * buffer)
|
|
||||||
{
|
|
||||||
GstMetaVideoCrop *meta;
|
|
||||||
|
|
||||||
meta =
|
|
||||||
(GstMetaVideoCrop *) gst_buffer_add_meta (buffer,
|
|
||||||
GST_META_INFO_VIDEO_CROP, NULL);
|
|
||||||
|
|
||||||
return meta;
|
|
||||||
}
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ struct _GstMetaVideoCrop {
|
||||||
const GstMetaInfo * gst_meta_video_crop_get_info (void);
|
const GstMetaInfo * gst_meta_video_crop_get_info (void);
|
||||||
|
|
||||||
#define gst_buffer_get_meta_video_crop(b) ((GstMetaVideoCrop*)gst_buffer_get_meta((b),GST_META_INFO_VIDEO_CROP))
|
#define gst_buffer_get_meta_video_crop(b) ((GstMetaVideoCrop*)gst_buffer_get_meta((b),GST_META_INFO_VIDEO_CROP))
|
||||||
GstMetaVideoCrop * gst_buffer_add_meta_video_crop (GstBuffer *buffer);
|
#define gst_buffer_add_meta_video_crop(b) ((GstMetaVideoCrop*)gst_buffer_add_meta((b),GST_META_INFO_VIDEO_CROP, NULL))
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue