ekiga r5906 - in trunk: . lib/engine lib/engine/display lib/engine/display/common lib/engine/display/dx lib/engine/display/skel lib/engine/display/x src src/devices src/gui



Author: mschneid
Date: Sun Jan 13 13:02:26 2008
New Revision: 5906
URL: http://svn.gnome.org/viewvc/ekiga?rev=5906&view=rev

Log:
More work on the Display Engine. Added dummy implementations
for X and DX output.



Added:
   trunk/lib/engine/display/common/
   trunk/lib/engine/display/common/display-manager-common.cpp
   trunk/lib/engine/display/common/display-manager-common.h
   trunk/lib/engine/display/dx/
   trunk/lib/engine/display/dx/Makefile.am
   trunk/lib/engine/display/dx/display-main-dx.cpp
   trunk/lib/engine/display/dx/display-main-dx.h
   trunk/lib/engine/display/dx/display-manager-x.cpp
   trunk/lib/engine/display/dx/display-manager-x.h
   trunk/lib/engine/display/x/
   trunk/lib/engine/display/x/Makefile.am
   trunk/lib/engine/display/x/display-main-x.cpp
   trunk/lib/engine/display/x/display-main-x.h
   trunk/lib/engine/display/x/display-manager-x.cpp
   trunk/lib/engine/display/x/display-manager-x.h
Modified:
   trunk/ChangeLog
   trunk/configure.ac
   trunk/lib/engine/Makefile.am
   trunk/lib/engine/display/Makefile.am
   trunk/lib/engine/display/skel/Makefile.am
   trunk/lib/engine/display/skel/display-core.cpp
   trunk/lib/engine/display/skel/display-core.h
   trunk/lib/engine/display/skel/display-info.h
   trunk/lib/engine/display/skel/display-manager.h
   trunk/lib/engine/engine.cpp
   trunk/src/Makefile.am
   trunk/src/devices/videooutput.cpp
   trunk/src/devices/videooutput.h
   trunk/src/gui/main.cpp

Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac	(original)
+++ trunk/configure.ac	Sun Jan 13 13:02:26 2008
@@ -686,6 +686,8 @@
 lib/engine/protocol/skel/Makefile
 lib/engine/display/Makefile
 lib/engine/display/skel/Makefile
+lib/engine/display/x/Makefile
+lib/engine/display/dx/Makefile
 lib/engine/gui/Makefile
 lib/engine/gui/gtk-core/Makefile
 lib/engine/gui/gtk-frontend/Makefile

Modified: trunk/lib/engine/Makefile.am
==============================================================================
--- trunk/lib/engine/Makefile.am	(original)
+++ trunk/lib/engine/Makefile.am	Sun Jan 13 13:02:26 2008
@@ -17,6 +17,20 @@
 	-I$(top_srcdir)/lib/engine/presence/local-roster		\
 	-I$(top_srcdir)/lib/engine/display/skel
 
+# XVideo/X
+if !WIN32
+INCLUDES +=                                             \
+	-I$(top_srcdir)/lib/engine/display/common       \
+	-I$(top_srcdir)/lib/engine/display/x
+endif
+
+# DirectX
+if HAVE_DX
+INCLUDES +=                                             \
+	-I$(top_srcdir)/lib/engine/display/common       \
+	-I$(top_srcdir)/lib/engine/display/dx
+endif
+		
 libekiga_engine_la_SOURCES = engine.h engine.cpp
 
 AM_CXXFLAGS = $(SIGC_CFLAGS) $(GTK_CFLAGS)
@@ -32,8 +46,22 @@
 	$(top_builddir)/lib/engine/addressbook/call-history/libcall-history.la \
 	$(top_builddir)/lib/engine/presence/skel/libgmpresence.la \
 	$(top_builddir)/lib/engine/presence/local-roster/liblocal-roster.la \
+	$(top_builddir)/lib/engine/display/skel/libgmdisplay.la
 	$(AM_LIBS)
 
+# XVideo/X
+if !WIN32
+libekiga_engine_la_LIBADD += \
+	$(top_builddir)/lib/engine/display/x/libgmdisplay-x.la
+endif
+
+# DirectX
+if HAVE_DX
+libekiga_engine_la_LIBADD += \
+	$(top_builddir)/lib/engine/display/dx/libgmdisplay-dx.la
+endif
+
+
 if HAVE_AVAHI
 libekiga_engine_la_LIBADD += presence/avahi/libgmavahi.la
 endif

Modified: trunk/lib/engine/display/Makefile.am
==============================================================================
--- trunk/lib/engine/display/Makefile.am	(original)
+++ trunk/lib/engine/display/Makefile.am	Sun Jan 13 13:02:26 2008
@@ -1 +1,10 @@
-SUBDIRS = skel
\ No newline at end of file
+SUBDIRS = skel
+# XVideo/X
+if !WIN32
+SUBDIRS += x
+endif
+		
+# DirectX
+if HAVE_DX
+SUBDIRS += dx
+endif

