vapostproc: Consider video orientation for border calculation.
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Wed, 27 Oct 2021 08:31:04 +0000 (10:31 +0200)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 27 Oct 2021 18:01:50 +0000 (18:01 +0000)
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1261>

subprojects/gst-plugins-bad/sys/va/gstvavpp.c

index 17be688e7f6f7e8c39eb814f26eab50b26ff9f56..2c3131ab87545d6a098ec67070c07114102f5d5d 100644 (file)
@@ -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) {