mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
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:
parent
f65145371b
commit
8478aa7aed
1 changed files with 12 additions and 6 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue