summaryrefslogtreecommitdiff
path: root/gst-libs
diff options
context:
space:
mode:
authorHe Junyan <junyan.he@intel.com>2021-01-01 15:56:03 +0800
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>2021-01-04 13:09:01 +0000
commit459abad096c8f8f877babb1d5d536f3597db92b0 (patch)
tree467f9e461b6bc5c0014d818e3421dbc0e787ae63 /gst-libs
parent339a816c81a197b17ab642766a6721bd61746a80 (diff)
downloadgstreamer-plugins-bad-459abad096c8f8f877babb1d5d536f3597db92b0.tar.gz
codecs: Add buffer_flags for mpeg2 picture.
We need to store the buffer flags such as GST_VIDEO_BUFFER_FLAG_INTERLACED and GST_VIDEO_BUFFER_FLAG_TFF for interlaced video. Without these flags, the VPP and display elements can not apply filter correctly. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1929>
Diffstat (limited to 'gst-libs')
-rw-r--r--gst-libs/gst/codecs/gstmpeg2decoder.c5
-rw-r--r--gst-libs/gst/codecs/gstmpeg2picture.h3
2 files changed, 8 insertions, 0 deletions
diff --git a/gst-libs/gst/codecs/gstmpeg2decoder.c b/gst-libs/gst/codecs/gstmpeg2decoder.c
index aaede9bce..49e88b393 100644
--- a/gst-libs/gst/codecs/gstmpeg2decoder.c
+++ b/gst-libs/gst/codecs/gstmpeg2decoder.c
@@ -814,6 +814,11 @@ gst_mpeg2_decoder_ensure_current_picture (GstMpeg2Decoder * decoder,
gst_mpeg2_picture_unref (picture);
return FALSE;
}
+
+ /* At this moment, this picture should be interlaced */
+ picture->buffer_flags |= GST_VIDEO_BUFFER_FLAG_INTERLACED;
+ if (priv->pic_ext.top_field_first)
+ picture->buffer_flags |= GST_VIDEO_BUFFER_FLAG_TFF;
}
picture->structure = priv->pic_ext.picture_structure;
diff --git a/gst-libs/gst/codecs/gstmpeg2picture.h b/gst-libs/gst/codecs/gstmpeg2picture.h
index 819c7691a..7262c9671 100644
--- a/gst-libs/gst/codecs/gstmpeg2picture.h
+++ b/gst-libs/gst/codecs/gstmpeg2picture.h
@@ -23,6 +23,7 @@
#include <gst/codecs/codecs-prelude.h>
#include <gst/codecparsers/gstmpegvideoparser.h>
+#include <gst/video/video.h>
G_BEGIN_DECLS
@@ -82,6 +83,8 @@ struct _GstMpeg2Picture
/* For interlaced streams */
GstMpeg2Picture *first_field;
+ GstVideoBufferFlags buffer_flags;
+
gint pic_order_cnt;
gint tsn;
GstMpegVideoPictureStructure structure;