![]() |
![]() |
![]() |
GStreamer Base Plugins 1.0 Library Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
#include <>gst/video/gstvideometa.h> struct GstVideoMeta; gboolean gst_video_meta_map (GstVideoMeta *meta
,guint plane
,GstMapInfo *info
,gpointer *data
,gint *stride
,GstMapFlags flags
); gboolean gst_video_meta_unmap (GstVideoMeta *meta
,guint plane
,GstMapInfo *info
); const GstMetaInfo * gst_video_meta_get_info (void
); GstVideoMeta * gst_buffer_add_video_meta (GstBuffer *buffer
,GstVideoFrameFlags flags
,GstVideoFormat format
,guint width
,guint height
); GstVideoMeta * gst_buffer_add_video_meta_full (GstBuffer *buffer
,GstVideoFrameFlags flags
,GstVideoFormat format
,guint width
,guint height
,guint n_planes
,gsize offset[GST_VIDEO_MAX_PLANES]
,gint stride[GST_VIDEO_MAX_PLANES]
); #define gst_buffer_get_video_meta (b) GstVideoMeta * gst_buffer_get_video_meta_id (GstBuffer *buffer
,gint id
); struct GstVideoCropMeta; #define gst_buffer_add_video_crop_meta (b) #define gst_buffer_get_video_crop_meta (b)
struct GstVideoMeta { GstMeta meta; GstBuffer *buffer; GstVideoFrameFlags flags; GstVideoFormat format; gint id; guint width; guint height; guint n_planes; gsize offset[GST_VIDEO_MAX_PLANES]; gint stride[GST_VIDEO_MAX_PLANES]; gboolean (*map) (GstVideoMeta *meta, guint plane, GstMapInfo *info, gpointer *data, gint * stride, GstMapFlags flags); gboolean (*unmap) (GstVideoMeta *meta, guint plane, GstMapInfo *info); };
Extra buffer metadata describing image properties
GstMeta |
parent GstMeta |
GstBuffer * |
the buffer this metadata belongs to |
GstVideoFrameFlags |
additional video flags |
GstVideoFormat |
the video format |
gint |
identifier of the frame |
guint |
the video width |
guint |
the video height |
guint |
the number of planes in the image |
array of offsets for the planes. This field might not always be
valid, it is used by the default implementation of map . |
|
gint |
array of strides for the planes. This field might not always be
valid, it is used by the default implementation of map . |
map the memory of a plane | |
unmap the memory of a plane |
gboolean gst_video_meta_map (GstVideoMeta *meta
,guint plane
,GstMapInfo *info
,gpointer *data
,gint *stride
,GstMapFlags flags
);
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.
|
a GstVideoMeta |
|
a plane |
|
a GstMapInfo |
|
the data of plane
|
|
the stride of plane
|
|
GstMapFlags |
Returns : |
TRUE if the map operation was successful. |
gboolean gst_video_meta_unmap (GstVideoMeta *meta
,guint plane
,GstMapInfo *info
);
Unmap a previously mapped plane with gst_video_meta_map()
.
|
a GstVideoMeta |
|
a plane |
|
a GstMapInfo |
Returns : |
TRUE if the memory was successfully unmapped. |
GstVideoMeta * gst_buffer_add_video_meta (GstBuffer *buffer
,GstVideoFrameFlags flags
,GstVideoFormat format
,guint width
,guint 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_video_meta_full()
with them.
|
a GstBuffer |
|
GstVideoFrameFlags |
|
a GstVideoFormat |
|
the width |
|
the height |
Returns : |
the GstVideoMeta on buffer . |
GstVideoMeta * gst_buffer_add_video_meta_full (GstBuffer *buffer
,GstVideoFrameFlags flags
,GstVideoFormat format
,guint width
,guint height
,guint n_planes
,gsize offset[GST_VIDEO_MAX_PLANES]
,gint stride[GST_VIDEO_MAX_PLANES]
);
Attaches GstVideoMeta metadata to buffer
with the given parameters.
|
a GstBuffer |
|
GstVideoFrameFlags |
|
a GstVideoFormat |
|
the width |
|
the height |
|
number of planes |
|
offset of each plane |
|
stride of each plane |
Returns : |
the GstVideoMeta on buffer . |
#define gst_buffer_get_video_meta(b) ((GstVideoMeta*)gst_buffer_get_meta((b),GST_VIDEO_META_API_TYPE))
GstVideoMeta * gst_buffer_get_video_meta_id (GstBuffer *buffer
,gint id
);
Find the GstVideoMeta on buffer
with the given id
.
Buffers can contain multiple GstVideoMeta metadata items when dealing with multiview buffers.
|
a GstBuffer |
|
a metadata id |
Returns : |
the GstVideoMeta with id or NULL when there is no such metadata
on buffer . |
struct GstVideoCropMeta { GstMeta meta; guint x; guint y; guint width; guint height; };
Extra buffer metadata describing image cropping.
#define gst_buffer_add_video_crop_meta(b) ((GstVideoCropMeta*)gst_buffer_add_meta((b),GST_VIDEO_CROP_META_INFO, NULL))