From 516d6bb3e2ceb8d1f308fbffbc2e697370b97ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Tue, 20 Feb 2018 09:15:05 -0600 Subject: [PATCH] vaapipostproc: set discont flag at vpp deinterlacing When deinterlacing with VPP the discont flag was not forwarded to the new created buffer. This patch sets the discont flag if input buffer has it. --- gst/vaapi/gstvaapipostproc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index e0f6aebb25..29c8406b4d 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -615,7 +615,7 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf, GstBuffer *fieldbuf; GstVaapiDeinterlaceMethod deint_method; guint flags, deint_flags; - gboolean tff, deint, deint_refs, deint_changed; + gboolean tff, deint, deint_refs, deint_changed, discont; const GstVideoCropMeta *crop_meta; GstVaapiRectangle *crop_rect = NULL; GstVaapiRectangle tmp_rect; @@ -639,6 +639,7 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf, timestamp = GST_BUFFER_TIMESTAMP (inbuf); tff = GST_BUFFER_FLAG_IS_SET (inbuf, GST_VIDEO_BUFFER_FLAG_TFF); + discont = GST_BUFFER_FLAG_IS_SET (inbuf, GST_BUFFER_FLAG_DISCONT); deint = should_deinterlace_buffer (postproc, inbuf); /* Drop references if deinterlacing conditions changed */ @@ -721,6 +722,11 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf, GST_BUFFER_TIMESTAMP (fieldbuf) = timestamp; GST_BUFFER_DURATION (fieldbuf) = postproc->field_duration; + if (discont) { + GST_BUFFER_FLAG_SET (fieldbuf, GST_BUFFER_FLAG_DISCONT); + discont = FALSE; + } + ret = gst_pad_push (trans->srcpad, fieldbuf); if (ret != GST_FLOW_OK) goto error_push_buffer; @@ -771,6 +777,10 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf, else { GST_BUFFER_TIMESTAMP (outbuf) = timestamp + postproc->field_duration; GST_BUFFER_DURATION (outbuf) = postproc->field_duration; + if (discont) { + GST_BUFFER_FLAG_SET (fieldbuf, GST_BUFFER_FLAG_DISCONT); + discont = FALSE; + } } if (deint && deint_refs)