Added: trunk/lib/engine/display/common/display-manager-common.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/common/display-manager-common.cpp	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,324 @@
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-manager-common.cpp  -  description
+ *                         ------------------------------
+ *   begin                : Sat Feb 17 2001
+ *   copyright            : (C) 2000-2008 by Damien Sandras
+ *                        : (C) 2007-2008 by Matthias Schneider
+ *   description          : GMVideoManager: Generic class that represents 
+ *                            a thread that can display a video image and defines.
+ *                            generic functions for local/remote/pip/pip external 
+ *                            window/fullscreen video display. Provides interface 
+ *                            to the GUI for an embedded window, display mode 
+ *                            control and feedback of information like the status
+ *                            of the video acceleration. Also provides the 
+ *                            copying and local storage of the video frame.
+ *
+ */
+
+
+#include "display-manager-common.h"
+
+/* The functions */
+GMDisplayManager::GMDisplayManager(Ekiga::ServiceCore & _core)
+  : PThread (1000, NoAutoDeleteThread, HighPriority, "GMDisplayManager"),
+    core (_core), runtime (*(dynamic_cast<Ekiga::Runtime *> (_core.get ("runtime"))))
+{
+}
+
+GMDisplayManager::~GMDisplayManager ()
+{
+}
+
+void GMDisplayManager::start ()
+{
+  Ekiga::DisplayManager::start();
+
+  /* State for last frame */
+  last_frame.display = UNSET_new;
+  last_frame.local_width = 0;
+  last_frame.local_height = 0;
+  last_frame.remote_width = 0;
+  last_frame.remote_height = 0;  
+  last_frame.zoom = 0;
+  last_frame.embedded_x = 0;
+  last_frame.embedded_y = 0;  
+
+  current_frame.local_width = 0;
+  current_frame.local_height = 0;
+  current_frame.remote_width = 0;
+  current_frame.remote_height = 0;
+
+  /* Initialisation */
+  end_thread = false;
+  video_disabled = false;
+  first_frame_received = false;
+  update_required.local = false;
+  update_required.remote = false;
+
+  rx_frames = 0;
+  tx_frames = 0;
+
+  last_stats = PTime ();
+
+//  this->Resume ();
+  this->Restart ();
+  thread_sync_point.Wait ();
+printf ("Start\n");
+}
+
+void GMDisplayManager::stop () {
+  end_thread = true;
+  /* Wait for the Main () method to be terminated */
+  frame_available_sync_point.Signal();
+  PWaitAndSignal m(quit_mutex);
+
+  /* This is common to all output classes */
+  lframeStore.SetSize (0);
+  rframeStore.SetSize (0);
+
+  Ekiga::DisplayManager::stop();
+printf ("Stop\n");
+}
+
+void
+GMDisplayManager::Main ()
+{
+  bool do_sync;
+  UpdateRequired sync_required;
+
+  PWaitAndSignal m(quit_mutex);
+  thread_sync_point.Signal ();
+
+  while (!end_thread) {
+    frame_available_sync_point.Wait(250);
+printf ("Thread\n");
+    var_mutex.Wait ();
+      do_sync = first_frame_received;
+      if (first_frame_received)
+        sync_required = redraw();
+    var_mutex.Signal ();
+    if (do_sync)
+      sync(sync_required);
+  }
+
+  var_mutex.Wait ();
+  close_frame_display ();
+  var_mutex.Signal ();
+}
+
+void GMDisplayManager::set_frame_data (unsigned width,
+				       unsigned height,
+				       const char* data,
+				       bool local,
+				       int devices_nbr
+)
+{ 
+  DisplayInfo local_display_info;
+
+  get_display_info(local_display_info);
+
+printf ("SetFrameData\n");
+
+  var_mutex.Wait();
+
+  /* If there is only one device open, ignore the setting, and 
+   * display what we can actually display.
+   */
+  if (devices_nbr <= 1) {
+
+    if (!local)
+      local_display_info.display = REMOTE_VIDEO_new;
+    else 
+      local_display_info.display = LOCAL_VIDEO_new;
+
+    runtime.run_in_main (sigc::bind (display_type_changed.make_slot (), local_display_info.display));
+  }
+
+  current_frame.display = local_display_info.display;
+  current_frame.zoom = local_display_info.zoom; 
+  first_frame_received = true;
+
+  if (local) {
+
+    /* memcpy the frame */
+    lframeStore.SetSize (width * height * 3);
+    current_frame.local_width = width;
+    current_frame.local_height= height;
+
+    tx_frames++;
+    
+    if ((width != display_stats.tx_width) || (height != display_stats.tx_height)) {
+      display_stats.tx_width = width;
+      display_stats.tx_height = height;
+      //FIXME
+    }
+
+    memcpy (lframeStore.GetPointer(), data, (width * height * 3) >> 1);
+    if (update_required.local) 
+      PTRACE(3, "Skipped earlier local frame");
+    update_required.local = true;
+  }
+  else {
+
+    /* memcpy the frame */
+    rframeStore.SetSize (width * height * 3);
+    current_frame.remote_width = width;
+    current_frame.remote_height= height;
+    
+    rx_frames++;
+
+    if ((width != display_stats.rx_width) || (height != display_stats.rx_height)) {
+      display_stats.rx_width = width;
+      display_stats.rx_height = height;
+      //FIXME
+    }
+
+    memcpy (rframeStore.GetPointer(), data, (width * height * 3) >> 1);
+    if (update_required.remote) 
+      PTRACE(3, "Skipped earlier remote frame");
+    update_required.remote = true;
+  }
+
+  PTimeInterval t = PTime () - last_stats;
+  if (t.GetMilliSeconds() > 2000) {
+    display_stats.tx_fps = round ((rx_frames * 1000) / t.GetMilliSeconds());
+    display_stats.rx_fps = round ((tx_frames * 1000) / t.GetMilliSeconds());
+    rx_frames = 0;
+    tx_frames = 0;
+    last_stats = PTime();
+    //FIXME
+  }
+
+  var_mutex.Signal();
+
+  if ((local_display_info.display == UNSET_new) || (local_display_info.zoom == 0) || (!local_display_info.gconfInfoSet)) {
+    runtime.run_in_main (display_info_update_required.make_slot ());
+    PTRACE(4, "GMVideoDisplay_embedded\tDisplay and zoom variable not set yet, not opening display");
+     return;
+  }
+
+  if ((local_display_info.display == LOCAL_VIDEO_new) && !local)
+      return;
+
+  if ((local_display_info.display == REMOTE_VIDEO_new) && local)
+      return;
+printf ("Signaling\n");
+  frame_available_sync_point.Signal();
+}
+
+bool 
+GMDisplayManager::frame_display_change_needed (DisplayMode display, 
+                                              unsigned lf_width, 
+                                              unsigned lf_height, 
+                                              unsigned rf_width, 
+                                              unsigned rf_height, 
+                                              unsigned int zoom)
+{
+  DisplayInfo local_display_info;
+
+  get_display_info(local_display_info);
+
+  if ((!local_display_info.widgetInfoSet) || (!local_display_info.gconfInfoSet) ||
+      (local_display_info.display == UNSET_new) || (local_display_info.zoom == 0)) {
+    PTRACE(4, "GMVideoDisplay_X\tWidget not yet realized or gconf info not yet set, not opening display");
+    return false;
+  }
+  switch (display) {
+  case LOCAL_VIDEO_new:
+    return (last_frame.display != LOCAL_VIDEO_new 
+            || last_frame.zoom != zoom || last_frame.local_width != lf_width || last_frame.local_height != lf_height 
+            || local_display_info.x != last_frame.embedded_x || local_display_info.y != last_frame.embedded_y);
+    break;
+
+  case REMOTE_VIDEO_new:
+    return (last_frame.display != REMOTE_VIDEO_new
+            || last_frame.zoom != zoom || last_frame.remote_width != rf_width || last_frame.remote_height != rf_height
+            || local_display_info.x != last_frame.embedded_x || local_display_info.y != last_frame.embedded_y);
+    break;
+
+  case PIP_new:
+    return (last_frame.display != display || last_frame.zoom != zoom 
+            || last_frame.remote_width != rf_width || last_frame.remote_height != rf_height
+            || last_frame.local_width != lf_width || last_frame.local_height != lf_height
+            || local_display_info.x != last_frame.embedded_x || local_display_info.y != last_frame.embedded_y);
+    break;
+  case PIP_WINDOW_new:
+  case FULLSCREEN_new:
+    return (last_frame.display != display || last_frame.zoom != zoom 
+            || last_frame.remote_width != rf_width || last_frame.remote_height != rf_height
+            || last_frame.local_width != lf_width || last_frame.local_height != lf_height);
+    break;
+  case UNSET_new:
+  default:
+    break;
+  }
+  return false;
+}
+
+UpdateRequired
+GMDisplayManager::redraw ()
+{
+  UpdateRequired sync_required;
+  sync_required = update_required;
+  
+    if (frame_display_change_needed (current_frame.display, current_frame.local_width, current_frame.local_height, 
+                                  current_frame.remote_width, current_frame.remote_height, current_frame.zoom)) 
+      setup_frame_display (current_frame.display, current_frame.local_width, current_frame.local_height, 
+                         current_frame.remote_width, current_frame.remote_height, current_frame.zoom); 
+
+    switch (current_frame.display) 
+      {
+      case LOCAL_VIDEO_new:
+          if (lframeStore.GetSize() > 0)
+            display_frame ((char*)lframeStore.GetPointer (), current_frame.local_width, current_frame.local_height);
+        break;
+
+      case REMOTE_VIDEO_new:
+          if (rframeStore.GetSize() > 0)
+            display_frame ((char*)rframeStore.GetPointer (), current_frame.remote_width, current_frame.remote_height);
+        break;
+
+     case FULLSCREEN_new:
+     case PIP_new:
+     case PIP_WINDOW_new:
+          if ((lframeStore.GetSize() > 0) &&  (rframeStore.GetSize() > 0))
+            display_pip_frames ((char*)lframeStore.GetPointer (), current_frame.local_width, current_frame.local_height,
+                              (char*)rframeStore.GetPointer (), current_frame.remote_width, current_frame.remote_height);
+       break;
+    case UNSET_new:
+    default:
+       break;
+    }
+
+  update_required.local = false;
+  update_required.remote = false;
+
+  return sync_required;
+}

