e9fed67
From 90d318aadb255be77c7e27764716df6cd5a1fe0e Mon Sep 17 00:00:00 2001
e9fed67
From: Hans de Goede <hdegoede@redhat.com>
e9fed67
Date: Fri, 8 Jun 2012 23:18:32 +0200
e9fed67
Subject: [PATCH] cheese-camera: Don't overwrite camerabin's default flags
e9fed67
e9fed67
The comment above this code said: "Set flags to enable conversions", but
e9fed67
camerabin has conversion enabled in the necessary places by default, all
e9fed67
the code does is add an extra, unneeded ffmpegcsp element at the beginning
e9fed67
of the pipeline.
e9fed67
e9fed67
This results in a huge number of reported caps on pads further down the
e9fed67
pipeline, which when intersected with input caps of later ffmpegcsp elements
e9fed67
leads to an explosion of possible combinations and gst_caps_intersect_full
e9fed67
starts consuming the cpu for 100% for seconds (various Fedora users have
e9fed67
reported startup delays of upto a minute).
e9fed67
e9fed67
On my test system, with a Logitech webcam 9000 pro, the time to create
e9fed67
the camerabin pipeline (not start, not configure, just create!) drops
e9fed67
from 7 seconds to 0.7 seconds by elimenating the unnecessary ffmpegcsp
e9fed67
element at the beginning of the pipe.
e9fed67
e9fed67
The only reason the ffmpegcsp element this patch removes could be useful
e9fed67
would be for cameras producing only jpeg data, but since cheese always uses
e9fed67
v4l2src, and that should always be compiled with libv4l2 support (otherwise
e9fed67
a lot of camera specific video formats will not be understood), libv4l2 will
e9fed67
take care of jpeg decompression, so there really is no reason for having
e9fed67
this extra element, and thus no reason to override the default camerabin
e9fed67
flags.
e9fed67
e9fed67
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
e9fed67
---
e9fed67
 libcheese/cheese-camera.c |   12 ------------
e9fed67
 1 file changed, 12 deletions(-)
e9fed67
e9fed67
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
e9fed67
index 7b8eb70..73cda1a 100644
e9fed67
--- a/libcheese/cheese-camera.c
e9fed67
+++ b/libcheese/cheese-camera.c
e9fed67
@@ -1494,19 +1494,7 @@ cheese_camera_setup (CheeseCamera *camera, const gchar *uuid, GError **error)
e9fed67
   g_object_set (G_OBJECT (video_sink), "async", FALSE, NULL);
e9fed67
   g_object_set (G_OBJECT (priv->camerabin), "viewfinder-sink", video_sink, NULL);
e9fed67
 
e9fed67
-  /* Set flags to enable conversions*/
e9fed67
-
e9fed67
-  g_object_set (G_OBJECT (priv->camerabin), "flags",
e9fed67
-                GST_CAMERABIN_FLAG_SOURCE_RESIZE |
e9fed67
-                GST_CAMERABIN_FLAG_SOURCE_COLOR_CONVERSION |
e9fed67
-                GST_CAMERABIN_FLAG_VIEWFINDER_SCALE |
e9fed67
-                GST_CAMERABIN_FLAG_AUDIO_CONVERSION |
e9fed67
-                GST_CAMERABIN_FLAG_IMAGE_COLOR_CONVERSION |
e9fed67
-                GST_CAMERABIN_FLAG_VIDEO_COLOR_CONVERSION,
e9fed67
-                NULL);
e9fed67
-
e9fed67
   /* Set caps to filter, so it doesn't defaults to I420 format*/
e9fed67
-
e9fed67
   caps = gst_caps_from_string ("video/x-raw-yuv; video/x-raw-rgb");
e9fed67
   g_object_set (G_OBJECT (priv->camerabin), "filter-caps", caps, NULL);
e9fed67
   gst_caps_unref (caps);
e9fed67
-- 
e9fed67
1.7.10.2
e9fed67