[cheese/wip/hans-fixes-master: 1/16] Add a capsfilter to the video-source bin



commit ef21f49b0740befc2c06ee8a66cba4010af42185
Author: Hans de Goede <hdegoede redhat com>
Date:   Mon Jun 10 19:48:47 2013 +0200

    Add a capsfilter to the video-source bin
    
    This serves 2 purposes. Firstly, it forces GStreamer to actually run the
    video source at the configured resolution, rather then say run it at
    1600x1200 @ 5 fps and downscale that to 800x600 (still at 5 fps), as
    GStreamer opts to do with my Logitech Webcam Pro 9000, when left to its
    own auto negotiate code. Secondly, by greatly reducing the amount of
    advertised caps (this cam supports lots of different resolutions at many
    different framerates per resolution), it avoids a caps intersect
    "explosion", reducing the pipeline caps negotiation.
    
    Signed-off-by: Hans de Goede <hdegoede redhat com>

 libcheese/cheese-camera.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index 4759a20..1caadfb 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -417,7 +417,7 @@ cheese_camera_set_camera_source (CheeseCamera *camera)
   }
 
   camera_input = g_strdup_printf (
-    "%s name=video_source device=%s",
+    "%s name=video_source device=%s ! capsfilter name=video_source_filter",
     cheese_camera_device_get_src (selected_camera),
     cheese_camera_device_get_device_node (selected_camera));
 
@@ -762,7 +762,9 @@ cheese_camera_set_new_caps (CheeseCamera *camera)
 
   if (!gst_caps_is_empty (caps))
   {
-    GST_INFO_OBJECT (camera, "SETTING caps%" GST_PTR_FORMAT, caps);
+    GST_INFO_OBJECT (camera, "SETTING caps %" GST_PTR_FORMAT, caps);
+    g_object_set (gst_bin_get_by_name (GST_BIN (priv->video_source),
+                  "video_source_filter"), "caps", caps, NULL);
     g_object_set (priv->camerabin, "viewfinder-caps", caps, NULL);
   }
   gst_caps_unref (caps);


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