Added: trunk/lib/engine/display/common/display-manager-common.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/common/display-manager-common.h	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,244 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2006 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-manager-common.h  -  description
+ *                         ------------------------------
+ *   begin                : Sat Feb 17 2001
+ *   copyright            : (C) 2000-2008 by Damien Sandras
+ *                        : (C) 2007-2008 by Matthias Schneider
+ *   description          : GMVideoManager: Generic class that represents 
+ *                            a thread that can display a video image and defines.
+ *                            generic functions for local/remote/pip/pip external 
+ *                            window/fullscreen video display. Provides interface 
+ *                            to the GUI for an embedded window, display mode 
+ *                            control and feedback of information like the status
+ *                            of the video acceleration. Also provides the 
+ *                            copying and local storage of the video frame.
+ */
+
+
+#ifndef _VIDEODISPLAY_H_
+#define _VIDEODISPLAY_H_
+
+#include "display-manager.h"
+#include "runtime.h"
+//FIXME
+#include "../../../../../ptlib/include/ptbuildopts.h"
+#include "../../../../../ptlib/include/ptlib.h"
+
+
+typedef struct {
+  DisplayMode display;
+  unsigned int remote_width;
+  unsigned int remote_height;
+
+  unsigned int local_width;
+  unsigned int local_height;
+  
+  unsigned int zoom;
+
+  int embedded_x;
+  int embedded_y;
+} FrameInfo;
+
+typedef struct {
+  bool local;
+  bool remote;  
+} UpdateRequired;
+
+
+class GMDisplayManager
+   : public PThread,
+     public Ekiga::DisplayManager
+{
+  PCLASSINFO(GMDisplayManager, PThread); 
+public:
+
+  /* DESCRIPTION  :  The constructor.
+   * BEHAVIOR     :  Initialises the VideoDisplay_embedded.
+   * PRE          :  /
+   */
+  GMDisplayManager (Ekiga::ServiceCore & core);
+
+
+  /* DESCRIPTION  :  The destructor.
+   * BEHAVIOR     :  /
+   * PRE          :  /
+    ==============================================================================
+    ATTENTION: When deriving from this class, ALWAYS make sure that the 
+    destructor of the derived class waits for the thread to terminate -
+    if the thread is still running after the derived class' destructor finishes, 
+    all virtual functions will be switched back to this base class where they are 
+    purely virtual, leading to severe runtime issues.
+    ==============================================================================
+  */
+  virtual ~GMDisplayManager (void);
+
+  virtual void start ();
+
+  virtual void stop ();
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Copy the frame data to a local structur and signal 
+   *                 the thread to display it.
+   * PRE          :  width and height (>=0),
+   *                 the data
+   *                 a boolean whether frame is a local or remote one
+   *                 and the number of opened devices .
+   */
+   virtual void set_frame_data (unsigned width,
+                                unsigned height,
+                                const char* data,
+                                bool local,
+                                int devices_nbr);
+
+
+   virtual void set_display_info (const DisplayInfo & _display_info)
+   {
+      PWaitAndSignal m(display_info_mutex);
+      display_info = _display_info;
+   };
+
+
+ protected:
+
+  /* DESCRIPTION  :  The video thread loop that waits for a frame and
+   *                 then displays it
+   * BEHAVIOR     :  Loops and displays
+   * PRE          :  /
+   */
+  virtual void Main (void);
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Returns TRUE if the given settings require a
+   *                 reinitialization of the display, FALSE 
+   *                 otherwise.
+   * PRE          :  /
+   */
+  virtual bool frame_display_change_needed (DisplayMode display, 
+                                            unsigned lf_width, 
+                                            unsigned lf_height, 
+                                            unsigned rf_width, 
+                                            unsigned rf_height, 
+                                            unsigned int zoom);
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Setup the display following the display type,
+   *                 picture dimensions and zoom value.
+   *                 Returns FALSE in case of failure.
+   * PRE          :  /
+   */
+  virtual void setup_frame_display (DisplayMode display, 
+                                    unsigned lf_width, 
+                                    unsigned lf_height, 
+                                    unsigned rf_width, 
+                                    unsigned rf_height, 
+                                    unsigned int zoom) = 0;
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Closes the frame display and returns FALSE 
+   *                 in case of failure.
+   * PRE          :  /
+   */
+  virtual bool close_frame_display () = 0;
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Display the given frame on the correct display.
+   * PRE          :  The display needs to be initialized using 
+   *                 SetupFrameDisplay. 
+   */
+  virtual void display_frame (const char *frame,
+                              unsigned width,
+                              unsigned height) = 0;
+
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Display the given frames as Picture in Picture.
+   * PRE          :  The display needs to be initialized using 
+   *                 SetupFrameDisplay. 
+   */
+  virtual void display_pip_frames (const char *local_frame,
+                                   unsigned lf_width,
+                                   unsigned lf_height,
+                                   const char *remote_frame,
+                                   unsigned rf_width,
+                                   unsigned rf_height) = 0;
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Draw the frame via the Display* functions
+   * PRE          :  /
+   */
+  virtual UpdateRequired redraw ();
+
+  
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Sync the output of the frame to the display
+   * PRE          :  /
+   */
+  virtual void sync(UpdateRequired sync_required) = 0;
+
+  virtual void get_display_info (DisplayInfo & _display_info) {
+        PWaitAndSignal m(display_info_mutex);
+        _display_info = display_info;
+  }
+
+
+  PMutex display_info_mutex; /* To protect the DisplayInfo object */
+
+  /* This variable has to be protected by display_info_mutex */
+  DisplayInfo display_info;
+
+  PBYTEArray lframeStore;
+  PBYTEArray rframeStore;
+
+  FrameInfo last_frame;
+  FrameInfo current_frame;
+
+  unsigned rx_frames;
+  unsigned tx_frames;
+  
+  bool end_thread;
+  bool first_frame_received;
+  bool video_disabled;
+  UpdateRequired update_required;
+
+  PMutex var_mutex;      /* To protect variables that are read and written
+			    from various threads */
+  PMutex quit_mutex;     /* To exit */
+
+  PSyncPoint frame_available_sync_point;     /* To signal a new frame has to be displayed  */
+  PSyncPoint thread_sync_point;              /* To signal that the thread has been created */
+
+  PTime last_stats;
+
+  Ekiga::Runtime & runtime;
+  Ekiga::ServiceCore & core;
+};
+
+#endif /* VIDEODISPLAY */

