mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 00:31:13 +00:00
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:
parent
fcf5e389ce
commit
f9de2f499b
1 changed files with 11 additions and 11 deletions
|
@ -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 */
|
||||
|
|
Loading…
Reference in a new issue