[cheese] Do not overwrite camerabin's default flags



commit 03fe3c79311d1e3b8cb62a92ba04ce7728b8032b
Author: Hans de Goede <hdegoede redhat com>
Date:   Fri Jun 8 23:18:32 2012 +0200

    Do not overwrite camerabin's default flags
    
    The comment above this code said: "Set flags to enable conversions", but
    camerabin has conversion enabled in the necessary places by default, all
    the code does is add an extra, unneeded ffmpegcsp element at the
    beginning of the pipeline.
    
    This results in a huge number of reported caps on pads further down the
    pipeline, which when intersected with input caps of later ffmpegcsp
    elements leads to an explosion of possible combinations and
    gst_caps_intersect_full starts consuming the CPU for 100% for seconds
    (various Fedora users have reported startup delays of upto a minute).
    
    On my test system, with a Logitech Webcam 9000 Pro, the time to create
    the camerabin pipeline (not start, not configure, just create!) drops
    from 7 seconds to 0.7 seconds by elimenating the unnecessary ffmpegcsp
    element at the beginning of the pipe.
    
    The only reason the ffmpegcsp element this patch removes could be useful
    would be for cameras producing only JPEG data, but since Cheese always
    uses v4l2src, and that should always be compiled with libv4l2 support
    (otherwise a lot of camera specific video formats will not be
    understood), libv4l2 will take care of JPEG decompression, so there
    really is no reason for having this extra element, and thus no reason to
    override the default camerabin flags.
    
    Fixes bug 677731.
    
    Signed-off-by: Hans de Goede <hdegoede redhat com>

 libcheese/cheese-camera.c |   12 ------------
 1 files changed, 0 insertions(+), 12 deletions(-)
---
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index aae8624..d2384ad 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -1530,19 +1530,7 @@ cheese_camera_setup (CheeseCamera *camera, const gchar *uuid, GError **error)
   g_object_set (G_OBJECT (video_sink), "async", FALSE, NULL);
   g_object_set (G_OBJECT (priv->camerabin), "viewfinder-sink", video_sink, NULL);
 
-  /* Set flags to enable conversions*/
-
-  g_object_set (G_OBJECT (priv->camerabin), "flags",
-                GST_CAMERABIN_FLAG_SOURCE_RESIZE |
-                GST_CAMERABIN_FLAG_SOURCE_COLOR_CONVERSION |
-                GST_CAMERABIN_FLAG_VIEWFINDER_SCALE |
-                GST_CAMERABIN_FLAG_AUDIO_CONVERSION |
-                GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION |
-                GST_CAMERABIN_FLAG_VIDEO_COLOR_CONVERSION,
-                NULL);
-
   /* Set caps to filter, so it doesn't defaults to I420 format*/
-
   caps = gst_caps_from_string ("video/x-raw-yuv; video/x-raw-rgb");
   g_object_set (G_OBJECT (priv->camerabin), "filter-caps", caps, NULL);
   gst_caps_unref (caps);



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