Added: trunk/lib/engine/display/dx/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/dx/Makefile.am	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,22 @@
+noinst_LTLIBRARIES = libgmdisplay-dx.la
+
+display_dir = $(top_srcdir)/lib/engine/display/dx
+common_dir = $(top_srcdir)/lib/engine/display/common
+
+AM_CXXFLAGS = $(SIGC_CFLAGS)
+
+INCLUDES = \
+	-I$(top_srcdir)/lib/engine/include \
+	-I$(top_srcdir)/lib/engine/framework \
+	-I$(top_srcdir)/lib/engine/display/skel \
+	-I$(top_srcdir)/lib/engine/display/common
+
+libgmdisplay_dx_la_SOURCES = \
+	$(common_dir)/display-manager-common.cpp\
+	$(common_dir)/display-manager-common.h  \
+	$(display_dir)/display-manager-dx.cpp    \
+	$(display_dir)/display-manager-dx.h      \
+	$(display_dir)/display-main-dx.cpp    \
+	$(display_dir)/display-main-dx.h
+
+libgmdisplay_dx_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS)

Added: trunk/lib/engine/display/dx/display-main-dx.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/dx/display-main-dx.cpp	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,62 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-main-dx.cpp  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Matthias Schneider
+ *   copyright            : (c) 2008 by Matthias Schneider
+ *   description          : code to hook the DX display manager into the main program
+ *
+ */
+
+#include "display-main-dx.h"
+#include "display-core.h"
+#include "display-manager-dx.h"
+
+bool
+display_x_init (Ekiga::ServiceCore &core,
+	    int */*argc*/,
+	    char **/*argv*/[])
+{
+  bool result = false;
+  Ekiga::DisplayCore *display_core = NULL;
+
+  display_core
+    = dynamic_cast<Ekiga::DisplayCore*>(core.get ("display-core"));
+
+  if (display_core != NULL) {
+
+    GMDisplayManager_dx *display_manager = new GMDisplayManager_dx(core);
+
+    display_core->add_manager (*display_manager);
+    result = true;
+  }
+
+  return result;
+}

Added: trunk/lib/engine/display/dx/display-main-dx.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/dx/display-main-dx.h	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,47 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-main-dx.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Matthias Schneider
+ *   copyright            : (c) 2008 by Matthias Schneider
+ *   description          : code to hook the DX display manager into the main program
+ *
+ */
+
+#ifndef __DISPLAY_MAIN_DX_H__
+#define __DISPLAY_MAIN_DX_H__
+
+#include "services.h"
+
+bool display_dx_init (Ekiga::ServiceCore &core,
+  		     int *argc,
+		     char **argv[]);
+
+#endif

