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.
This commit is contained in:
Víctor Manuel Jáquez Leal 2018-02-20 09:15:05 -06:00
parent 1ca2c78c7a
commit 516d6bb3e2

View file

@ -615,7 +615,7 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
GstBuffer *fieldbuf; GstBuffer *fieldbuf;
GstVaapiDeinterlaceMethod deint_method; GstVaapiDeinterlaceMethod deint_method;
guint flags, deint_flags; guint flags, deint_flags;
gboolean tff, deint, deint_refs, deint_changed; gboolean tff, deint, deint_refs, deint_changed, discont;
const GstVideoCropMeta *crop_meta; const GstVideoCropMeta *crop_meta;
GstVaapiRectangle *crop_rect = NULL; GstVaapiRectangle *crop_rect = NULL;
GstVaapiRectangle tmp_rect; GstVaapiRectangle tmp_rect;
@ -639,6 +639,7 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
timestamp = GST_BUFFER_TIMESTAMP (inbuf); timestamp = GST_BUFFER_TIMESTAMP (inbuf);
tff = GST_BUFFER_FLAG_IS_SET (inbuf, GST_VIDEO_BUFFER_FLAG_TFF); 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); deint = should_deinterlace_buffer (postproc, inbuf);
/* Drop references if deinterlacing conditions changed */ /* 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_TIMESTAMP (fieldbuf) = timestamp;
GST_BUFFER_DURATION (fieldbuf) = postproc->field_duration; 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); ret = gst_pad_push (trans->srcpad, fieldbuf);
if (ret != GST_FLOW_OK) if (ret != GST_FLOW_OK)
goto error_push_buffer; goto error_push_buffer;
@ -771,6 +777,10 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf,
else { else {
GST_BUFFER_TIMESTAMP (outbuf) = timestamp + postproc->field_duration; GST_BUFFER_TIMESTAMP (outbuf) = timestamp + postproc->field_duration;
GST_BUFFER_DURATION (outbuf) = 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) if (deint && deint_refs)