[ekiga] x-videooutput: close only current display



commit e2583ca1742c21e209ca2c4482c742a2fe84d9a4
Author: VÃctor Manuel JÃquez Leal <vjaquez igalia com>
Date:   Wed Oct 3 16:13:11 2012 +0200

    x-videooutput: close only current display
    
    Added the close_display () method. It will only close the display associated
    with a videooutput mode (remote/local/pip vs remote extended).
    
    This is used when setup_frame_display() we must close only the current
    display, avoiding the flickering when displaying both streams simultaneously.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687775

 .../x-videooutput/videooutput-manager-x.cpp        |   37 +++++++++++++++++++-
 .../x-videooutput/videooutput-manager-x.h          |    2 +
 2 files changed, 38 insertions(+), 1 deletions(-)
---
diff --git a/lib/engine/components/x-videooutput/videooutput-manager-x.cpp b/lib/engine/components/x-videooutput/videooutput-manager-x.cpp
index 234beca..f860504 100644
--- a/lib/engine/components/x-videooutput/videooutput-manager-x.cpp
+++ b/lib/engine/components/x-videooutput/videooutput-manager-x.cpp
@@ -257,7 +257,7 @@ GMVideoOutputManager_x::setup_frame_display ()
     return;
   }
 
-  close_frame_display ();
+  close_display (current_frame.mode);
 
   pip_window_available = false;
 
@@ -458,6 +458,41 @@ GMVideoOutputManager_x::setup_frame_display ()
 }
 
 void
+GMVideoOutputManager_x::close_display (Ekiga::VideoOutputMode mode)
+{
+  Ekiga::Runtime::run_in_main (
+    boost::bind (&GMVideoOutputManager_x::device_closed_in_main, this)
+    );
+
+  if (mode != Ekiga::VO_MODE_REMOTE_EXT) {
+    if (rxWindow)
+      rxWindow->RegisterSlave (NULL);
+    if (lxWindow)
+      lxWindow->RegisterMaster (NULL);
+
+    if (lxWindow) {
+      delete lxWindow;
+      lxWindow = NULL;
+    }
+
+    if (rxWindow) {
+      delete rxWindow;
+      rxWindow = NULL;
+    }
+  }
+
+  if (mode == Ekiga::VO_MODE_LOCAL) {
+    if (exWindow)
+      exWindow->RegisterSlave (NULL);
+
+    if (exWindow) {
+      delete exWindow;
+      exWindow = NULL;
+    }
+  }
+}
+
+void
 GMVideoOutputManager_x::close_frame_display ()
 {
   Ekiga::Runtime::run_in_main (boost::bind (&GMVideoOutputManager_x::device_closed_in_main, this));
diff --git a/lib/engine/components/x-videooutput/videooutput-manager-x.h b/lib/engine/components/x-videooutput/videooutput-manager-x.h
index 1ee956c..1836a37 100644
--- a/lib/engine/components/x-videooutput/videooutput-manager-x.h
+++ b/lib/engine/components/x-videooutput/videooutput-manager-x.h
@@ -125,6 +125,8 @@ private:
                            const struct WinitContinuation &contXV,
                            const struct WinitContinuation &contX,
                            bool pip = false);
+
+  void close_display (Ekiga::VideoOutputMode mode);
 };
 
 /**



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