|
|
ecdf9b |
From 8e50910e9604c5d719397dd3f6a5fccc463eaa35 Mon Sep 17 00:00:00 2001
|
|
|
ecdf9b |
From: Hans de Goede <hdegoede@redhat.com>
|
|
|
ecdf9b |
Date: Tue, 11 Jun 2013 09:05:51 +0200
|
|
|
ecdf9b |
Subject: [PATCH 17/35] cheese-camera: Do not add videoconvert elements around
|
|
|
ecdf9b |
the "no effect" effect
|
|
|
ecdf9b |
|
|
|
ecdf9b |
The "no effect" effect is our default value, and thus worth optimizing a bit
|
|
|
ecdf9b |
for. Clearly in the "no effect" effect case adding a videoconvert element both
|
|
|
ecdf9b |
before and after the element is not needed.
|
|
|
ecdf9b |
|
|
|
ecdf9b |
Note we also don't add the videoconvert elements when creating the initial
|
|
|
ecdf9b |
pipeline, so this also keeps the way the pipeline looks initially and when
|
|
|
ecdf9b |
"no-effect" is selected consistent.
|
|
|
ecdf9b |
|
|
|
ecdf9b |
When starting cheese with "no-effect" selected, this shaves of another 130ms
|
|
|
ecdf9b |
of the initial pipeline creation time, for a total improvement for this patch
|
|
|
ecdf9b |
set from aprox 1.1 sec to aprox 220 ms.
|
|
|
ecdf9b |
|
|
|
ecdf9b |
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
|
|
|
ecdf9b |
---
|
|
|
ecdf9b |
libcheese/cheese-camera.c | 10 +++++++++-
|
|
|
ecdf9b |
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
ecdf9b |
|
|
|
ecdf9b |
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
|
|
|
ecdf9b |
index eafc381..7b7fac5 100644
|
|
|
ecdf9b |
--- a/libcheese/cheese-camera.c
|
|
|
ecdf9b |
+++ b/libcheese/cheese-camera.c
|
|
|
ecdf9b |
@@ -888,12 +888,20 @@ void
|
|
|
ecdf9b |
cheese_camera_set_effect (CheeseCamera *camera, CheeseEffect *effect)
|
|
|
ecdf9b |
{
|
|
|
ecdf9b |
GstElement *effect_filter;
|
|
|
ecdf9b |
+ gchar *effect_desc;
|
|
|
ecdf9b |
|
|
|
ecdf9b |
g_return_if_fail (CHEESE_IS_CAMERA (camera));
|
|
|
ecdf9b |
|
|
|
ecdf9b |
- effect_filter = cheese_camera_element_from_effect (camera, effect);
|
|
|
ecdf9b |
+ g_object_get (G_OBJECT (effect), "pipeline-desc", &effect_desc, NULL);
|
|
|
ecdf9b |
+
|
|
|
ecdf9b |
+ if (strcmp(effect_desc, "identity") == 0)
|
|
|
ecdf9b |
+ effect_filter = gst_element_factory_make ("identity", "effect");
|
|
|
ecdf9b |
+ else
|
|
|
ecdf9b |
+ effect_filter = cheese_camera_element_from_effect (camera, effect);
|
|
|
ecdf9b |
if (effect_filter != NULL)
|
|
|
ecdf9b |
cheese_camera_change_effect_filter (camera, effect_filter);
|
|
|
ecdf9b |
+
|
|
|
ecdf9b |
+ g_free (effect_desc);
|
|
|
ecdf9b |
}
|
|
|
ecdf9b |
|
|
|
ecdf9b |
/**
|
|
|
ecdf9b |
--
|
|
|
ecdf9b |
1.8.2.1
|
|
|
ecdf9b |
|