[ekiga/gnome-2-26] Fixed possible threading issues in the moving logo video input



commit eebe1269d24f13508346f734f1c1c3eae291854a
Author: Julien Puydt <jpuydt noether localdomain>
Date:   Tue Apr 21 18:01:58 2009 +0200

    Fixed possible threading issues in the moving logo video input
    
    don't use make_slot in threads
---
 .../mlogo-videoinput/videoinput-manager-mlogo.cpp  |   17 +++++++++++++++--
 .../mlogo-videoinput/videoinput-manager-mlogo.h    |    6 ++++++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.cpp b/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.cpp
index 50282a4..beb0c69 100644
--- a/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.cpp
+++ b/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.cpp
@@ -106,7 +106,7 @@ bool GMVideoInputManager_mlogo::open (unsigned width, unsigned height, unsigned
   settings.colour = 127;
   settings.contrast = 127;
   settings.modifyable = false;
-  Ekiga::Runtime::run_in_main (sigc::bind (device_opened.make_slot (), current_state.device, settings));
+  Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &GMVideoInputManager_mlogo::device_opened_in_main), current_state.device, settings));
   
   return true;
 }
@@ -116,7 +116,7 @@ void GMVideoInputManager_mlogo::close()
   PTRACE(4, "GMVideoInputManager_mlogo\tClosing Moving Logo");
   free (background_frame);
   current_state.opened  = false;
-  Ekiga::Runtime::run_in_main (sigc::bind (device_closed.make_slot (), current_state.device));
+  Ekiga::Runtime::run_in_main (sigc::bind (sigc::mem_fun (this, &GMVideoInputManager_mlogo::device_closed_in_main), current_state.device));
 }
 
 bool GMVideoInputManager_mlogo::get_frame_data (char *data)
@@ -197,3 +197,16 @@ bool GMVideoInputManager_mlogo::has_device     (const std::string & /*source*/,
 {
   return false;
 }
+
+void
+GMVideoInputManager_mlogo::device_opened_in_main (Ekiga::VideoInputDevice device,
+						  Ekiga::VideoInputSettings settings)
+{
+  device_opened.emit (device, settings);
+}
+
+void
+GMVideoInputManager_mlogo::device_closed_in_main (Ekiga::VideoInputDevice device)
+{
+  device_closed.emit (device);
+}
diff --git a/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.h b/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.h
index 2c70021..f8c032b 100644
--- a/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.h
+++ b/lib/engine/components/mlogo-videoinput/videoinput-manager-mlogo.h
@@ -89,6 +89,12 @@
       Ekiga::ServiceCore & core;
 
       PAdaptiveDelay adaptive_delay;
+
+    private:
+      void device_opened_in_main (Ekiga::VideoInputDevice device,
+				  Ekiga::VideoInputSettings settings);
+      void device_closed_in_main (Ekiga::VideoInputDevice device);
+
   };
 /**
  * @}



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