From f9de2f499bf2c622a702cf65dfe8313ee8c7c6ed Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 23 Jul 2012 13:32:59 +0200 Subject: [PATCH] video-frame: use interlacing buffer flags Also use the buffer flags to enhance the GstVideoInfo flags in the case where there was metadata on the buffers. --- gst-libs/gst/video/video-frame.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c index acefce9fff..5070c6737f 100644 --- a/gst-libs/gst/video/video-frame.c +++ b/gst-libs/gst/video/video-frame.c @@ -89,17 +89,6 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info, frame->id = id; 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)) - frame->flags |= GST_VIDEO_FRAME_FLAG_RFF; - if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD)) - frame->flags |= GST_VIDEO_FRAME_FLAG_ONEFIELD; - } - if (!gst_buffer_map (buffer, &frame->map[0], flags)) goto map_failed; @@ -115,6 +104,17 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info, frame->buffer = gst_buffer_ref (buffer); frame->meta = meta; + /* buffer flags enhance the frame flags */ + 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)) + frame->flags |= GST_VIDEO_FRAME_FLAG_RFF; + if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD)) + frame->flags |= GST_VIDEO_FRAME_FLAG_ONEFIELD; + } return TRUE; /* ERRORS */