[cheese] Fix being paused when effect valves are closed



commit d35cfcd7890528b9db5d1031e7e338f5f6c5b83a
Author: Hans de Goede <hdegoede redhat com>
Date:   Fri Jun 21 08:44:09 2013 +0200

    Fix being paused when effect valves are closed
    
    The move to autocluttersink in 3.9 causes a regression compared to 3.8,
    where if an effect's control valve is closed the pipeline will never
    transition from paused to playing since the cluttersink is stuck in
    paused.
    
    This regression can be triggered the following way:
    1) Go the effect selector
    2) Go to the next page in the effect selector, so that the now connected
       effects from the first page get their control valve set to closed
    3) Change resolution or device, so that the pipeline gets stopped and
       started again
    
    After 3) the pipeline will be stuck in pause, as the cluttersinks of the
    effect previews are stuck in pause.
    
    The cause for this is that with the move to autocluttersink we are no
    longer setting the sink's "async" property, see commit 424afdaa 'Use
    "autocluttersink" instead of "cluttersink"'.
    
    Setting the "async" property is no longer (easily) doable, since
    autocluttersink is a gstbin derived object which has the actual sink
    embedded.
    
    Instead this patch fixes the stuck in pause problem by locking the
    autocluttersinks of the effect previews into the playing state.
    
    Note that no longer setting of the async property on the sink is also
    the root cause of the issue fixed by my patch titled: "Set all valves
    open on play". The opening of the main valve is still necessary, since
    locking the viewfinder sink's state to PLAYING does not seem a good
    idea, the opening of the effects-valve on play OTOH is no longer
    necessary.
    
    Signed-off-by: Hans de Goede <hdegoede redhat com>

 libcheese/cheese-camera.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libcheese/cheese-camera.c b/libcheese/cheese-camera.c
index a103ba3..dbad241 100644
--- a/libcheese/cheese-camera.c
+++ b/libcheese/cheese-camera.c
@@ -534,6 +534,7 @@ cheese_camera_create_effects_preview_bin (CheeseCamera *camera, GError **error)
     cheese_camera_set_error_element_not_found (error, "effects_valve");
     return FALSE;
   }
+  g_object_set (G_OBJECT (priv->effects_valve), "drop", TRUE, NULL);
   if ((scale = gst_element_factory_make ("videoscale", "effects_scale")) == NULL)
   {
     cheese_camera_set_error_element_not_found (error, "videoscale");
@@ -790,7 +791,6 @@ cheese_camera_play (CheeseCamera *camera)
   cheese_camera_set_new_caps (camera);
   g_object_set (priv->camera_source, "video-source", priv->video_source, NULL);
   g_object_set (priv->main_valve, "drop", FALSE, NULL);
-  g_object_set (priv->effects_valve, "drop", FALSE, NULL);
   gst_element_set_state (priv->camerabin, GST_STATE_PLAYING);
   priv->pipeline_is_playing = TRUE;
 }
@@ -1029,6 +1029,7 @@ cheese_camera_connect_effect_texture (CheeseCamera *camera, CheeseEffect *effect
   gst_element_set_state (effect_filter, GST_STATE_PLAYING);
   gst_element_set_state (display_queue, GST_STATE_PLAYING);
   gst_element_set_state (display_element, GST_STATE_PLAYING);
+  gst_element_set_locked_state (display_element, TRUE);
 
   if (!ok)
       g_warning ("Could not create effects pipeline");


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