video: improve frame_flags
Rename the frame_flags to flags. Because they are flags on the frame object it does not need the redundant frame_ prefix. Change the order of the metadata constructor so that the flags come before the format and dimension arguments.
This commit is contained in:
parent
c84108de3c
commit
04a2610444
@ -39,8 +39,8 @@ gst_video_meta_transform (GstBuffer * dest, GstMeta * meta,
|
|||||||
dmeta->buffer = dest;
|
dmeta->buffer = dest;
|
||||||
|
|
||||||
GST_DEBUG ("copy video metadata");
|
GST_DEBUG ("copy video metadata");
|
||||||
|
dmeta->flags = smeta->flags;
|
||||||
dmeta->format = smeta->format;
|
dmeta->format = smeta->format;
|
||||||
dmeta->frame_flags = smeta->frame_flags;
|
|
||||||
dmeta->id = smeta->id;
|
dmeta->id = smeta->id;
|
||||||
dmeta->width = smeta->width;
|
dmeta->width = smeta->width;
|
||||||
dmeta->height = smeta->height;
|
dmeta->height = smeta->height;
|
||||||
@ -164,8 +164,8 @@ default_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info)
|
|||||||
/**
|
/**
|
||||||
* gst_buffer_add_video_meta:
|
* gst_buffer_add_video_meta:
|
||||||
* @buffer: a #GstBuffer
|
* @buffer: a #GstBuffer
|
||||||
|
* @flags: #GstVideoFrameFlags
|
||||||
* @format: a #GstVideoFormat
|
* @format: a #GstVideoFormat
|
||||||
* @frame_flags: #GstVideoFrameFlags
|
|
||||||
* @width: the width
|
* @width: the width
|
||||||
* @height: the height
|
* @height: the height
|
||||||
*
|
*
|
||||||
@ -179,8 +179,7 @@ default_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info)
|
|||||||
*/
|
*/
|
||||||
GstVideoMeta *
|
GstVideoMeta *
|
||||||
gst_buffer_add_video_meta (GstBuffer * buffer,
|
gst_buffer_add_video_meta (GstBuffer * buffer,
|
||||||
GstVideoFormat format, GstVideoFrameFlags frame_flags, guint width,
|
GstVideoFrameFlags flags, GstVideoFormat format, guint width, guint height)
|
||||||
guint height)
|
|
||||||
{
|
{
|
||||||
GstVideoMeta *meta;
|
GstVideoMeta *meta;
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
@ -188,7 +187,7 @@ gst_buffer_add_video_meta (GstBuffer * buffer,
|
|||||||
gst_video_info_set_format (&info, format, width, height);
|
gst_video_info_set_format (&info, format, width, height);
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
gst_buffer_add_video_meta_full (buffer, format, frame_flags, width,
|
gst_buffer_add_video_meta_full (buffer, flags, format, width,
|
||||||
height, info.finfo->n_planes, info.offset, info.stride);
|
height, info.finfo->n_planes, info.offset, info.stride);
|
||||||
|
|
||||||
return meta;
|
return meta;
|
||||||
@ -197,8 +196,8 @@ gst_buffer_add_video_meta (GstBuffer * buffer,
|
|||||||
/**
|
/**
|
||||||
* gst_buffer_add_video_meta_full:
|
* gst_buffer_add_video_meta_full:
|
||||||
* @buffer: a #GstBuffer
|
* @buffer: a #GstBuffer
|
||||||
|
* @flags: #GstVideoFrameFlags
|
||||||
* @format: a #GstVideoFormat
|
* @format: a #GstVideoFormat
|
||||||
* @frame_flags: #GstVideoFrameFlags
|
|
||||||
* @width: the width
|
* @width: the width
|
||||||
* @height: the height
|
* @height: the height
|
||||||
* @n_planes: number of planes
|
* @n_planes: number of planes
|
||||||
@ -211,7 +210,7 @@ gst_buffer_add_video_meta (GstBuffer * buffer,
|
|||||||
*/
|
*/
|
||||||
GstVideoMeta *
|
GstVideoMeta *
|
||||||
gst_buffer_add_video_meta_full (GstBuffer * buffer,
|
gst_buffer_add_video_meta_full (GstBuffer * buffer,
|
||||||
GstVideoFormat format, GstVideoFrameFlags frame_flags, guint width,
|
GstVideoFrameFlags flags, GstVideoFormat format, guint width,
|
||||||
guint height, guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
guint height, guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
||||||
gint stride[GST_VIDEO_MAX_PLANES])
|
gint stride[GST_VIDEO_MAX_PLANES])
|
||||||
{
|
{
|
||||||
@ -221,8 +220,8 @@ gst_buffer_add_video_meta_full (GstBuffer * buffer,
|
|||||||
meta =
|
meta =
|
||||||
(GstVideoMeta *) gst_buffer_add_meta (buffer, GST_VIDEO_META_INFO, NULL);
|
(GstVideoMeta *) gst_buffer_add_meta (buffer, GST_VIDEO_META_INFO, NULL);
|
||||||
|
|
||||||
|
meta->flags = flags;
|
||||||
meta->format = format;
|
meta->format = format;
|
||||||
meta->frame_flags = frame_flags;
|
|
||||||
meta->id = 0;
|
meta->id = 0;
|
||||||
meta->width = width;
|
meta->width = width;
|
||||||
meta->height = height;
|
meta->height = height;
|
||||||
|
@ -58,8 +58,8 @@ struct _GstVideoMeta {
|
|||||||
|
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
|
|
||||||
|
GstVideoFrameFlags flags;
|
||||||
GstVideoFormat format;
|
GstVideoFormat format;
|
||||||
GstVideoFrameFlags frame_flags;
|
|
||||||
gint id;
|
gint id;
|
||||||
guint width;
|
guint width;
|
||||||
guint height;
|
guint height;
|
||||||
@ -79,10 +79,10 @@ const GstMetaInfo * gst_video_meta_get_info (void);
|
|||||||
#define gst_buffer_get_video_meta(b) ((GstVideoMeta*)gst_buffer_get_meta((b),GST_VIDEO_META_API_TYPE))
|
#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);
|
GstVideoMeta * gst_buffer_get_video_meta_id (GstBuffer *buffer, gint id);
|
||||||
|
|
||||||
GstVideoMeta * gst_buffer_add_video_meta (GstBuffer *buffer, GstVideoFormat format,
|
GstVideoMeta * gst_buffer_add_video_meta (GstBuffer *buffer, GstVideoFrameFlags flags,
|
||||||
GstVideoFrameFlags frame_flags, guint width, guint height);
|
GstVideoFormat format, guint width, guint height);
|
||||||
GstVideoMeta * gst_buffer_add_video_meta_full (GstBuffer *buffer, GstVideoFormat format,
|
GstVideoMeta * gst_buffer_add_video_meta_full (GstBuffer *buffer, GstVideoFrameFlags flags,
|
||||||
GstVideoFrameFlags frame_flags, guint width, guint height,
|
GstVideoFormat format, guint width, guint height,
|
||||||
guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
guint n_planes, gsize offset[GST_VIDEO_MAX_PLANES],
|
||||||
gint stride[GST_VIDEO_MAX_PLANES]);
|
gint stride[GST_VIDEO_MAX_PLANES]);
|
||||||
|
|
||||||
|
@ -260,8 +260,8 @@ video_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
|||||||
if (priv->add_videometa) {
|
if (priv->add_videometa) {
|
||||||
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||||
|
|
||||||
gst_buffer_add_video_meta_full (*buffer, GST_VIDEO_INFO_FORMAT (info),
|
gst_buffer_add_video_meta_full (*buffer, GST_VIDEO_FRAME_FLAG_NONE,
|
||||||
GST_VIDEO_FRAME_FLAG_NONE,
|
GST_VIDEO_INFO_FORMAT (info),
|
||||||
GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info),
|
GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info),
|
||||||
GST_VIDEO_INFO_N_PLANES (info), info->offset, info->stride);
|
GST_VIDEO_INFO_N_PLANES (info), info->offset, info->stride);
|
||||||
}
|
}
|
||||||
|
@ -1038,7 +1038,7 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
|||||||
frame->info.width = meta->width;
|
frame->info.width = meta->width;
|
||||||
frame->info.height = meta->height;
|
frame->info.height = meta->height;
|
||||||
frame->id = meta->id;
|
frame->id = meta->id;
|
||||||
frame->frame_flags = meta->frame_flags;
|
frame->flags = meta->flags;
|
||||||
|
|
||||||
for (i = 0; i < info->finfo->n_planes; i++)
|
for (i = 0; i < info->finfo->n_planes; i++)
|
||||||
gst_video_meta_map (meta, i, &frame->map[i], &frame->data[i],
|
gst_video_meta_map (meta, i, &frame->map[i], &frame->data[i],
|
||||||
@ -1050,14 +1050,14 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
|
|||||||
goto no_metadata;
|
goto no_metadata;
|
||||||
|
|
||||||
frame->id = id;
|
frame->id = id;
|
||||||
frame->frame_flags = 0;
|
frame->flags = 0;
|
||||||
|
|
||||||
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF))
|
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF))
|
||||||
frame->frame_flags |= GST_VIDEO_FRAME_FLAG_TFF;
|
frame->flags |= GST_VIDEO_FRAME_FLAG_TFF;
|
||||||
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF))
|
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF))
|
||||||
frame->frame_flags |= GST_VIDEO_FRAME_FLAG_RFF;
|
frame->flags |= GST_VIDEO_FRAME_FLAG_RFF;
|
||||||
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD))
|
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD))
|
||||||
frame->frame_flags |= GST_VIDEO_FRAME_FLAG_ONEFIELD;
|
frame->flags |= GST_VIDEO_FRAME_FLAG_ONEFIELD;
|
||||||
|
|
||||||
gst_buffer_map (buffer, &frame->map[0], flags);
|
gst_buffer_map (buffer, &frame->map[0], flags);
|
||||||
|
|
||||||
|
@ -623,7 +623,7 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
struct _GstVideoFrame {
|
struct _GstVideoFrame {
|
||||||
GstVideoInfo info;
|
GstVideoInfo info;
|
||||||
GstVideoFrameFlags frame_flags;
|
GstVideoFrameFlags flags;
|
||||||
|
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
gpointer meta;
|
gpointer meta;
|
||||||
|
@ -580,8 +580,8 @@ ximage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
|||||||
|
|
||||||
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||||
/* these are just the defaults for now */
|
/* these are just the defaults for now */
|
||||||
meta = gst_buffer_add_video_meta (ximage, GST_VIDEO_INFO_FORMAT (info),
|
meta = gst_buffer_add_video_meta (ximage, GST_VIDEO_FRAME_FLAG_NONE,
|
||||||
GST_VIDEO_FRAME_FLAG_NONE, priv->padded_width, priv->padded_height);
|
GST_VIDEO_INFO_FORMAT (info), priv->padded_width, priv->padded_height);
|
||||||
|
|
||||||
if (priv->need_alignment) {
|
if (priv->need_alignment) {
|
||||||
gint vpad, hpad, pstride;
|
gint vpad, hpad, pstride;
|
||||||
|
@ -631,8 +631,8 @@ xvimage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
|||||||
|
|
||||||
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||||
/* these are just the defaults for now */
|
/* these are just the defaults for now */
|
||||||
meta = gst_buffer_add_video_meta (xvimage, GST_VIDEO_INFO_FORMAT (info),
|
meta = gst_buffer_add_video_meta (xvimage, GST_VIDEO_FRAME_FLAG_NONE,
|
||||||
GST_VIDEO_FRAME_FLAG_NONE, priv->padded_width, priv->padded_height);
|
GST_VIDEO_INFO_FORMAT (info), priv->padded_width, priv->padded_height);
|
||||||
|
|
||||||
if (priv->need_alignment) {
|
if (priv->need_alignment) {
|
||||||
meta->width = GST_VIDEO_INFO_WIDTH (&priv->info);
|
meta->width = GST_VIDEO_INFO_WIDTH (&priv->info);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user