mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-04 05:22:30 +00:00
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
7 changed files with 24 additions and 25 deletions
|
@ -39,8 +39,8 @@ gst_video_meta_transform (GstBuffer * dest, GstMeta * meta,
|
|||
dmeta->buffer = dest;
|
||||
|
||||
GST_DEBUG ("copy video metadata");
|
||||
dmeta->flags = smeta->flags;
|
||||
dmeta->format = smeta->format;
|
||||
dmeta->frame_flags = smeta->frame_flags;
|
||||
dmeta->id = smeta->id;
|
||||
dmeta->width = smeta->width;
|
||||
dmeta->height = smeta->height;
|
||||
|
@ -164,8 +164,8 @@ default_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info)
|
|||
/**
|
||||
* gst_buffer_add_video_meta:
|
||||
* @buffer: a #GstBuffer
|
||||
* @flags: #GstVideoFrameFlags
|
||||
* @format: a #GstVideoFormat
|
||||
* @frame_flags: #GstVideoFrameFlags
|
||||
* @width: the width
|
||||
* @height: the height
|
||||
*
|
||||
|
@ -179,8 +179,7 @@ default_unmap (GstVideoMeta * meta, guint plane, GstMapInfo * info)
|
|||
*/
|
||||
GstVideoMeta *
|
||||
gst_buffer_add_video_meta (GstBuffer * buffer,
|
||||
GstVideoFormat format, GstVideoFrameFlags frame_flags, guint width,
|
||||
guint height)
|
||||
GstVideoFrameFlags flags, GstVideoFormat format, guint width, guint height)
|
||||
{
|
||||
GstVideoMeta *meta;
|
||||
GstVideoInfo info;
|
||||
|
@ -188,7 +187,7 @@ gst_buffer_add_video_meta (GstBuffer * buffer,
|
|||
gst_video_info_set_format (&info, format, width, height);
|
||||
|
||||
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);
|
||||
|
||||
return meta;
|
||||
|
@ -197,8 +196,8 @@ gst_buffer_add_video_meta (GstBuffer * buffer,
|
|||
/**
|
||||
* gst_buffer_add_video_meta_full:
|
||||
* @buffer: a #GstBuffer
|
||||
* @flags: #GstVideoFrameFlags
|
||||
* @format: a #GstVideoFormat
|
||||
* @frame_flags: #GstVideoFrameFlags
|
||||
* @width: the width
|
||||
* @height: the height
|
||||
* @n_planes: number of planes
|
||||
|
@ -211,7 +210,7 @@ gst_buffer_add_video_meta (GstBuffer * buffer,
|
|||
*/
|
||||
GstVideoMeta *
|
||||
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],
|
||||
gint stride[GST_VIDEO_MAX_PLANES])
|
||||
{
|
||||
|
@ -221,8 +220,8 @@ gst_buffer_add_video_meta_full (GstBuffer * buffer,
|
|||
meta =
|
||||
(GstVideoMeta *) gst_buffer_add_meta (buffer, GST_VIDEO_META_INFO, NULL);
|
||||
|
||||
meta->flags = flags;
|
||||
meta->format = format;
|
||||
meta->frame_flags = frame_flags;
|
||||
meta->id = 0;
|
||||
meta->width = width;
|
||||
meta->height = height;
|
||||
|
|
|
@ -58,8 +58,8 @@ struct _GstVideoMeta {
|
|||
|
||||
GstBuffer *buffer;
|
||||
|
||||
GstVideoFrameFlags flags;
|
||||
GstVideoFormat format;
|
||||
GstVideoFrameFlags frame_flags;
|
||||
gint id;
|
||||
guint width;
|
||||
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))
|
||||
GstVideoMeta * gst_buffer_get_video_meta_id (GstBuffer *buffer, gint id);
|
||||
|
||||
GstVideoMeta * gst_buffer_add_video_meta (GstBuffer *buffer, GstVideoFormat format,
|
||||
GstVideoFrameFlags frame_flags, guint width, guint height);
|
||||
GstVideoMeta * gst_buffer_add_video_meta_full (GstBuffer *buffer, GstVideoFormat format,
|
||||
GstVideoFrameFlags frame_flags, guint width, guint height,
|
||||
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]);
|
||||
|
||||
|
|
|
@ -260,8 +260,8 @@ video_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
|||
if (priv->add_videometa) {
|
||||
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||
|
||||
gst_buffer_add_video_meta_full (*buffer, GST_VIDEO_INFO_FORMAT (info),
|
||||
GST_VIDEO_FRAME_FLAG_NONE,
|
||||
gst_buffer_add_video_meta_full (*buffer, GST_VIDEO_FRAME_FLAG_NONE,
|
||||
GST_VIDEO_INFO_FORMAT (info),
|
||||
GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info),
|
||||
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.height = meta->height;
|
||||
frame->id = meta->id;
|
||||
frame->frame_flags = meta->frame_flags;
|
||||
frame->flags = meta->flags;
|
||||
|
||||
for (i = 0; i < info->finfo->n_planes; 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;
|
||||
|
||||
frame->id = id;
|
||||
frame->frame_flags = 0;
|
||||
frame->flags = 0;
|
||||
|
||||
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))
|
||||
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))
|
||||
frame->frame_flags |= GST_VIDEO_FRAME_FLAG_ONEFIELD;
|
||||
frame->flags |= GST_VIDEO_FRAME_FLAG_ONEFIELD;
|
||||
|
||||
gst_buffer_map (buffer, &frame->map[0], flags);
|
||||
|
||||
|
|
|
@ -623,7 +623,7 @@ typedef enum {
|
|||
*/
|
||||
struct _GstVideoFrame {
|
||||
GstVideoInfo info;
|
||||
GstVideoFrameFlags frame_flags;
|
||||
GstVideoFrameFlags flags;
|
||||
|
||||
GstBuffer *buffer;
|
||||
gpointer meta;
|
||||
|
|
|
@ -580,8 +580,8 @@ ximage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
|||
|
||||
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||
/* these are just the defaults for now */
|
||||
meta = gst_buffer_add_video_meta (ximage, GST_VIDEO_INFO_FORMAT (info),
|
||||
GST_VIDEO_FRAME_FLAG_NONE, priv->padded_width, priv->padded_height);
|
||||
meta = gst_buffer_add_video_meta (ximage, GST_VIDEO_FRAME_FLAG_NONE,
|
||||
GST_VIDEO_INFO_FORMAT (info), priv->padded_width, priv->padded_height);
|
||||
|
||||
if (priv->need_alignment) {
|
||||
gint vpad, hpad, pstride;
|
||||
|
|
|
@ -631,8 +631,8 @@ xvimage_buffer_pool_alloc (GstBufferPool * pool, GstBuffer ** buffer,
|
|||
|
||||
GST_DEBUG_OBJECT (pool, "adding GstVideoMeta");
|
||||
/* these are just the defaults for now */
|
||||
meta = gst_buffer_add_video_meta (xvimage, GST_VIDEO_INFO_FORMAT (info),
|
||||
GST_VIDEO_FRAME_FLAG_NONE, priv->padded_width, priv->padded_height);
|
||||
meta = gst_buffer_add_video_meta (xvimage, GST_VIDEO_FRAME_FLAG_NONE,
|
||||
GST_VIDEO_INFO_FORMAT (info), priv->padded_width, priv->padded_height);
|
||||
|
||||
if (priv->need_alignment) {
|
||||
meta->width = GST_VIDEO_INFO_WIDTH (&priv->info);
|
||||
|
|
Loading…
Reference in a new issue