Added: trunk/lib/engine/display/dx/display-manager-x.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/dx/display-manager-x.cpp	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,43 @@
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-manager-dx.cpp -  description
+ *                         ----------------------------------
+ *   begin                : Sun Nov 19 2006
+ *   copyright            : (C) 2006-2008 by Matthias Schneider
+ *                          (C) 2000-2008 by Damien Sandras
+ *   description          : Class to allow video output to a DirectX
+ *                          accelerated window
+ */
+
+#include "display-manager-dx.h"
+
+GMDisplayManager_dx::GMDisplayManager_dx (Ekiga::ServiceCore & core)
+: GMDisplayManager(core)
+{
+}

Added: trunk/lib/engine/display/dx/display-manager-x.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/dx/display-manager-x.h	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,93 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2006 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+*                         display-manager-dx.h -  description
+ *                         ----------------------------------
+ *   begin                : Sun Nov 19 2006
+ *   copyright            : (C) 2006-2008 by Matthias Schneider
+ *                          (C) 2000-2008 by Damien Sandras
+ *   description          : Class to allow video output to a DirectX
+ *                          accelerated window
+ 
+ */
+
+
+#ifndef _DISPLAY_MANAGER_DX_H_
+#define _DISPLAY_MANAGER_DX_H_
+
+#include "display-manager-common.h"
+
+class GMDisplayManager_dx
+   : public  GMDisplayManager
+{
+public:
+  GMDisplayManager_dx (Ekiga::ServiceCore & core);
+  virtual void setup_frame_display (DisplayMode display, 
+                                    unsigned lf_width, 
+                                    unsigned lf_height, 
+                                    unsigned rf_width, 
+                                    unsigned rf_height, 
+                                    unsigned int zoom) {};
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Closes the frame display and returns FALSE 
+   *                 in case of failure.
+   * PRE          :  /
+   */
+  virtual bool close_frame_display () {return true;};
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Display the given frame on the correct display.
+   * PRE          :  The display needs to be initialized using 
+   *                 SetupFrameDisplay. 
+   */
+  virtual void display_frame (const char *frame,
+                             unsigned width,
+                             unsigned height) {};
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Display the given frames as Picture in Picture.
+   * PRE          :  The display needs to be initialized using 
+   *                 SetupFrameDisplay. 
+   */
+  virtual void display_pip_frames (const char *local_frame,
+                                 unsigned lf_width,
+                                 unsigned lf_height,
+                                 const char *remote_frame,
+                                 unsigned rf_width,
+                                 unsigned rf_height) {};
+  
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Sync the output of the frame to the display
+   * PRE          :  /
+   */
+  virtual void sync(UpdateRequired sync_required) {};
+
+};
+#endif /* VIDEODISPLAY_DX */

Modified: trunk/lib/engine/display/skel/Makefile.am
==============================================================================
--- trunk/lib/engine/display/skel/Makefile.am	(original)
+++ trunk/lib/engine/display/skel/Makefile.am	Sun Jan 13 13:02:26 2008
@@ -10,6 +10,7 @@
 	-I$(top_srcdir)/lib/engine/display/skel
 
 libgmdisplay_la_SOURCES = \
+	$(display_dir)/display-manager.h	\
 	$(display_dir)/display-core.h		\
 	$(display_dir)/display-core.cpp
 

Modified: trunk/lib/engine/display/skel/display-core.cpp
==============================================================================
--- trunk/lib/engine/display/skel/display-core.cpp	(original)
+++ trunk/lib/engine/display/skel/display-core.cpp	Sun Jan 13 13:02:26 2008
@@ -55,7 +55,7 @@
   manager.fullscreen_mode_changed.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_fullscreen_mode_changed), &manager));
   manager.size_changed.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_size_changed), &manager));
   manager.logo_update_required.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_logo_update_required), &manager));
-  manager.video_info_update_required.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_video_info_update_required), &manager));
+  manager.display_info_update_required.connect (sigc::bind (sigc::mem_fun (this, &DisplayCore::on_display_info_update_required), &manager));
 }
 
 
@@ -86,25 +86,25 @@
   }
 }
 
-void DisplayCore::setFrameData (unsigned width,
-                                unsigned height,
-                                const char *data,
-                                bool local,
-                                int devices_nbr)
+void DisplayCore::set_frame_data (unsigned width,
+                                  unsigned height,
+                                  const char *data,
+                                  bool local,
+                                  int devices_nbr)
 {
   for (std::set<DisplayManager *>::iterator iter = managers.begin ();
        iter != managers.end ();
        iter++) {
-    (*iter)->setFrameData (width, height, data, local, devices_nbr);
+    (*iter)->set_frame_data (width, height, data, local, devices_nbr);
   }
 }
 
-void DisplayCore::setVideoInfo (const DisplayInfo & newVideoInfo)
+void DisplayCore::set_video_info (const DisplayInfo & newVideoInfo)
 {
   for (std::set<DisplayManager *>::iterator iter = managers.begin ();
        iter != managers.end ();
        iter++) {
-    (*iter)->setVideoInfo (newVideoInfo);
+    (*iter)->set_display_info (newVideoInfo);
   }
 }
 
@@ -129,7 +129,7 @@
   logo_update_required.emit (*manager);
 }
 
-void DisplayCore::on_video_info_update_required (DisplayManager *manager)
+void DisplayCore::on_display_info_update_required (DisplayManager *manager)
 {
-  video_info_update_required.emit (*manager);
+  display_info_update_required.emit (*manager);
 }

Modified: trunk/lib/engine/display/skel/display-core.h
==============================================================================
--- trunk/lib/engine/display/skel/display-core.h	(original)
+++ trunk/lib/engine/display/skel/display-core.h	Sun Jan 13 13:02:26 2008
@@ -101,13 +101,13 @@
 
       void stop ();
 
-      void setFrameData (unsigned width,
-                         unsigned height,
-                         const char *data,
-                         bool local,
-                         int devices_nbr);
+      void set_frame_data (unsigned width,
+                           unsigned height,
+                           const char *data,
+                           bool local,
+                           int devices_nbr);
 
