diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-06-10 19:48:47 +0200 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2013-06-16 21:55:30 +0100 |
commit | ef21f49b0740befc2c06ee8a66cba4010af42185 (patch) | |
tree | 849f488d10a623c40450764afdef5fefb539dc45 /libcheese | |
parent | 67fe6e91ff3fd7acaaf03d24a46c157eab2719f2 (diff) |
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>
Diffstat (limited to 'libcheese')
-rw-r--r-- | 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); |