From cbca0bb06e5fe9ccd268570bba2ecd4f8e3b71af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Wed, 27 Oct 2021 10:31:04 +0200 Subject: [PATCH] vapostproc: Consider video orientation for border calculation. Part-of: --- subprojects/gst-plugins-bad/sys/va/gstvavpp.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c index 17be688e7f..2c3131ab87 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvavpp.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvavpp.c @@ -422,6 +422,18 @@ gst_va_vpp_set_info (GstVaBaseTransform * btrans, GstCaps * incaps, to_dar_n = to_dar_d = -1; } + /* if video-orientation changes consider it for borders */ + switch (gst_va_filter_get_orientation (btrans->filter)) { + case GST_VIDEO_ORIENTATION_90R: + case GST_VIDEO_ORIENTATION_90L: + case GST_VIDEO_ORIENTATION_UL_LR: + case GST_VIDEO_ORIENTATION_UR_LL: + SWAP (from_dar_n, from_dar_d); + break; + default: + break; + } + self->borders_h = self->borders_w = 0; if (to_dar_n != from_dar_n || to_dar_d != from_dar_d) { if (self->add_borders) {