v4l2: rely on gst_v4l2_dup() to set no_initial_format and keep_aspect
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Fri, 13 Apr 2018 11:29:06 +0000 (13:29 +0200)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 26 Apr 2018 19:36:16 +0000 (15:36 -0400)
gst_v4l2_dup() will now take care of setting
v4l2capture->no_initial_format and keep_aspect instead of doing it
manually.

Fix a typo as keep_aspect was set twice on v4l2output but never on
v4l2capture.

https://bugzilla.gnome.org/show_bug.cgi?id=795028

sys/v4l2/gstv4l2transform.c
sys/v4l2/gstv4l2videodec.c
sys/v4l2/gstv4l2videoenc.c
sys/v4l2/v4l2_calls.c

index 33052a8..2f01375 100644 (file)
@@ -1079,8 +1079,6 @@ gst_v4l2_transform_subinstance_init (GTypeInstance * instance, gpointer g_class)
       GST_OBJECT (GST_BASE_TRANSFORM_SRC_PAD (self)),
       V4L2_BUF_TYPE_VIDEO_CAPTURE, klass->default_device,
       gst_v4l2_get_input, gst_v4l2_set_input, NULL);
-  self->v4l2capture->no_initial_format = TRUE;
-  self->v4l2output->keep_aspect = FALSE;
 }
 
 static void
index dc06774..09369cc 100644 (file)
@@ -956,8 +956,6 @@ gst_v4l2_video_dec_subinstance_init (GTypeInstance * instance, gpointer g_class)
       GST_OBJECT (GST_VIDEO_DECODER_SRC_PAD (self)),
       V4L2_BUF_TYPE_VIDEO_CAPTURE, klass->default_device,
       gst_v4l2_get_input, gst_v4l2_set_input, NULL);
-  self->v4l2capture->no_initial_format = TRUE;
-  self->v4l2output->keep_aspect = FALSE;
 }
 
 static void
index d365a25..4269b28 100644 (file)
@@ -1042,8 +1042,6 @@ gst_v4l2_video_enc_subinstance_init (GTypeInstance * instance, gpointer g_class)
       GST_OBJECT (GST_VIDEO_ENCODER_SRC_PAD (self)),
       V4L2_BUF_TYPE_VIDEO_CAPTURE, klass->default_device,
       gst_v4l2_get_input, gst_v4l2_set_input, NULL);
-  self->v4l2capture->no_initial_format = TRUE;
-  self->v4l2output->keep_aspect = FALSE;
 }
 
 static void
index 12fc821..6303b17 100644 (file)
@@ -695,6 +695,7 @@ gst_v4l2_dup (GstV4l2Object * v4l2object, GstV4l2Object * other)
       v4l2object->vcap.card, v4l2object->videodev);
 
   v4l2object->never_interlaced = other->never_interlaced;
+  v4l2object->no_initial_format = other->no_initial_format;
 
   return TRUE;