ekiga r5939 - in trunk: . lib/engine/display/dx lib/gui



Author: mschneid
Date: Sun Jan 27 11:17:01 2008
New Revision: 5939
URL: http://svn.gnome.org/viewvc/ekiga?rev=5939&view=rev

Log:
Changed DirectX interface to the manager to be more similar to the X interface.


Modified:
   trunk/ChangeLog
   trunk/lib/engine/display/dx/display-manager-dx.cpp
   trunk/lib/gui/dxwindow.cpp
   trunk/lib/gui/dxwindow.h

Modified: trunk/lib/engine/display/dx/display-manager-dx.cpp
==============================================================================
--- trunk/lib/engine/display/dx/display-manager-dx.cpp	(original)
+++ trunk/lib/engine/display/dx/display-manager-dx.cpp	Sun Jan 27 11:17:01 2008
@@ -210,9 +210,10 @@
                              unsigned width,
                              unsigned height)
 {
-// FIXME processEvents
-  if  (dxWindow)
-    dxWindow->PutFrame ((uint8_t *) frame, width, height);
+  if  (dxWindow) {
+    dxWindow->ProcessEvents();
+    dxWindow->PutFrame ((uint8_t *) frame, width, height, false);
+  }
 }
 
 void
@@ -223,19 +224,24 @@
                                  unsigned rf_width,
                                  unsigned rf_height)
 {
-// FIXME processEvents
+  if (dxWindow)
+    dxWindow->ProcessEvents(); 
+
   if (current_frame.display == FULLSCREEN && dxWindow && !dxWindow->IsFullScreen ())
     runtime.run_in_main (sigc::bind (fullscreen_mode_changed.make_slot (), OFF));
 
-//  if (dxWindow && (update_required.remote || (!update_required.remote && !update_required.local)))
-
-  if (dxWindow)
-    dxWindow->PutFrame ((uint8_t *) remote_frame, rf_width, rf_height, 
-                        (uint8_t *) local_frame, lf_width, lf_height);
+  if (dxWindow) {
+    if (update_required.remote || (!update_required.remote && !update_required.local))
+      dxWindow->PutFrame ((uint8_t *) remote_frame, rf_width, rf_height, false);
+      
+    if (update_required.local  || (!update_required.remote && !update_required.local))
+      dxWindow->PutFrame ((uint8_t *) local_frame, lf_width, lf_height, true);      
+  }
 }
 
 void
 GMDisplayManager_dx::sync (UpdateRequired sync_required)
 {
-  // FIXME sync
+  if (dxWindow)
+    dxWindow->Sync(); 
 }

Modified: trunk/lib/gui/dxwindow.cpp
==============================================================================
--- trunk/lib/gui/dxwindow.cpp	(original)
+++ trunk/lib/gui/dxwindow.cpp	Sun Jan 27 11:17:01 2008
@@ -323,27 +323,9 @@
   return true;	
 }
 
-
-void
-DXWindow::PutFrame (uint8_t *mainFrame, 
-                    uint16_t width,
-                    uint16_t height)
-{
-  PutFrame (mainFrame, width, height, NULL, 0, 0);
-}
-
-
-void 
-DXWindow::PutFrame (uint8_t *mainFrame,
-                    uint16_t width, 
-                    uint16_t height,
-                    uint8_t *pipFrame,
-                    uint16_t pipWidth,
-                    uint16_t pipHeight)
+void DXWindow::ProcessEvents()
 {
-  PTRACE(4, "DirectX\tEntering putFrame");
-
-  HRESULT ddResult, ddResultRestore;
+  PTRACE(4, "DirectX\tEntering processEvents");
   MSG message;
 
   // handle messages
@@ -353,34 +335,55 @@
     DispatchMessage (&message);
   }
 
