From: Wim Taymans Date: Mon, 23 Jul 2012 11:32:59 +0000 (+0200) Subject: video-frame: use interlacing buffer flags X-Git-Tag: 1.19.3~511^2~6145 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f9de2f499bf2c622a702cf65dfe8313ee8c7c6ed;p=platform%2Fupstream%2Fgstreamer.git 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. --- diff --git a/gst-libs/gst/video/video-frame.c b/gst-libs/gst/video/video-frame.c index acefce9..5070c67 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 */