-      void setVideoInfo (const DisplayInfo & newVideoInfo);
+      void set_video_info (const DisplayInfo & newVideoInfo);
 
       /*** Display Related Signals ***/
       
@@ -117,7 +117,7 @@
       sigc::signal<void, DisplayManager &, FSToggle_new> fullscreen_mode_changed;     /* gm_main_window_toggle_fullscreen */
       sigc::signal<void, DisplayManager &, unsigned, unsigned> size_changed;          /* gm_main_window_set_resized_video_widget */
       sigc::signal<void, DisplayManager &> logo_update_required;                      /* gm_main_window_update_logo  */
-      sigc::signal<void, DisplayManager &> video_info_update_required;                /* gm_main_window_update_zoom_display */
+      sigc::signal<void, DisplayManager &> display_info_update_required;                /* gm_main_window_update_zoom_display */
 //      sigc::signal<void, DisplayManager &, VideoAccelStatus> update_video_accel_status; /* gm_main_window_update_video_accel_status */
 
 
@@ -126,7 +126,7 @@
       void on_fullscreen_mode_changed (FSToggle_new toggle, DisplayManager *manager);
       void on_size_changed ( unsigned width, unsigned height, DisplayManager *manager);
       void on_logo_update_required (DisplayManager *manager);
-      void on_video_info_update_required (DisplayManager *manager);
+      void on_display_info_update_required (DisplayManager *manager);
 
       std::set<DisplayManager *> managers;
     };  

Modified: trunk/lib/engine/display/skel/display-info.h
==============================================================================
--- trunk/lib/engine/display/skel/display-info.h	(original)
+++ trunk/lib/engine/display/skel/display-info.h	Sun Jan 13 13:02:26 2008
@@ -42,45 +42,45 @@
 #undef None
 #endif
 
-namespace Ekiga {
+//namespace Ekiga {
   /* Video modes */
   typedef enum {
   
-    LOCAL_VIDEO, 
-    REMOTE_VIDEO, 
-    PIP,
-    PIP_WINDOW,
-    FULLSCREEN,
-    UNSET
+    LOCAL_VIDEO_new, 
+    REMOTE_VIDEO_new, 
+    PIP_new,
+    PIP_WINDOW_new,
+    FULLSCREEN_new,
+    UNSET_new
   } DisplayMode;
   
   /* Toggle operations for Fullscreen */
   typedef enum {
   
-    ON,
-    OFF,
-    TOGGLE
+    ON_new,
+    OFF_new,
+    TOGGLE_new
   } FSToggle_new;
   
   /* Video Acceleration Status */
   typedef enum {
   
-    NONE,
-    REMOTE_ONLY,
-    ALL,
-    NO_VIDEO
+    NONE_new,
+    REMOTE_ONLY_new,
+    ALL_new,
+    NO_VIDEO_new
   } VideoAccelStatus_new;  //FIXME
 
 
   typedef struct {
-    unsigned rxFPS;
-    unsigned rxWidth;
-    unsigned rxHeight;
-    unsigned txFPS;
-    unsigned txWidth;
-    unsigned txHeight;
-    VideoAccelStatus_new videoAccelStatus;
-  } VideoStats_new;       //FIXME
+    unsigned rx_fps;
+    unsigned rx_width;
+    unsigned rx_height;
+    unsigned tx_fps;
+    unsigned tx_width;
+    unsigned tx_height;
+    VideoAccelStatus_new video_accel_status;
+  } DisplayStats;
 
   class DisplayInfo
   {
@@ -103,7 +103,7 @@
       allowPipSwScaling = true;
       swScalingAlgorithm = 0;
   
-      display = UNSET;
+      display = UNSET_new;
       zoom = 0;
     };
     
@@ -129,7 +129,7 @@
         allowPipSwScaling = rhs.allowPipSwScaling;
         swScalingAlgorithm =  rhs.swScalingAlgorithm;
       }
-      if (rhs.display != UNSET) display = rhs.display;
+      if (rhs.display != UNSET_new) display = rhs.display;
       if (rhs.zoom != 0) zoom = rhs.zoom;
     };
   
@@ -155,6 +155,6 @@
     unsigned int zoom;
   };
   
-};
+//};
 
 #endif

Modified: trunk/lib/engine/display/skel/display-manager.h
==============================================================================
--- trunk/lib/engine/display/skel/display-manager.h	(original)
+++ trunk/lib/engine/display/skel/display-manager.h	Sun Jan 13 13:02:26 2008
@@ -65,32 +65,32 @@
        * @return: true if a Ekiga::Call could be created
        */
       virtual void start () {
-        videoStats.rxWidth = videoStats.rxWidth = videoStats.rxFPS = 0;
-        videoStats.txWidth = videoStats.txWidth = videoStats.txFPS = 0;
-        videoStats.videoAccelStatus = NONE;
+        display_stats.rx_width = display_stats.rx_height = display_stats.rx_fps = 0;
+        display_stats.tx_width = display_stats.tx_height = display_stats.tx_fps = 0;
+        display_stats.video_accel_status = NONE_new;
       };
 
       virtual void stop () { };
 
-      virtual void setFrameData (unsigned width,
-                                 unsigned height,
-                                 const char *data,
-                                 bool local,
-                                 int devices_nbr) = 0;
+      virtual void set_frame_data (unsigned width,
+                                   unsigned height,
+                                   const char *data,
+                                   bool local,
+                                   int devices_nbr) = 0;
 
-      virtual void setVideoInfo (const DisplayInfo & newVideoInfo) { };
+      virtual void set_display_info (const DisplayInfo &) { };
 
       sigc::signal<void, DisplayMode> display_type_changed;       /* gm_main_window_set_display_type */