+  if (_embedded) 
+    CalculateEmbWindCoord (); 
+
+  PTRACE(4, "DirectX\tLeaving processEvents");
+}
+
+void
+DXWindow::PutFrame (uint8_t *frame, 
+                    uint16_t width,
+                    uint16_t height,
+		    bool pip)
+{
+  PTRACE(4, "DirectX\tEntering putFrame");
+
   if (_sizemove) 
     return;
 
-  if (width  != _DXSurface.mainSrc.right - _DXSurface.mainSrc.left
-      || height != _DXSurface.mainSrc.bottom - _DXSurface.mainSrc.top
-      || (_pip && (pipWidth  != (_DXSurface.pipSrc.right  - _DXSurface.pipSrc.left)
-                   || pipHeight != (_DXSurface.pipSrc.bottom - _DXSurface.pipSrc.top)))) {
-
-    PTRACE (1, "DirectX\tDynamic switching of resolution not supported\n");
-    PTRACE (1, "DirectX\tMy Resolution: " << (_DXSurface.mainSrc.right  - _DXSurface.mainSrc.left) 
-            << "x" << (_DXSurface.mainSrc.bottom - _DXSurface.mainSrc.top )
-            << ", frame: " << width << "x" << height);
-    PTRACE (1, "DirectX\tMy PIP Resolution: " << (_DXSurface.pipSrc.right  - _DXSurface.pipSrc.left) 
-            << "x" << (_DXSurface.pipSrc.bottom - _DXSurface.pipSrc.top )
-            << ", PIP frame: " << pipWidth << "x" << pipHeight);
-    return;
+  if (!pip) {
+    if (   ( width  != (_DXSurface.mainSrc.right - _DXSurface.mainSrc.left))
+        || ( height != (_DXSurface.mainSrc.bottom - _DXSurface.mainSrc.top)) ) {
+      PTRACE (1, "DirectX\tDynamic switching of resolution not supported\n");
+      PTRACE (1, "DirectX\tMy Resolution: " << (_DXSurface.mainSrc.right  - _DXSurface.mainSrc.left) 
+              << "x" << (_DXSurface.mainSrc.bottom - _DXSurface.mainSrc.top )
+              << ", frame: " << width << "x" << height);
+      return;
+    }
+    // do a memcopy of the main frame and blt it to the backbuffer
+    CopyFrameBackbuffer (frame, width, height, &_DXSurface.mainBack, &_DXSurface.mainSrc);
   }
+  else {
+      if (   ( width  != (_DXSurface.pipSrc.right  - _DXSurface.pipSrc.left))
+        || ( height != (_DXSurface.pipSrc.bottom - _DXSurface.pipSrc.top )) ) {
+      PTRACE (1, "DirectX\tDynamic switching of resolution not supported\n");
+      PTRACE (1, "DirectX\tMy PIP Resolution: " << (_DXSurface.pipSrc.right  - _DXSurface.pipSrc.left) 
+              << "x" << (_DXSurface.pipSrc.bottom - _DXSurface.pipSrc.top )
+              << ", PIP frame: " << width << "x" << height);
+      return;
+    }
+    // do a memcopy of the pip frame and blt it to the backbuffer
+    CopyFrameBackbuffer (frame, width, height, &_DXSurface.pipBack, &_DXSurface.pipSrc);
+  }
+  PTRACE(4, "DirectX\tLeaving putFrame");
+}
 
-  if (_embedded) 
-    CalculateEmbWindCoord (); 
-
-  // do a memcopy of the main frame and blt it to the backbuffer
-  CopyFrameBackbuffer (mainFrame, width, height, &_DXSurface.mainBack, &_DXSurface.mainSrc);
-
-  // do a memcopy of the PIP frame if provided and blt it to the backbuffer
-  if (pipFrame && _pip) 
-    CopyFrameBackbuffer (pipFrame, pipWidth, pipHeight, &_DXSurface.pipBack, &_DXSurface.pipSrc);
+void DXWindow::Sync()
+{
+  HRESULT ddResult, ddResultRestore;
 
+  PTRACE(4, "DirectX\tEntering Sync");
   // Blt the combined pip and main window from the backbuffer 
   // to the final position on the visible primary surface
   ddResult = _DXSurface.primary->Blt (&_DXSurface.primaryDst,
@@ -400,7 +403,7 @@
     PTRACE (1, "DirectX\tBlt failed - " << DDErrorMessage (ddResult));
     return;
   }
-  PTRACE(4, "DirectX\tLeaving putFrame");
+  PTRACE(4, "DirectX\tLeaving Sync");
 }
 
 

Modified: trunk/lib/gui/dxwindow.h
==============================================================================
--- trunk/lib/gui/dxwindow.h	(original)
+++ trunk/lib/gui/dxwindow.h	Sun Jan 27 11:17:01 2008
@@ -138,27 +138,14 @@
      *                 changing the framesize after having been 
      *                 initialized is not supported
      */
-    void PutFrame (uint8_t *mainFrame,
+    void PutFrame (uint8_t *frame,
                    uint16_t width, 
-                   uint16_t height);
+                   uint16_t height,
+		   bool pip);
 
 
-    /* DESCRIPTION  :  /
-     * BEHAVIOR     :  Display a new frame with picture-in-picture
-     * PRE          :  pointer to the main frame data
-     *                 width and height of the main frame
-     *                 pointer to the pip frame data
-     *                 width and height of the pip frame
-     *                 changing the framesize after having been 
-     *                 initialized is not supported
-     */
-    void PutFrame (uint8_t *mainFrame, 
-                   uint16_t width, 
-                   uint16_t height, 
-                   uint8_t *pipFrame, 
-                   uint16_t pipWidth,
-                   uint16_t pipHeight);
-
+    void ProcessEvents ();
+    void Sync ();
     void ToggleOntop ();
     void ToggleFullscreen ();
     void ToggleDecoration ();



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