summaryrefslogtreecommitdiff
path: root/gst-libs/gst/video/video.c
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2012-04-19 12:03:19 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2012-04-19 12:30:57 +0200
commit91ffe7dd5e2fbdae73c0402fb5ea71639bb35ec0 (patch)
treed9db960e4a882ea227fecfc4c266bc73ff41e736 /gst-libs/gst/video/video.c
parent131bf5fb47676b8529c7e40c79bb081860e60a2c (diff)
video: Clean up interlaced flags and enums
There's a new GstVideoFrameFlags enum now that contains the frame specific flags only. GstVideoFlags does not contain the TFF/TFF/ONEFIELD flags anymore because these are strictly frame specific. Also add fallback to parse these fields from the GstBufferFlags in gst_video_frame_map() if there's no GstVideoMeta attached to the buffer.
Diffstat (limited to 'gst-libs/gst/video/video.c')
-rw-r--r--gst-libs/gst/video/video.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/gst-libs/gst/video/video.c b/gst-libs/gst/video/video.c
index de66de5f1..2fe216f68 100644
--- a/gst-libs/gst/video/video.c
+++ b/gst-libs/gst/video/video.c
@@ -1030,12 +1030,15 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
else
meta = gst_buffer_get_video_meta_id (buffer, id);
+ /* copy the info */
+ frame->info = *info;
+
if (meta) {
- frame->info.flags = meta->flags;
frame->info.finfo = &formats[meta->format].info;
frame->info.width = meta->width;
frame->info.height = meta->height;
frame->id = meta->id;
+ frame->frame_flags = meta->frame_flags;
for (i = 0; i < info->finfo->n_planes; i++)
gst_video_meta_map (meta, i, &frame->map[i], &frame->data[i],
@@ -1046,9 +1049,15 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
if (id != -1)
goto no_metadata;
- /* copy the info */
- frame->info = *info;
frame->id = id;
+ frame->frame_flags = 0;
+
+ if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF))
+ frame->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;
+ if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_ONEFIELD))
+ frame->frame_flags |= GST_VIDEO_FRAME_FLAG_ONEFIELD;
gst_buffer_map (buffer, &frame->map[0], flags);