ekiga r7138 - in branches/gnome-2-24: . lib/gui



Author: mschneid
Date: Wed Oct  1 16:57:57 2008
New Revision: 7138
URL: http://svn.gnome.org/viewvc/ekiga?rev=7138&view=rev

Log:
Fix flickering issues on XV due to the X Server's strange
bookkeeping of used ports.


Modified:
   branches/gnome-2-24/ChangeLog
   branches/gnome-2-24/NEWS
   branches/gnome-2-24/lib/gui/xvwindow.cpp
   branches/gnome-2-24/lib/gui/xvwindow.h

Modified: branches/gnome-2-24/NEWS
==============================================================================
--- branches/gnome-2-24/NEWS	(original)
+++ branches/gnome-2-24/NEWS	Wed Oct  1 16:57:57 2008
@@ -1,4 +1,5 @@
 Changes since Ekiga 3.00
+- Fix flickering issues on XV due to the X Server's strange bookkeeping of used ports.
 - Keep the preview thread for the lifetime of Ekiga. Windows does not like rapid deletion and recreation of threads.
 - Fix flickering of PIP on windows.
 - Fix possible X timing issue

Modified: branches/gnome-2-24/lib/gui/xvwindow.cpp
==============================================================================
--- branches/gnome-2-24/lib/gui/xvwindow.cpp	(original)
+++ branches/gnome-2-24/lib/gui/xvwindow.cpp	Wed Oct  1 16:57:57 2008
@@ -53,6 +53,8 @@
 }
 #endif
 
+std::set <XvPortID> XVWindow::grabbedPorts;
+
 XVWindow::XVWindow()
 {
   // initialize class variables
@@ -100,6 +102,7 @@
   if (_XVPort) {
 
     XvUngrabPort (_display, _XVPort, CurrentTime);
+    grabbedPorts.erase(_XVPort);
     _XVPort = 0;
   }
 
@@ -400,6 +403,12 @@
 
       for (candidateXVPort = xvainfo [i].base_id ; candidateXVPort < (xvainfo [i].base_id + xvainfo [i].num_ports) ; ++candidateXVPort) {
 
+        if (grabbedPorts.find(candidateXVPort) != grabbedPorts.end()) {
+          PTRACE(4, "XVideo\tPort " << candidateXVPort << " already grabbed by ourselves");
+          ++busyPorts;
+          continue;
+        }
+
         if (PTrace::CanTrace (4)) 
           DumpCapabilities (candidateXVPort);
 
@@ -425,7 +434,8 @@
 
             PTRACE(4, "XVideo\tGrabbed Port: " << candidateXVPort);
             XvFreeAdaptorInfo (xvainfo);
-
+            grabbedPorts.insert(candidateXVPort);
+            
             return candidateXVPort;
           } 
           else {

Modified: branches/gnome-2-24/lib/gui/xvwindow.h
==============================================================================
--- branches/gnome-2-24/lib/gui/xvwindow.h	(original)
+++ branches/gnome-2-24/lib/gui/xvwindow.h	Wed Oct  1 16:57:57 2008
@@ -39,6 +39,7 @@
 #define XVWINDOW_H
 
 #include <stdint.h>
+#include <set>
 #include "config.h"
 
 #include <X11/Xlib.h>
@@ -143,6 +144,8 @@
 #ifdef HAVE_SHM  
   virtual void ShmAttach(int imageWidth, int imageHeight);
 #endif
+
+  static std::set <XvPortID> grabbedPorts;
 };
 
 #endif //XVWINDOW_H



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