Fixate caps to display_height/width and remove custom fields

The display_width and display_height fields aren't used anywhere
except in-between v4l2mtkvpudec and v4l2convert. A simple pipeline
file ! decodebin ! sink
without capsfilters will for 1080p input produce 1088p output with
the custom fields set to 1080p. Those fields are ignored everywhere.
Instead fixate caps to this dimension to trigger cropping to pruduce
the expected output.

Change-Id: I8484a856dd90ac6e1758d125a4523d4321476c28
diff --git a/sys/v4l2/gstv4l2transform.c b/sys/v4l2/gstv4l2transform.c
index b899063..0fbedba 100644
--- a/sys/v4l2/gstv4l2transform.c
+++ b/sys/v4l2/gstv4l2transform.c
@@ -419,6 +419,7 @@
 {
   GstStructure *ins, *outs;
   const GValue *from_par, *to_par;
+  gint val;
   GValue fpar = { 0, }, tpar = {
   0,};
 
@@ -431,6 +432,19 @@
   ins = gst_caps_get_structure (caps, 0);
   outs = gst_caps_get_structure (othercaps, 0);
 
+  if (gst_structure_has_field (outs, "display_width")) {
+    gst_structure_get_int (outs, "display_width", &val);
+    gst_structure_fixate_field_nearest_int (outs, "width", val);
+  }
+
+  if (gst_structure_has_field (outs, "display_height")) {
+    gst_structure_get_int (outs, "display_height", &val);
+    gst_structure_fixate_field_nearest_int (outs, "height", val);
+  }
+
+  gst_structure_remove_fields (outs, "display_width", "display_height", NULL);
+
+
   {
     const gchar *in_format;