From 4b56b731d26eca35967075c34f375788f4a531b3 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 20 Jul 2012 10:18:43 +0200 Subject: [PATCH] video-frame: add interlace flag Add an interlace flag so that we can see if a frame is interlaced or progressive in the mixed interlace-mode. --- gst-libs/gst/video/video-frame.c | 2 ++ gst-libs/gst/video/video-frame.h | 20 ++++++++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c index 55b10bcc77..acefce9fff 100644 --- a/gst-libs/gst/video/video-frame.c +++ b/gst-libs/gst/video/video-frame.c @@ -90,6 +90,8 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info, frame->flags = 0; if (GST_VIDEO_INFO_IS_INTERLACED (info)) { + if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED)) + frame->flags |= GST_VIDEO_FRAME_FLAG_INTERLACED; if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF)) frame->flags |= GST_VIDEO_FRAME_FLAG_TFF; if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_RFF)) diff --git a/gst-libs/gst/video/video-frame.h b/gst-libs/gst/video/video-frame.h index a27d77a451..e65e9fd098 100644 --- a/gst-libs/gst/video/video-frame.h +++ b/gst-libs/gst/video/video-frame.h @@ -32,6 +32,9 @@ typedef struct _GstVideoFrame GstVideoFrame; /** * GstVideoFrameFlags: * @GST_VIDEO_FRAME_FLAG_NONE: no flags + * @GST_VIDEO_FRAME_FLAG_INTERLACED: The video frame is interlaced. In mixed + * interlace-mode, this flags specifies if the frame is interlace or + * progressive. * @GST_VIDEO_FRAME_FLAG_TFF: The video frame has the top field first * @GST_VIDEO_FRAME_FLAG_RFF: The video frame has the repeat flag * @GST_VIDEO_FRAME_FLAG_ONEFIELD: The video frame has one field @@ -40,9 +43,10 @@ typedef struct _GstVideoFrame GstVideoFrame; */ typedef enum { GST_VIDEO_FRAME_FLAG_NONE = 0, - GST_VIDEO_FRAME_FLAG_TFF = (1 << 0), - GST_VIDEO_FRAME_FLAG_RFF = (1 << 1), - GST_VIDEO_FRAME_FLAG_ONEFIELD = (1 << 2) + GST_VIDEO_FRAME_FLAG_INTERLACED = (1 << 0), + GST_VIDEO_FRAME_FLAG_TFF = (1 << 1), + GST_VIDEO_FRAME_FLAG_RFF = (1 << 2), + GST_VIDEO_FRAME_FLAG_ONEFIELD = (1 << 3) } GstVideoFrameFlags; /** @@ -107,6 +111,9 @@ gboolean gst_video_frame_copy_plane (GstVideoFrame *dest, const GstVideoFr /** * GstVideoBufferFlags: + * @GST_VIDEO_BUFFER_FLAG_INTERLACED: If the #GstBuffer is interlaced. In mixed + * interlace-mode, this flags specifies if the frame is + * interlaced or progressive. * @GST_VIDEO_BUFFER_FLAG_TFF: If the #GstBuffer is interlaced, then the first field * in the video frame is the top field. If unset, the * bottom field is first. @@ -120,9 +127,10 @@ gboolean gst_video_frame_copy_plane (GstVideoFrame *dest, const GstVideoFr * Additional video buffer flags. */ typedef enum { - GST_VIDEO_BUFFER_FLAG_TFF = (GST_BUFFER_FLAG_LAST << 0), - GST_VIDEO_BUFFER_FLAG_RFF = (GST_BUFFER_FLAG_LAST << 1), - GST_VIDEO_BUFFER_FLAG_ONEFIELD = (GST_BUFFER_FLAG_LAST << 2), + GST_VIDEO_BUFFER_FLAG_INTERLACED = (GST_BUFFER_FLAG_LAST << 0), + GST_VIDEO_BUFFER_FLAG_TFF = (GST_BUFFER_FLAG_LAST << 1), + GST_VIDEO_BUFFER_FLAG_RFF = (GST_BUFFER_FLAG_LAST << 2), + GST_VIDEO_BUFFER_FLAG_ONEFIELD = (GST_BUFFER_FLAG_LAST << 3), GST_VIDEO_BUFFER_FLAG_LAST = (GST_BUFFER_FLAG_LAST << 8) } GstVideoBufferFlags;