ekiga r5985 - in trunk: . lib/engine/display/common lib/engine/vidinput/skel



Author: mschneid
Date: Thu Feb 21 18:03:20 2008
New Revision: 5985
URL: http://svn.gnome.org/viewvc/ekiga?rev=5985&view=rev

Log:
Reintroduced a 5 ms sleep in the Preview Manager to give
other threads the opportunity to take the mutex.
Change priority of videoinput and videooutput threads.


Modified:
   trunk/ChangeLog
   trunk/lib/engine/display/common/display-manager-common.cpp
   trunk/lib/engine/vidinput/skel/vidinput-core.cpp

Modified: trunk/lib/engine/display/common/display-manager-common.cpp
==============================================================================
--- trunk/lib/engine/display/common/display-manager-common.cpp	(original)
+++ trunk/lib/engine/display/common/display-manager-common.cpp	Thu Feb 21 18:03:20 2008
@@ -47,7 +47,7 @@
 
 /* The functions */
 GMDisplayManager::GMDisplayManager(Ekiga::ServiceCore & _core)
-  : PThread (1000, NoAutoDeleteThread, HighPriority, "GMDisplayManager"),
+  : PThread (1000, NoAutoDeleteThread, HighestPriority, "GMDisplayManager"),
     core (_core), runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
 {
 }

Modified: trunk/lib/engine/vidinput/skel/vidinput-core.cpp
==============================================================================
--- trunk/lib/engine/vidinput/skel/vidinput-core.cpp	(original)
+++ trunk/lib/engine/vidinput/skel/vidinput-core.cpp	Thu Feb 21 18:03:20 2008
@@ -49,8 +49,8 @@
 using namespace Ekiga;
 
 PreviewManager::PreviewManager (VidInputCore& _vidinput_core, DisplayCore& _display_core)
-: PThread (1000, NoAutoDeleteThread),
-  vidinput_core (_vidinput_core),
+: PThread (1000, NoAutoDeleteThread, HighestPriority, "PreviewManager"),
+    vidinput_core (_vidinput_core),
   display_core (_display_core)
 {
   frame = NULL;
@@ -101,11 +101,14 @@
   unsigned width = 176;
   unsigned height = 144;;
   while (!stop_thread) {
+
     vidinput_core.get_frame_data(width, height, frame);
+    display_core.set_frame_data(width, height, frame, true, 1);
 
-    if (frame){
-      display_core.set_frame_data(width, height, frame, true, 1);
-    }
+    // We have to sleep some time outside the mutex lock
+    // to give other threads time to get the mutex
+    // It will be taken into account by PAdaptiveDelay
+    Current()->Sleep (5);
   }
 }
 



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