Fix v4l2 video decoder format error

MTK decoder MT21 format should not be removed from the v4l2mtkvpudec src
caps, as it won't be set via downstream negotiation, causing error in
checking the chosen decoded caps.

Bug: 174572458
Change-Id: I9759d4697aeefb50f1381805b55dfb2c3e308aba
diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c
index 847c080..0374b40 100644
--- a/sys/v4l2/gstv4l2videodec.c
+++ b/sys/v4l2/gstv4l2videodec.c
@@ -828,13 +828,15 @@
     if (!gst_v4l2_object_acquire_format (self->v4l2capture, &info))
       goto not_negotiated;
 
-    /* Create caps from the acquired format, remove the format field */
+    /* Create caps from the acquired format */
     acquired_caps = gst_video_info_to_caps (&info);
-    if (self->v4l2capture->format.fmt.pix.pixelformat == V4L2_PIX_FMT_MT21) {
     GST_DEBUG_OBJECT (self, "Acquired caps: %" GST_PTR_FORMAT, acquired_caps);
     st = gst_caps_get_structure (acquired_caps, 0);
-    gst_structure_remove_field (st, "format");
-	}
+    if (self->v4l2capture->format.fmt.pix.pixelformat != V4L2_PIX_FMT_MT21) {
+      /* Remove the format field from the original gstreamer 1.14 implementation */
+      GST_DEBUG_OBJECT (self, "Remove the format field");
+      gst_structure_remove_field (st, "format");
+    }
 
     /* Probe currently available pixel formats */
     available_caps = gst_v4l2_object_probe_caps (self->v4l2capture, NULL);