[cheese/wip/hans-fixes-master: 11/16] Only add videoconvert elements where necessary



commit da9ad5556ec3cbd4429c16f11393b8950c178038
Author: Hans de Goede <hdegoede redhat com>
Date:   Tue Jun 11 09:05:51 2013 +0200

    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>

 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 2ba35aa..9ec9b42 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);
 }


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