diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-06-11 09:05:51 +0200 |
---|---|---|
committer | David King <amigadave@amigadave.com> | 2013-06-16 21:56:26 +0100 |
commit | da9ad5556ec3cbd4429c16f11393b8950c178038 (patch) | |
tree | 755b281f98b260b78286c9956d0f926cce343640 | |
parent | 8223201568583c55d6e7aa089295f5d1c70a92ee (diff) | |
download | cheese-da9ad5556ec3cbd4429c16f11393b8950c178038.tar.gz |
Only add videoconvert elements where necessary
The "no effect" effect is our default value, and thus worth optimizing a
bit. Clearly in the "no effect" effect case adding a videoconvert
element both before and after the element is not needed.
Note we also don't add the videoconvert elements when creating the
initial pipeline, so this also keeps the way the pipeline looks
initially and when "no-effect" is selected consistent.
When starting Cheese with "no-effect" selected, this shaves off another
130 ms of the initial pipeline creation time.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r-- | libcheese/cheese-camera.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c index 2ba35aad..9ec9b429 100644 --- a/libcheese/cheese-camera.c +++ b/libcheese/cheese-camera.c @@ -892,7 +892,10 @@ cheese_camera_set_effect (CheeseCamera *camera, CheeseEffect *effect) g_return_if_fail (CHEESE_IS_CAMERA (camera)); - effect_filter = cheese_camera_element_from_effect (camera, effect); + if (strcmp (cheese_effect_get_pipeline_desc (effect), "identity") == 0) + effect_filter = gst_element_factory_make ("identity", "effect"); + else + effect_filter = cheese_camera_element_from_effect (camera, effect); if (effect_filter != NULL) cheese_camera_change_effect_filter (camera, effect_filter); } |