-      sigc::signal<void, FSToggle_new> fullscreen_mode_changed;     /* gm_main_window_toggle_fullscreen */
-      sigc::signal<void, unsigned, unsigned> size_changed;          /* gm_main_window_set_resized_video_widget */
-      sigc::signal<void> logo_update_required;                        /* gm_main_window_update_logo  */
-      sigc::signal<void> video_info_update_required;                  /* gm_main_window_update_zoom_display */
+      sigc::signal<void, FSToggle_new> fullscreen_mode_changed;   /* gm_main_window_toggle_fullscreen */
+      sigc::signal<void, unsigned, unsigned> size_changed;        /* gm_main_window_set_resized_video_widget */
+      sigc::signal<void> logo_update_required;                    /* gm_main_window_update_logo  */
+      sigc::signal<void> display_info_update_required;            /* gm_main_window_update_zoom_display */
 //      sigc::signal<void, DisplayManager &, VideoAccelStatus> update_video_accel_status; /* gm_main_window_update_video_accel_status */
 
   protected:  
-      virtual void GetVideoInfo (DisplayInfo & getVideoInfo) { };
+      virtual void get_display_info (DisplayInfo &) { };
 
-      VideoStats_new videoStats;
+      DisplayStats display_stats;
     };
 };
 

Added: trunk/lib/engine/display/x/Makefile.am
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/x/Makefile.am	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,22 @@
+noinst_LTLIBRARIES = libgmdisplay-x.la
+
+display_dir = $(top_srcdir)/lib/engine/display/x
+common_dir = $(top_srcdir)/lib/engine/display/common
+
+AM_CXXFLAGS = $(SIGC_CFLAGS)
+
+INCLUDES = \
+	-I$(top_srcdir)/lib/engine/include \
+	-I$(top_srcdir)/lib/engine/framework \
+	-I$(top_srcdir)/lib/engine/display/skel \
+	-I$(top_srcdir)/lib/engine/display/common
+
+libgmdisplay_x_la_SOURCES = \
+	$(common_dir)/display-manager-common.cpp\
+	$(common_dir)/display-manager-common.h  \
+	$(display_dir)/display-manager-x.cpp    \
+	$(display_dir)/display-manager-x.h      \
+	$(display_dir)/display-main-x.cpp    \
+	$(display_dir)/display-main-x.h
+
+libgmdisplay_x_la_LDFLAGS = -export-dynamic -no-undefined $(SIGC_LIBS)

Added: trunk/lib/engine/display/x/display-main-x.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/x/display-main-x.cpp	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,62 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-main-x.cpp  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Matthias Schneider
+ *   copyright            : (c) 2008 by Matthias Schneider
+ *   description          : code to hook the X display manager into the main program
+ *
+ */
+
+#include "display-main-x.h"
+#include "display-core.h"
+#include "display-manager-x.h"
+
+bool
+display_x_init (Ekiga::ServiceCore &core,
+	    int */*argc*/,
+	    char **/*argv*/[])
+{
+  bool result = false;
+  Ekiga::DisplayCore *display_core = NULL;
+
+  display_core
+    = dynamic_cast<Ekiga::DisplayCore*>(core.get ("display-core"));
+
+  if (display_core != NULL) {
+
+    GMDisplayManager_x *display_manager = new GMDisplayManager_x(core);
+
+    display_core->add_manager (*display_manager);
+    result = true;
+  }
+
+  return result;
+}

Added: trunk/lib/engine/display/x/display-main-x.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/x/display-main-x.h	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,47 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-main-x.h  -  description
+ *                         ------------------------------------------
+ *   begin                : written in 2008 by Matthias Schneider
+ *   copyright            : (c) 2008 by Matthias Schneider
+ *   description          : code to hook the X display manager into the main program
+ *
+ */
+
+#ifndef __DISPLAY_MAIN_X_H__
+#define __DISPLAY_MAIN_X_H__
+
+#include "services.h"
+
+bool display_x_init (Ekiga::ServiceCore &core,
+  		     int *argc,
+		     char **argv[]);
+
+#endif

Added: trunk/lib/engine/display/x/display-manager-x.cpp
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/x/display-manager-x.cpp	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,43 @@
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2007 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+ *                         display-manager-x.cpp -  description
+ *                         ----------------------------------
+ *   begin                : Sun Nov 19 2006
+ *   copyright            : (C) 2006-2008 by Matthias Schneider
+ *                          (C) 2000-2008 by Damien Sandras
+ *   description          : Class to allow video output to a X/XVideo
+ *                          accelerated window
+ */
+
+#include "display-manager-x.h"
+
+GMDisplayManager_x::GMDisplayManager_x (Ekiga::ServiceCore & core)
+: GMDisplayManager(core)
+{
+}

Added: trunk/lib/engine/display/x/display-manager-x.h
==============================================================================
--- (empty file)
+++ trunk/lib/engine/display/x/display-manager-x.h	Sun Jan 13 13:02:26 2008
@@ -0,0 +1,93 @@
+
+/* Ekiga -- A VoIP and Video-Conferencing application
+ * Copyright (C) 2000-2006 Damien Sandras
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ *
+ * Ekiga is licensed under the GPL license and as a special exception,
+ * you have permission to link or otherwise combine this program with the
+ * programs OPAL, OpenH323 and PWLIB, and distribute the combination,
+ * without applying the requirements of the GNU GPL to the OPAL, OpenH323
+ * and PWLIB programs, as long as you do follow the requirements of the
+ * GNU GPL for all the rest of the software thus combined.
+ */
+
+
+/*
+*                         display-manager-x.h -  description
+ *                         ----------------------------------
+ *   begin                : Sun Nov 19 2006
+ *   copyright            : (C) 2006-2008 by Matthias Schneider
+ *                          (C) 2000-2008 by Damien Sandras
+ *   description          : Class to allow video output to a X/XVideo
+ *                          accelerated window
+ 
+ */
+
+
+#ifndef _DISPLAY_MANAGER_X_H_
+#define _DISPLAY_MANAGER_X_H_
+
+#include "display-manager-common.h"
+
+class GMDisplayManager_x
+   : public  GMDisplayManager
+{
+public:
+  GMDisplayManager_x (Ekiga::ServiceCore & core);
+  virtual void setup_frame_display (DisplayMode display, 
+                                    unsigned lf_width, 
+                                    unsigned lf_height, 
+                                    unsigned rf_width, 
+                                    unsigned rf_height, 
+                                    unsigned int zoom) {};
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Closes the frame display and returns FALSE 
+   *                 in case of failure.
+   * PRE          :  /
+   */
+  virtual bool close_frame_display () {return true;};
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Display the given frame on the correct display.
+   * PRE          :  The display needs to be initialized using 
+   *                 SetupFrameDisplay. 
+   */
+  virtual void display_frame (const char *frame,
+                             unsigned width,
+                             unsigned height) {};
+
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Display the given frames as Picture in Picture.
+   * PRE          :  The display needs to be initialized using 
+   *                 SetupFrameDisplay. 
+   */
+  virtual void display_pip_frames (const char *local_frame,
+                                 unsigned lf_width,
+                                 unsigned lf_height,
+                                 const char *remote_frame,
+                                 unsigned rf_width,
+                                 unsigned rf_height) {};
+  
+  /* DESCRIPTION  :  /
+   * BEHAVIOR     :  Sync the output of the frame to the display
+   * PRE          :  /
+   */
+  virtual void sync(UpdateRequired sync_required) {};
+
+};
+#endif /* DISPLAY_MANAGER_X */

