video-frame: Take TFF flag from the video info if it was set in there

The caps and thus the video info have preference. If the field order is
set in there then it applies to all frames.

This works around issues where the tff field order is only set in the
caps but not additionally in the buffer flags.
This commit is contained in:
Sebastian Dröge 2019-08-16 11:58:28 +03:00 committed by Sebastian Dröge
parent f65145371b
commit 8478aa7aed

View file

@ -138,15 +138,21 @@ gst_video_frame_map_id (GstVideoFrame * frame, GstVideoInfo * info,
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_INTERLACED)) {
frame->flags |= GST_VIDEO_FRAME_FLAG_INTERLACED;
}
} else
} else {
frame->flags |= GST_VIDEO_FRAME_FLAG_INTERLACED;
}
if (GST_BUFFER_FLAG_IS_SET (buffer, GST_VIDEO_BUFFER_FLAG_TFF))
if (GST_VIDEO_INFO_FIELD_ORDER (info) ==
GST_VIDEO_FIELD_ORDER_TOP_FIELD_FIRST) {
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;
} else {
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;