v4l2camerasrc: add video-src property
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Tue, 14 Dec 2010 17:43:59 +0000 (14:43 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Thu, 23 Dec 2010 16:20:35 +0000 (13:20 -0300)
Adds a property to select the src element to be used internally
on v4l2camerasrc. Yeah, I know, this element should have a better
name.

gst/camerabin2/gstv4l2camerasrc.c

index 5ea070b..566ce4d 100644 (file)
@@ -102,7 +102,8 @@ gst_v4l2_camera_src_set_property (GObject * object,
         if (self->app_vid_src)
           gst_object_unref (self->app_vid_src);
         self->app_vid_src = g_value_get_object (value);
-        gst_object_ref (self->app_vid_src);
+        if (self->app_vid_src)
+          gst_object_ref (self->app_vid_src);
       }
       break;
     default:
@@ -1031,6 +1032,10 @@ gst_v4l2_camera_src_class_init (GstV4l2CameraSrcClass * klass)
   gobject_class->get_property = gst_v4l2_camera_src_get_property;
 
   /* g_object_class_install_property .... */
+  g_object_class_install_property (gobject_class, PROP_VIDEO_SRC,
+      g_param_spec_object ("video-src", "Video source",
+          "The video source element to be used",
+          GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
   gstbasecamerasrc_class->construct_pipeline =
       gst_v4l2_camera_src_construct_pipeline;