Modified: trunk/lib/engine/engine.cpp
==============================================================================
--- trunk/lib/engine/engine.cpp	(original)
+++ trunk/lib/engine/engine.cpp	Sun Jan 13 13:02:26 2008
@@ -51,6 +51,14 @@
 #include "gtk-core-main.h"
 #include "gtk-frontend.h"
 
+#ifndef WIN32
+#include "display-main-x.h"
+#endif
+
+#ifdef HAVE_DX
+#include "display-main-dx.h"
+#endif
+
 #include "opal-main.h"
 
 #ifdef HAVE_AVAHI
@@ -84,6 +92,21 @@
   core->add (*display_core);
   core->add (*runtime);
 
+
+#ifndef WIN32
+  if (!display_x_init (*core, &argc, &argv)) {
+    delete core;
+    return;
+  }
+#endif
+
+#ifdef HAVE_DX
+  if (!display_dx_init (*core, &argc, &argv)) {
+    delete core;
+    return;
+  }
+#endif
+
   if (!opal_init (*core, &argc, &argv)) {
     delete core;
     return;

Modified: trunk/src/Makefile.am
==============================================================================
--- trunk/src/Makefile.am	(original)
+++ trunk/src/Makefile.am	Sun Jan 13 13:02:26 2008
@@ -21,6 +21,21 @@
 	-DDATA_DIR=\""$(datadir)"\"			\
 	-DSCHEMA_AGE= SCHEMA_AGE@ 
 
+# XVideo/X
+if !WIN32
+INCLUDES +=                   				\
+	-I$(top_srcdir)/lib/engine/display/common       \
+	-I$(top_srcdir)/lib/engine/display/x
+endif
+
+# DirectX
+if HAVE_DX
+INCLUDES +=                   				\
+	-I$(top_srcdir)/lib/engine/display/common       \
+	-I$(top_srcdir)/lib/engine/display/dx
+endif
+
+
 #-DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGNOME_DISABLE_DEPRECATED
 
 bin_SCRIPTS = ekiga-config-tool

Modified: trunk/src/devices/videooutput.cpp
==============================================================================
--- trunk/src/devices/videooutput.cpp	(original)
+++ trunk/src/devices/videooutput.cpp	Sun Jan 13 13:02:26 2008
@@ -79,7 +79,7 @@
 
 /* The Methods */
 PVideoOutputDevice_EKIGA::PVideoOutputDevice_EKIGA (Ekiga::ServiceCore & _core)
-: core (_core)
+: core (_core), display_core (*(dynamic_cast<Ekiga::DisplayCore *> (_core.get ("display-core"))))
 { 
  PWaitAndSignal m(videoDisplay_mutex);
 
@@ -88,12 +88,13 @@
   /* Used to distinguish between input and output device. */
   device_id = 0; 
 
-  if (!videoDisplay) 
+  if (!videoDisplay) {
 #ifdef WIN32
      videoDisplay = new GMVideoDisplay_DX(core);
 #else
      videoDisplay = new GMVideoDisplay_X(core);
 #endif
+  }
 }
 
 
@@ -107,6 +108,7 @@
      if (videoDisplay)
        delete videoDisplay;
      videoDisplay = NULL;
+    display_core.stop();
   }
 }
 
@@ -158,12 +160,14 @@
   if (!endFrame)
     return FALSE;
 
+  if (devices_nbr == 0)
+    display_core.start();
   /* Device is now open */
   if (!is_active) {
     is_active = TRUE;
     devices_nbr = PMIN (2, devices_nbr+1);
   }
-
+  display_core.set_frame_data(width, height, (char*) data, (device_id == LOCAL), devices_nbr);
   videoDisplay->SetFrameData (width, height, data, (device_id == LOCAL), devices_nbr);
 
   return TRUE;

Modified: trunk/src/devices/videooutput.h
==============================================================================
--- trunk/src/devices/videooutput.h	(original)
+++ trunk/src/devices/videooutput.h	Sun Jan 13 13:02:26 2008
@@ -40,6 +40,7 @@
 #ifndef _EKIGAVIDEOIO_H_
 #define _EKIGAVIDEOIO_H_
 
+#include "display-core.h"
 #include "common.h"
 #include "videodisplay.h"
 
@@ -149,5 +150,7 @@
   enum {REMOTE, LOCAL};
 
   Ekiga::ServiceCore & core;
+  Ekiga::DisplayCore & display_core;
 };
+
 #endif

Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp	(original)
+++ trunk/src/gui/main.cpp	Sun Jan 13 13:02:26 2008
@@ -2219,7 +2219,7 @@
   }
   videoInfo.gc = mw->videoWidgetGC;
   videoInfo.window = GDK_WINDOW_XWINDOW (mw->main_video_image->window); // None
-  if (videoInfo.window == None)
+  if (videoInfo.window == 0)  //FIXME
     return FALSE;
   videoInfo.xdisplay = GDK_DISPLAY ();
 #endif



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