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.
This commit is contained in:
Wim Taymans 2012-07-23 13:32:59 +02:00
parent fcf5e389ce
commit f9de2f499b

View file

@ -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 */