[ekiga] Fixed possible threading issues in the common video output code



commit d03bbdc6bb4c0d836c4c67d126f75f2bbb1aa84d
Author: Julien Puydt <jpuydt noether localdomain>
Date:   Tue Apr 21 17:55:44 2009 +0200

    Fixed possible threading issues in the common video output code
    
    don't use make_slot in threads
---
 .../videooutput-manager-common.cpp                 |   20 ++++++++++++++++++--
 .../videooutput-manager-common.h                   |   10 ++++++++++
 2 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/lib/engine/components/common-videooutput/videooutput-manager-common.cpp b/lib/engine/components/common-videooutput/videooutput-manager-common.cpp
index 5ea7717..31dd3f2 100644
--- a/lib/engine/components/common-videooutput/videooutput-manager-common.cpp
+++ b/lib/engine/components/common-videooutput/videooutput-manager-common.cpp
@@ -250,8 +250,8 @@ void GMVideoOutputManager::uninit ()
 void GMVideoOutputManager::update_gui_device ()
 {
   last_frame.both_streams_active = current_frame.both_streams_active;
-  Ekiga::Runtime::run_in_main (device_closed.make_slot ());
-  Ekiga::Runtime::run_in_main (sigc::bind (device_opened.make_slot (), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
+  Ekiga::Runtime::run_in_main (sigc::mem_fun (this, &GMVideoOutputManager::device_closed_in_main));
+  Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &GMVideoOutputManager::device_opened_in_main), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
 
 }
 
@@ -341,3 +341,19 @@ GMVideoOutputManager::redraw ()
 
   return sync_required;
 }
+
+
+void
+GMVideoOutputManager::device_opened_in_main (Ekiga::VideoOutputAccel accel,
+					     Ekiga::VideoOutputMode mode,
+					     unsigned zoom,
+					     bool both)
+{
+  device_opened.emit (accel, mode, zoom, both);
+}
+
+void
+GMVideoOutputManager::device_closed_in_main ()
+{
+  device_closed.emit ();
+}
diff --git a/lib/engine/components/common-videooutput/videooutput-manager-common.h b/lib/engine/components/common-videooutput/videooutput-manager-common.h
index 106c277..fc0e430 100644
--- a/lib/engine/components/common-videooutput/videooutput-manager-common.h
+++ b/lib/engine/components/common-videooutput/videooutput-manager-common.h
@@ -257,6 +257,16 @@
                               from various threads */
   
     Ekiga::ServiceCore & core;
+
+  private:
+
+    void device_opened_in_main (Ekiga::VideoOutputAccel accel,
+				Ekiga::VideoOutputMode mode,
+				unsigned zoom,
+				bool both);
+
+    void device_closed_in_main ();
+
   };
 
 /**



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