basecamerasrc: Make construct_pipeline optional
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>
Thu, 9 Dec 2010 17:13:13 +0000 (14:13 -0300)
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>
Thu, 23 Dec 2010 16:18:56 +0000 (13:18 -0300)
Construct pipeline should be optional. Subclasses that don't
have internal elements don't need it.

gst/camerabin2/gstbasecamerasrc.c

index 07487d8f5c980e2db11220a163a1c4005ee7bc2c..f0d4e009c6b3727899ec23fee87e1e873293be2b 100644 (file)
@@ -390,11 +390,11 @@ construct_pipeline (GstBaseCameraSrc * self)
 {
   GstBaseCameraSrcClass *bclass = GST_BASE_CAMERA_SRC_GET_CLASS (self);
 
-  g_return_val_if_fail (bclass->construct_pipeline, FALSE);
-
-  if (!bclass->construct_pipeline (self)) {
-    GST_ERROR_OBJECT (self, "pipeline construction failed");
-    return FALSE;
+  if (bclass->construct_pipeline) {
+    if (!bclass->construct_pipeline (self)) {
+      GST_ERROR_OBJECT (self, "pipeline construction failed");
+      return FALSE;
+    }
   }
 
   return TRUE;