|
|
ecdf9b |
From a602ffdd541b828ab9b8aac9b20db31ce427ba8b Mon Sep 17 00:00:00 2001
|
|
|
ecdf9b |
From: Hans de Goede <hdegoede@redhat.com>
|
|
|
ecdf9b |
Date: Mon, 10 Jun 2013 19:48:47 +0200
|
|
|
ecdf9b |
Subject: [PATCH 01/35] cheese-camera: Add a capsfilter to our video-source bin
|
|
|
ecdf9b |
|
|
|
ecdf9b |
This serves 2 purposes:
|
|
|
ecdf9b |
1) It forces gstreamer to actually run the video source at the configured
|
|
|
ecdf9b |
resolution, rather then say run it at 1600x1200 @ 5 fps and downscale
|
|
|
ecdf9b |
that to 800x600 (still at 5 fps), as gstreamer opts to do with my
|
|
|
ecdf9b |
Logitech Webcam Pro 9000, when left to its own auto negotiate code.
|
|
|
ecdf9b |
2) By greatly reducing the amount of advertised caps (this cam supports lots
|
|
|
ecdf9b |
of different resolutions at many different framerates per resolution), it
|
|
|
ecdf9b |
avoids a caps intersect "explosion", reducing the pipeline caps negotiation
|
|
|
ecdf9b |
on my core i5 @ 3.1Ghz from aprox 1.1 sec to aprox 350 ms (*).
|
|
|
ecdf9b |
|
|
|
ecdf9b |
*) When combined with later patches in this patchset which also limit the
|
|
|
ecdf9b |
framerates in the filtered caps.
|
|
|
ecdf9b |
|
|
|
ecdf9b |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
ecdf9b |
---
|
|
|
ecdf9b |
libcheese/cheese-camera.c | 5 +++--
|
|
|
ecdf9b |
1 file changed, 3 insertions(+), 2 deletions(-)
|
|
|
ecdf9b |
|
|
|
ecdf9b |
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
|
|
|
ecdf9b |
index a78affd..c42d896 100644
|
|
|
ecdf9b |
--- a/libcheese/cheese-camera.c
|
|
|
ecdf9b |
+++ b/libcheese/cheese-camera.c
|
|
|
ecdf9b |
@@ -417,7 +417,7 @@ cheese_camera_set_camera_source (CheeseCamera *camera)
|
|
|
ecdf9b |
}
|
|
|
ecdf9b |
|
|
|
ecdf9b |
camera_input = g_strdup_printf (
|
|
|
ecdf9b |
- "%s name=video_source device=%s",
|
|
|
ecdf9b |
+ "%s name=video_source device=%s ! capsfilter name=video_source_filter",
|
|
|
ecdf9b |
cheese_camera_device_get_src (selected_camera),
|
|
|
ecdf9b |
cheese_camera_device_get_device_node (selected_camera));
|
|
|
ecdf9b |
|
|
|
ecdf9b |
@@ -762,7 +762,8 @@ cheese_camera_set_new_caps (CheeseCamera *camera)
|
|
|
ecdf9b |
|
|
|
ecdf9b |
if (!gst_caps_is_empty (caps))
|
|
|
ecdf9b |
{
|
|
|
ecdf9b |
- GST_INFO_OBJECT (camera, "SETTING caps%" GST_PTR_FORMAT, caps);
|
|
|
ecdf9b |
+ GST_INFO_OBJECT (camera, "SETTING caps %" GST_PTR_FORMAT, caps);
|
|
|
ecdf9b |
+ g_object_set (gst_bin_get_by_name (GST_BIN (priv->video_source), "video_source_filter"), "caps", caps, NULL);
|
|
|
ecdf9b |
g_object_set (priv->camerabin, "viewfinder-caps", caps, NULL);
|
|
|
ecdf9b |
}
|
|
|
ecdf9b |
gst_caps_unref (caps);
|
|
|
ecdf9b |
--
|
|
|
ecdf9b |
1.8.2.1
|
|
|
ecdf9b |
|