cheese r388 - in trunk: . src



Author: jhaitsma
Date: Sat Jan 12 20:21:41 2008
New Revision: 388
URL: http://svn.gnome.org/viewvc/cheese?rev=388&view=rev

Log:
v4lsrc does not have a queue-size property. Only set queue-size when we have a v4l2src. Probably fixes #508912


Modified:
   trunk/ChangeLog
   trunk/src/cheese-webcam.c

Modified: trunk/src/cheese-webcam.c
==============================================================================
--- trunk/src/cheese-webcam.c	(original)
+++ trunk/src/cheese-webcam.c	Sat Jan 12 20:21:41 2008
@@ -478,9 +478,19 @@
   i = 0;
   while (!pipeline_works && (i < G_N_ELEMENTS (GSTREAMER_VIDEO_SOURCES)))
   {
-    pipeline_desc = g_strdup_printf ("%s name=source device=%s queue-size=2 ! fakesink", 
-                                     GSTREAMER_VIDEO_SOURCES[i],
-                                     webcam_device->video_device);
+    /* NOTE queue-size=2 can be removed as soon as gst-plugins-good 0.10.7 comes out */
+    if (strcmp (GSTREAMER_VIDEO_SOURCES[i], "v4l2src") == 0)
+    {
+      pipeline_desc = g_strdup_printf ("%s name=source device=%s queue-size=2 ! fakesink", 
+                                       GSTREAMER_VIDEO_SOURCES[i],
+                                       webcam_device->video_device);
+    }
+    else
+    {
+      pipeline_desc = g_strdup_printf ("%s name=source device=%s ! fakesink", 
+                                       GSTREAMER_VIDEO_SOURCES[i],
+                                       webcam_device->video_device);
+    }
     err = NULL;
     pipeline = gst_parse_launch (pipeline_desc, &err);
     if ((pipeline != NULL) && (err == NULL))
@@ -610,14 +620,29 @@
       }
     }
 
-    webcam_input = g_strdup_printf ("%s name=video_source device=%s queue-size=2 ! %s,width=%d,height=%d,framerate=%d/%d ! identity",
-                                    selected_webcam->gstreamer_src,
-                                    selected_webcam->video_device,
-                                    format->mimetype,
-                                    format->width,
-                                    format->height,
-                                    framerate_numerator,
-                                    framerate_denominator);
+    /* NOTE queue-size=2 can be removed as soon as gst-plugins-good 0.10.7 comes out */
+    if (strcmp (selected_webcam->gstreamer_src, "v4l2src") == 0)
+    {
+      webcam_input = g_strdup_printf ("%s name=video_source device=%s queue-size=2 ! %s,width=%d,height=%d,framerate=%d/%d ! identity",
+                                      selected_webcam->gstreamer_src,
+                                      selected_webcam->video_device,
+                                      format->mimetype,
+                                      format->width,
+                                      format->height,
+                                      framerate_numerator,
+                                      framerate_denominator);
+    }
+    else
+    {
+      webcam_input = g_strdup_printf ("%s name=video_source device=%s ! %s,width=%d,height=%d,framerate=%d/%d ! identity",
+                                      selected_webcam->gstreamer_src,
+                                      selected_webcam->video_device,
+                                      format->mimetype,
+                                      format->width,
+                                      format->height,
+                                      framerate_numerator,
+                                      framerate_denominator);
+    }
     g_print ("%s\n", webcam_input);
 
     priv->webcam_source_bin = gst_parse_bin_from_description (webcam_input,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]