ekiga r6332 - in trunk: . lib/engine/videooutput/common lib/engine/videooutput/dx lib/engine/videooutput/skel lib/engine/videooutput/x src/gui
- From: mschneid svn gnome org
- To: svn-commits-list gnome org
- Subject: ekiga r6332 - in trunk: . lib/engine/videooutput/common lib/engine/videooutput/dx lib/engine/videooutput/skel lib/engine/videooutput/x src/gui
- Date: Wed, 28 May 2008 05:44:45 +0000 (UTC)
Author: mschneid
Date: Wed May 28 05:44:45 2008
New Revision: 6332
URL: http://svn.gnome.org/viewvc/ekiga?rev=6332&view=rev
Log:
More commenting and renaming...
Modified:
trunk/ChangeLog
trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp
trunk/lib/engine/videooutput/common/videooutput-manager-common.h
trunk/lib/engine/videooutput/dx/videooutput-manager-dx.cpp
trunk/lib/engine/videooutput/skel/videooutput-core.cpp
trunk/lib/engine/videooutput/skel/videooutput-core.h
trunk/lib/engine/videooutput/skel/videooutput-info.h
trunk/lib/engine/videooutput/skel/videooutput-manager.h
trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp
trunk/src/gui/main.cpp
Modified: trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp
==============================================================================
--- trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp (original)
+++ trunk/lib/engine/videooutput/common/videooutput-manager-common.cpp Wed May 28 05:44:45 2008
@@ -126,7 +126,7 @@
bool local,
int devices_nbr)
{
- DisplayInfo local_display_info;
+ Ekiga::DisplayInfo local_display_info;
get_display_info(local_display_info);
@@ -138,15 +138,14 @@
if (devices_nbr <= 1) {
if (!local)
- local_display_info.mode = REMOTE_VIDEO;
+ local_display_info.mode = Ekiga::VO_MODE_REMOTE;
else
- local_display_info.mode = LOCAL_VIDEO;
-
- runtime.run_in_main (sigc::bind (videooutput_mode_changed.make_slot (), local_display_info.mode));
+ local_display_info.mode = Ekiga::VO_MODE_LOCAL;
}
current_frame.mode = local_display_info.mode;
current_frame.zoom = local_display_info.zoom;
+ current_frame.both_streams_active = (devices_nbr == 2);
first_frame_received = true;
if (local) {
@@ -155,8 +154,8 @@
lframeStore.SetSize (width * height * 3);
current_frame.local_width = width;
current_frame.local_height= height;
-
memcpy (lframeStore.GetPointer(), data, (width * height * 3) >> 1);
+
if (update_required.local)
PTRACE(3, "GMVideoOutputManager\tSkipped earlier local frame");
update_required.local = true;
@@ -167,8 +166,8 @@
rframeStore.SetSize (width * height * 3);
current_frame.remote_width = width;
current_frame.remote_height= height;
-
memcpy (rframeStore.GetPointer(), data, (width * height * 3) >> 1);
+
if (update_required.remote)
PTRACE(3, "GMVideoOutputManager\tSkipped earlier remote frame");
update_required.remote = true;
@@ -176,15 +175,15 @@
var_mutex.Signal();
- if ((local_display_info.mode == UNSET) || (local_display_info.zoom == 0) || (!local_display_info.config_info_set)) {
+ if ((local_display_info.mode == Ekiga::VO_MODE_UNSET) || (local_display_info.zoom == 0) || (!local_display_info.config_info_set)) {
PTRACE(4, "GMVideoOutputManager\tDisplay and zoom variable not set yet, not opening display");
return;
}
- if ((local_display_info.mode == LOCAL_VIDEO) && !local)
+ if ((local_display_info.mode == Ekiga::VO_MODE_LOCAL) && !local)
return;
- if ((local_display_info.mode == REMOTE_VIDEO) && local)
+ if ((local_display_info.mode == Ekiga::VO_MODE_REMOTE) && local)
return;
run_thread.Signal();
@@ -194,7 +193,10 @@
void GMVideoOutputManager::init()
{
/* State for last frame */
- last_frame.mode = UNSET;
+ last_frame.mode = Ekiga::VO_MODE_UNSET;
+ last_frame.accel = Ekiga::VO_ACCEL_NO_VIDEO;
+ last_frame.both_streams_active = false;
+
last_frame.local_width = 0;
last_frame.local_height = 0;
last_frame.remote_width = 0;
@@ -203,6 +205,7 @@
last_frame.embedded_x = 0;
last_frame.embedded_y = 0;
+ current_frame.both_streams_active = false;
current_frame.local_width = 0;
current_frame.local_height = 0;
current_frame.remote_width = 0;
@@ -216,21 +219,31 @@
}
-void GMVideoOutputManager::uninit () {
+void GMVideoOutputManager::uninit ()
+{
/* This is common to all output classes */
lframeStore.SetSize (0);
rframeStore.SetSize (0);
}
+void GMVideoOutputManager::update_gui_device ()
+{
+ last_frame.both_streams_active = current_frame.both_streams_active;
+ runtime.run_in_main (device_closed.make_slot ());
+ runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
+
+}
+
+
bool
GMVideoOutputManager::frame_display_change_needed ()
{
- DisplayInfo local_display_info;
+ Ekiga::DisplayInfo local_display_info;
get_display_info(local_display_info);
if ((!local_display_info.widget_info_set) || (!local_display_info.config_info_set) ||
- (local_display_info.mode == UNSET) || (local_display_info.zoom == 0)) {
+ (local_display_info.mode == Ekiga::VO_MODE_UNSET) || (local_display_info.zoom == 0)) {
PTRACE(4, "GMVideoOutputManager\tWidget not yet realized or gconf info not yet set, not opening display");
return false;
}
@@ -239,27 +252,27 @@
return true;
switch (current_frame.mode) {
- case LOCAL_VIDEO:
+ case Ekiga::VO_MODE_LOCAL:
return ( last_frame.local_width != current_frame.local_width || last_frame.local_height != current_frame.local_height
|| local_display_info.x != last_frame.embedded_x || local_display_info.y != last_frame.embedded_y );
break;
- case REMOTE_VIDEO:
+ case Ekiga::VO_MODE_REMOTE:
return ( last_frame.remote_width != current_frame.remote_width || last_frame.remote_height != current_frame.remote_height
|| local_display_info.x != last_frame.embedded_x || local_display_info.y != last_frame.embedded_y);
break;
- case PIP:
+ case Ekiga::VO_MODE_PIP:
return ( last_frame.remote_width != current_frame.remote_width || last_frame.remote_height != current_frame.remote_height
|| last_frame.local_width != current_frame.local_width || last_frame.local_height != current_frame.local_height
|| local_display_info.x != last_frame.embedded_x || local_display_info.y != last_frame.embedded_y);
break;
- case PIP_WINDOW:
- case FULLSCREEN:
+ case Ekiga::VO_MODE_PIP_WINDOW:
+ case Ekiga::VO_MODE_FULLSCREEN:
return ( last_frame.remote_width != current_frame.remote_width || last_frame.remote_height != current_frame.remote_height
|| last_frame.local_width != current_frame.local_width || last_frame.local_height != current_frame.local_height);
break;
- case UNSET:
+ case Ekiga::VO_MODE_UNSET:
default:
break;
}
@@ -274,27 +287,30 @@
if (frame_display_change_needed ())
setup_frame_display ();
+ else
+ if (last_frame.both_streams_active != current_frame.both_streams_active)
+ update_gui_device();
switch (current_frame.mode)
{
- case LOCAL_VIDEO:
+ case Ekiga::VO_MODE_LOCAL:
if (lframeStore.GetSize() > 0)
display_frame ((char*)lframeStore.GetPointer (), current_frame.local_width, current_frame.local_height);
break;
- case REMOTE_VIDEO:
+ case Ekiga::VO_MODE_REMOTE:
if (rframeStore.GetSize() > 0)
display_frame ((char*)rframeStore.GetPointer (), current_frame.remote_width, current_frame.remote_height);
break;
- case FULLSCREEN:
- case PIP:
- case PIP_WINDOW:
+ case Ekiga::VO_MODE_FULLSCREEN:
+ case Ekiga::VO_MODE_PIP:
+ case Ekiga::VO_MODE_PIP_WINDOW:
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:
+ case Ekiga::VO_MODE_UNSET:
default:
break;
}
Modified: trunk/lib/engine/videooutput/common/videooutput-manager-common.h
==============================================================================
--- trunk/lib/engine/videooutput/common/videooutput-manager-common.h (original)
+++ trunk/lib/engine/videooutput/common/videooutput-manager-common.h Wed May 28 05:44:45 2008
@@ -78,7 +78,7 @@
bool local,
int devices_nbr);
- virtual void set_display_info (const DisplayInfo & _display_info)
+ virtual void set_display_info (const Ekiga::DisplayInfo & _display_info)
{
PWaitAndSignal m(display_info_mutex);
display_info = _display_info;
@@ -156,21 +156,26 @@
/** Uninitialises the display
*/
virtual void uninit ();
-
- virtual void get_display_info (DisplayInfo & _display_info) {
+
+ void update_gui_device();
+
+ virtual void get_display_info (Ekiga::DisplayInfo & _display_info) {
PWaitAndSignal m(display_info_mutex);
_display_info = display_info;
}
/* This variable has to be protected by display_info_mutex */
- DisplayInfo display_info;
+ Ekiga::DisplayInfo display_info;
PMutex display_info_mutex; /* To protect the DisplayInfo object */
PBYTEArray lframeStore;
PBYTEArray rframeStore;
typedef struct {
- VideoOutputMode mode;
+ Ekiga::VideoOutputMode mode;
+ Ekiga::VideoOutputAccel accel;
+ bool both_streams_active;
+
unsigned int remote_width;
unsigned int remote_height;
@@ -182,11 +187,13 @@
int embedded_x;
int embedded_y;
} FrameInfo;
+
FrameInfo last_frame;
FrameInfo current_frame;
bool first_frame_received;
bool video_disabled;
+
UpdateRequired update_required;
PSyncPoint run_thread; /* To signal the thread shall execute its tasks */
Modified: trunk/lib/engine/videooutput/dx/videooutput-manager-dx.cpp
==============================================================================
--- trunk/lib/engine/videooutput/dx/videooutput-manager-dx.cpp (original)
+++ trunk/lib/engine/videooutput/dx/videooutput-manager-dx.cpp Wed May 28 05:44:45 2008
@@ -69,27 +69,27 @@
void
GMVideoOutputManager_dx::setup_frame_display ()
{
- DisplayInfo local_display_info;
+ Ekiga::DisplayInfo local_display_info;
get_display_info(local_display_info);
// runtime.run_in_main (force_redraw.make_slot ()); //FIXME: check
switch (current_frame.mode) {
- case LOCAL_VIDEO:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
+ case Ekiga::VO_MODE_LOCAL:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
break;
- case REMOTE_VIDEO:
- case PIP:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
+ case Ekiga::VO_MODE_REMOTE:
+ case Ekiga::VO_MODE_PIP:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
break;
- case FULLSCREEN:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), 176, 144));
+ case Ekiga::VO_MODE_FULLSCREEN:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
break;
- case PIP_WINDOW:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), 176, 144));
+ case Ekiga::VO_MODE_PIP_WINDOW:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
break;
- case UNSET:
+ case Ekiga::VO_MODE_UNSET:
default:
PTRACE (1, "GMVideoOutputManager_DX\tDisplay variable not set");
return;
@@ -97,22 +97,20 @@
}
if ( (!local_display_info.widget_info_set) || (!local_display_info.config_info_set)
- || (local_display_info.mode == UNSET) || (local_display_info.zoom == 0) || (current_frame.zoom == 0)) {
+ || (local_display_info.mode == Ekiga::VO_MODE_UNSET) || (local_display_info.zoom == 0) || (current_frame.zoom == 0)) {
PTRACE(4, "GMVideoOutputManager_DX\tWidget not yet realized or gconf info not yet set, not opening display");
return;
}
close_frame_display ();
- runtime.run_in_main (sigc::bind (videooutput_mode_changed.make_slot (), current_frame.mode));
-
- VideoOutputAccel videooutput_accel = VO_ACCEL_NONE;
+ current_frame.accel = VO_ACCEL_NONE;
switch (current_frame.mode) {
- case LOCAL_VIDEO:
- PTRACE(4, "GMVideoOutputManager_DX\tOpening LOCAL_VIDEO display with image of " << current_frame.local_width << "x" << current_frame.local_height);
+ case Ekiga::VO_MODE_LOCAL:
+ PTRACE(4, "GMVideoOutputManager_DX\tOpening :VO_MODE_LOCAL display with image of " << current_frame.local_width << "x" << current_frame.local_height);
dxWindow = new DXWindow();
- videooutput_accel = (VideoOutputAccel) dxWindow->Init (local_display_info.hwnd,
+ current_frame.accel = (VideoOutputAccel) dxWindow->Init (local_display_info.hwnd,
local_display_info.x,
local_display_info.y,
(int) (current_frame.local_width * current_frame.zoom / 100),
@@ -123,16 +121,16 @@
last_frame.embedded_x = local_display_info.x;
last_frame.embedded_y = local_display_info.y;
- last_frame.mode = LOCAL_VIDEO;
+ last_frame.mode = Ekiga::VO_MODE_LOCAL;
last_frame.local_width = current_frame.local_width;
last_frame.local_height = current_frame.local_height;
last_frame.zoom = current_frame.zoom;
break;
- case REMOTE_VIDEO:
- PTRACE(4, "GMVideoOutputManager_DX\tOpening REMOTE_VIDEO display with image of " << current_frame.remote_width << "x" << current_frame.remote_height);
+ case Ekiga::VO_MODE_REMOTE:
+ PTRACE(4, "GMVideoOutputManager_DX\tOpening VO_MODE_REMOTE display with image of " << current_frame.remote_width << "x" << current_frame.remote_height);
dxWindow = new DXWindow();
- videooutput_accel = (VideoOutputAccel) dxWindow->Init (local_display_info.hwnd,
+ current_frame.accel = (VideoOutputAccel) dxWindow->Init (local_display_info.hwnd,
local_display_info.x,
local_display_info.y,
(int) (current_frame.remote_width * current_frame.zoom / 100),
@@ -143,22 +141,22 @@
last_frame.embedded_x = local_display_info.x;
last_frame.embedded_y = local_display_info.y;
- last_frame.mode = REMOTE_VIDEO;
+ last_frame.mode = Ekiga::VO_MODE_REMOTE;
last_frame.remote_width = current_frame.remote_width;
last_frame.remote_height = current_frame.remote_height;
last_frame.zoom = current_frame.zoom;
break;
- case FULLSCREEN:
- case PIP:
- case PIP_WINDOW:
+ case Ekiga::VO_MODE_FULLSCREEN:
+ case Ekiga::VO_MODE_PIP:
+ case Ekiga::VO_MODE_PIP_WINDOW:
PTRACE(4, "GMVideoOutputManager_DX\tOpening display " << current_frame.mode << " with images of "
<< current_frame.local_width << "x" << current_frame.local_height << "(local) and "
<< current_frame.remote_width << "x" << current_frame.remote_height << "(remote)");
dxWindow = new DXWindow();
- videooutput_accel = (VideoOutputAccel) dxWindow->Init ((current_frame.mode == PIP) ? local_display_info.hwnd : NULL,
- (current_frame.mode == PIP) ? local_display_info.x : 0,
- (current_frame.mode == PIP) ? local_display_info.y : 0,
+ current_frame.accel = (VideoOutputAccel) dxWindow->Init ((current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.hwnd : NULL,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.x : 0,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.y : 0,
(int) (current_frame.remote_width * current_frame.zoom / 100),
(int) (current_frame.remote_height * current_frame.zoom / 100),
current_frame.remote_width,
@@ -166,7 +164,7 @@
current_frame.local_width,
current_frame.local_height);
- if (dxWindow && current_frame.mode == FULLSCREEN)
+ if (dxWindow && current_frame.mode == Ekiga::VO_MODE_FULLSCREEN)
dxWindow->ToggleFullscreen ();
last_frame.embedded_x = local_display_info.x;
@@ -180,7 +178,7 @@
last_frame.zoom = current_frame.zoom;
break;
- case UNSET:
+ case Ekiga::VO_MODE_UNSET:
default:
return;
break;
@@ -193,7 +191,8 @@
// if (!status)
// close_frame_display ();
- runtime.run_in_main (sigc::bind (device_opened.make_slot (), videooutput_accel));
+ last_frame.both_streams_active = current_frame.both_streams_active;
+ runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
}
void
@@ -230,8 +229,8 @@
if (dxWindow)
dxWindow->ProcessEvents();
- if (current_frame.mode == FULLSCREEN && dxWindow && !dxWindow->IsFullScreen ())
- runtime.run_in_main (sigc::bind (fullscreen_mode_changed.make_slot (), OFF));
+ if (current_frame.mode == Ekiga::VO_MODE_FULLSCREEN && dxWindow && !dxWindow->IsFullScreen ())
+ runtime.run_in_main (sigc::bind (fullscreen_mode_changed.make_slot (), Ekiga::VO_FS_OFF));
if (dxWindow) {
if (update_required.remote || (!update_required.remote && !update_required.local))
Modified: trunk/lib/engine/videooutput/skel/videooutput-core.cpp
==============================================================================
--- trunk/lib/engine/videooutput/skel/videooutput-core.cpp (original)
+++ trunk/lib/engine/videooutput/skel/videooutput-core.cpp Wed May 28 05:44:45 2008
@@ -48,7 +48,7 @@
VideoOutputCore::VideoOutputCore ()
{
- PWaitAndSignal m(var_mutex);
+ PWaitAndSignal m(core_mutex);
videooutput_stats.rx_width = videooutput_stats.rx_height = videooutput_stats.rx_fps = 0;
videooutput_stats.tx_width = videooutput_stats.tx_height = videooutput_stats.tx_fps = 0;
@@ -64,7 +64,7 @@
std::cout << __PRETTY_FUNCTION__ << std::endl;
#endif
- PWaitAndSignal m(var_mutex);
+ PWaitAndSignal m(core_mutex);
if (videooutput_core_conf_bridge)
delete videooutput_core_conf_bridge;
@@ -72,24 +72,22 @@
void VideoOutputCore::setup_conf_bridge ()
{
- PWaitAndSignal m(var_mutex);
+ PWaitAndSignal m(core_mutex);
videooutput_core_conf_bridge = new VideoOutputCoreConfBridge (*this);
}
void VideoOutputCore::add_manager (VideoOutputManager &manager)
{
- PWaitAndSignal m(var_mutex);
+ PWaitAndSignal m(core_mutex);
managers.insert (&manager);
manager_added.emit (manager);
manager.device_opened.connect (sigc::bind (sigc::mem_fun (this, &VideoOutputCore::on_device_opened), &manager));
manager.device_closed.connect (sigc::bind (sigc::mem_fun (this, &VideoOutputCore::on_device_closed), &manager));
- manager.videooutput_mode_changed.connect (sigc::bind (sigc::mem_fun (this, &VideoOutputCore::on_videooutput_mode_changed), &manager));
manager.fullscreen_mode_changed.connect (sigc::bind (sigc::mem_fun (this, &VideoOutputCore::on_fullscreen_mode_changed), &manager));
- manager.display_size_changed.connect (sigc::bind (sigc::mem_fun (this, &VideoOutputCore::on_display_size_changed), &manager));
- manager.logo_update_required.connect (sigc::bind (sigc::mem_fun (this, &VideoOutputCore::on_logo_update_required), &manager));
+ manager.size_changed.connect (sigc::bind (sigc::mem_fun (this, &VideoOutputCore::on_size_changed), &manager));
}
@@ -106,7 +104,7 @@
void VideoOutputCore::start ()
{
- PWaitAndSignal m(var_mutex);
+ PWaitAndSignal m(core_mutex);
number_times_started++;
if (number_times_started > 1)
@@ -123,7 +121,7 @@
void VideoOutputCore::stop ()
{
- PWaitAndSignal m(var_mutex);
+ PWaitAndSignal m(core_mutex);
number_times_started--;
@@ -152,7 +150,7 @@
bool local,
int devices_nbr)
{
- var_mutex.Wait ();
+ core_mutex.Wait ();
if (local) {
videooutput_stats.tx_frames++;
@@ -179,7 +177,7 @@
g_get_current_time (&last_stats);
}
- var_mutex.Signal ();
+ core_mutex.Signal ();
for (std::set<VideoOutputManager *>::iterator iter = managers.begin ();
iter != managers.end ();
@@ -190,7 +188,7 @@
void VideoOutputCore::set_display_info (const DisplayInfo & _display_info)
{
- PWaitAndSignal m(var_mutex);
+ PWaitAndSignal m(core_mutex);
for (std::set<VideoOutputManager *>::iterator iter = managers.begin ();
iter != managers.end ();
@@ -200,9 +198,9 @@
}
-void VideoOutputCore::on_device_opened (VideoOutputAccel videooutput_accel, VideoOutputManager *manager)
+void VideoOutputCore::on_device_opened (VideoOutputAccel videooutput_accel, VideoOutputMode mode, unsigned zoom, bool both_streams, VideoOutputManager *manager)
{
- device_opened.emit (*manager, videooutput_accel);
+ device_opened.emit (*manager, videooutput_accel, mode, zoom, both_streams);
}
void VideoOutputCore::on_device_closed ( VideoOutputManager *manager)
@@ -210,22 +208,13 @@
device_closed.emit (*manager);
}
-void VideoOutputCore::on_videooutput_mode_changed (VideoOutputMode mode, VideoOutputManager *manager)
-{
- videooutput_mode_changed.emit (*manager, mode);
-}
-
-void VideoOutputCore::on_fullscreen_mode_changed ( FSToggle toggle, VideoOutputManager *manager)
+void VideoOutputCore::on_fullscreen_mode_changed ( VideoOutputFSToggle toggle, VideoOutputManager *manager)
{
fullscreen_mode_changed.emit (*manager, toggle);
}
-void VideoOutputCore::on_display_size_changed ( unsigned width, unsigned height, VideoOutputManager *manager)
+void VideoOutputCore::on_size_changed ( unsigned width, unsigned height, VideoOutputManager *manager)
{
- display_size_changed.emit (*manager, width, height);
+ size_changed.emit (*manager, width, height);
}
-void VideoOutputCore::on_logo_update_required (VideoOutputManager *manager)
-{
- logo_update_required.emit (*manager);
-}
Modified: trunk/lib/engine/videooutput/skel/videooutput-core.h
==============================================================================
--- trunk/lib/engine/videooutput/skel/videooutput-core.h (original)
+++ trunk/lib/engine/videooutput/skel/videooutput-core.h Wed May 28 05:44:45 2008
@@ -69,16 +69,19 @@
public:
- /* The constructor
+ /** The constructor
*/
VideoOutputCore ();
- /* The destructor
+ /** The destructor
*/
~VideoOutputCore ();
+ /** Set up gmconf bridge
+ */
void setup_conf_bridge();
+
/*** Service Implementation ***/
/** Returns the name of the service.
@@ -111,12 +114,21 @@
sigc::signal<void, VideoOutputManager &> manager_added;
- /*** Display Management ***/
+ /*** Videooutput Management ***/
+ /** Start the video output
+ * Must be called before outputting frames via set_frame_data()
+ */
void start ();
+ /** Stop the video output
+ *
+ */
void stop ();
+ /** Display a single frame
+ * Pass the pointer to the frame to all registered mangers.
+ */
void set_frame_data (const char *data,
unsigned width,
unsigned height,
@@ -125,29 +137,33 @@
void set_display_info (const DisplayInfo & _display_info);
- /*** Display Related Signals ***/
-
- /** See display-manager.h for the API
- */
- sigc::signal<void, VideoOutputManager &, VideoOutputAccel> device_opened;
- sigc::signal<void, VideoOutputManager &> device_closed;
- sigc::signal<void, VideoOutputManager &, VideoOutputMode> videooutput_mode_changed;
- sigc::signal<void, VideoOutputManager &, FSToggle> fullscreen_mode_changed;
- sigc::signal<void, VideoOutputManager &, unsigned, unsigned> display_size_changed;
- sigc::signal<void, VideoOutputManager &> logo_update_required;
/*** Statistics ***/
+
+ /** Get the current video output statistics from the core
+ *
+ * @param _videooutput_stats the struct to be filled with the current values..
+ */
void get_videooutput_stats (VideoOutputStats & _videooutput_stats) {
_videooutput_stats = videooutput_stats;
};
+
+
+ /*** Display Related Signals ***/
+
+ /** See videooutput-manager.h for the API
+ */
+ sigc::signal<void, VideoOutputManager &, VideoOutputAccel, VideoOutputMode, unsigned, bool> device_opened;
+ sigc::signal<void, VideoOutputManager &> device_closed;
+ sigc::signal<void, VideoOutputManager &, VideoOutputFSToggle> fullscreen_mode_changed;
+ sigc::signal<void, VideoOutputManager &, unsigned, unsigned> size_changed;
+
+
private:
- void on_device_opened (VideoOutputAccel videooutput_accel, VideoOutputManager *manager);
+ void on_device_opened (VideoOutputAccel videooutput_accel, VideoOutputMode mode, unsigned zoom, bool both_streams, VideoOutputManager *manager);
void on_device_closed (VideoOutputManager *manager);
-
- void on_videooutput_mode_changed (VideoOutputMode mode, VideoOutputManager *manager);
- void on_fullscreen_mode_changed (FSToggle toggle, VideoOutputManager *manager);
- void on_display_size_changed ( unsigned width, unsigned height, VideoOutputManager *manager);
- void on_logo_update_required (VideoOutputManager *manager);
+ void on_size_changed ( unsigned width, unsigned height, VideoOutputManager *manager);
+ void on_fullscreen_mode_changed (VideoOutputFSToggle toggle, VideoOutputManager *manager);
std::set<VideoOutputManager *> managers;
@@ -155,7 +171,7 @@
GTimeVal last_stats;
int number_times_started;
- PMutex var_mutex; /* Protect start, stop and number_times_started */
+ PMutex core_mutex;
VideoOutputCoreConfBridge* videooutput_core_conf_bridge;
};
Modified: trunk/lib/engine/videooutput/skel/videooutput-info.h
==============================================================================
--- trunk/lib/engine/videooutput/skel/videooutput-info.h (original)
+++ trunk/lib/engine/videooutput/skel/videooutput-info.h Wed May 28 05:44:45 2008
@@ -48,7 +48,8 @@
#undef BadRequest
#endif
#endif
-//namespace Ekiga {
+
+namespace Ekiga {
/**
* @addtogroup display
@@ -58,21 +59,21 @@
/* Video modes */
typedef enum {
- LOCAL_VIDEO,
- REMOTE_VIDEO,
- PIP,
- PIP_WINDOW,
- FULLSCREEN,
- UNSET
+ VO_MODE_LOCAL,
+ VO_MODE_REMOTE,
+ VO_MODE_PIP,
+ VO_MODE_PIP_WINDOW,
+ VO_MODE_FULLSCREEN,
+ VO_MODE_UNSET
} VideoOutputMode;
/* Toggle operations for Fullscreen */
typedef enum {
- ON,
- OFF,
- TOGGLE
- } FSToggle;
+ VO_FS_ON,
+ VO_FS_OFF,
+ VO_FS_TOGGLE
+ } VideoOutputFSToggle;
/* Video Acceleration Status */
typedef enum {
@@ -116,7 +117,7 @@
allow_pip_sw_scaling = true;
sw_scaling_algorithm = 0;
- mode = UNSET;
+ mode = VO_MODE_UNSET;
zoom = 0;
};
@@ -142,7 +143,7 @@
allow_pip_sw_scaling = rhs.allow_pip_sw_scaling;
sw_scaling_algorithm = rhs.sw_scaling_algorithm;
}
- if (rhs.mode != UNSET) mode = rhs.mode;
+ if (rhs.mode != VO_MODE_UNSET) mode = rhs.mode;
if (rhs.zoom != 0) zoom = rhs.zoom;
};
@@ -172,6 +173,6 @@
* @}
*/
-//};
+};
#endif
Modified: trunk/lib/engine/videooutput/skel/videooutput-manager.h
==============================================================================
--- trunk/lib/engine/videooutput/skel/videooutput-manager.h (original)
+++ trunk/lib/engine/videooutput/skel/videooutput-manager.h Wed May 28 05:44:45 2008
@@ -101,16 +101,14 @@
/** This signal is emitted when a video output device is opened.
* @param hw_accel_status actual hardware acceleration support active on the video output device opened).
*/
- sigc::signal<void, VideoOutputAccel> device_opened;
+ sigc::signal<void, VideoOutputAccel, VideoOutputMode, unsigned, bool> device_opened;
/** This signal is emitted when a video output device is closed.
*/
sigc::signal<void> device_closed;
- sigc::signal<void, VideoOutputMode> videooutput_mode_changed;
- sigc::signal<void, FSToggle> fullscreen_mode_changed;
- sigc::signal<void, unsigned, unsigned> display_size_changed;
- sigc::signal<void> logo_update_required;
+ sigc::signal<void, VideoOutputFSToggle> fullscreen_mode_changed;
+ sigc::signal<void, unsigned, unsigned> size_changed;
protected:
virtual void get_display_info (DisplayInfo &) { };
Modified: trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp
==============================================================================
--- trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp (original)
+++ trunk/lib/engine/videooutput/x/videooutput-manager-x.cpp Wed May 28 05:44:45 2008
@@ -80,21 +80,21 @@
{
switch (current_frame.mode)
{
- case LOCAL_VIDEO:
+ case Ekiga::VO_MODE_LOCAL:
if (!lxWindow)
return true;
break;
- case REMOTE_VIDEO:
+ case Ekiga::VO_MODE_REMOTE:
if (!rxWindow)
return true;
break;
- case FULLSCREEN:
- case PIP:
- case PIP_WINDOW:
+ case Ekiga::VO_MODE_FULLSCREEN:
+ case Ekiga::VO_MODE_PIP:
+ case Ekiga::VO_MODE_PIP_WINDOW:
if (!rxWindow || (pip_window_available && (!lxWindow)) )
return true;
break;
- case UNSET:
+ case Ekiga::VO_MODE_UNSET:
default:
break;
}
@@ -105,7 +105,7 @@
void
GMVideoOutputManager_x::setup_frame_display ()
{
- DisplayInfo local_display_info;
+ Ekiga::DisplayInfo local_display_info;
if (video_disabled)
return;
@@ -113,20 +113,20 @@
get_display_info(local_display_info);
switch (current_frame.mode) {
- case LOCAL_VIDEO:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
+ case Ekiga::VO_MODE_LOCAL:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), (unsigned) (current_frame.local_width * current_frame.zoom / 100), (unsigned) (current_frame.local_height * current_frame.zoom / 100)));
break;
- case REMOTE_VIDEO:
- case PIP:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
+ case Ekiga::VO_MODE_REMOTE:
+ case Ekiga::VO_MODE_PIP:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), (unsigned) (current_frame.remote_width * current_frame.zoom / 100), (unsigned) (current_frame.remote_height * current_frame.zoom / 100)));
break;
- case FULLSCREEN:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), 176, 144));
+ case Ekiga::VO_MODE_FULLSCREEN:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
break;
- case PIP_WINDOW:
- runtime.run_in_main (sigc::bind (display_size_changed.make_slot (), 176, 144));
+ case Ekiga::VO_MODE_PIP_WINDOW:
+ runtime.run_in_main (sigc::bind (size_changed.make_slot (), 176, 144));
break;
- case UNSET:
+ case Ekiga::VO_MODE_UNSET:
default:
PTRACE (1, "GMVideoOutputManager_X\tDisplay variable not set");
return;
@@ -134,23 +134,21 @@
}
if ((!local_display_info.widget_info_set) || (!local_display_info.config_info_set) ||
- (local_display_info.mode == UNSET) || (local_display_info.zoom == 0) || (current_frame.zoom == 0)) {
+ (local_display_info.mode == Ekiga::VO_MODE_UNSET) || (local_display_info.zoom == 0) || (current_frame.zoom == 0)) {
PTRACE(4, "GMVideoOutputManager_X\tWidget not yet realized or gconf info not yet set, not opening display");
return;
}
close_frame_display ();
- runtime.run_in_main (sigc::bind (videooutput_mode_changed.make_slot (), current_frame.mode));
-
pip_window_available = false;
- VideoOutputAccel videooutput_accel = VO_ACCEL_NONE;
+ current_frame.accel = Ekiga::VO_ACCEL_NONE;
switch (current_frame.mode) {
-// LOCAL_VIDEO ------------------------------------------------------------------
- case LOCAL_VIDEO:
- PTRACE(4, "GMVideoOutputManager_X\tOpening LOCAL_VIDEO display with image of " << current_frame.local_width << "x" << current_frame.local_height);
+// VO_MODE_LOCAL ------------------------------------------------------------------
+ case Ekiga::VO_MODE_LOCAL:
+ PTRACE(4, "GMVideoOutputManager_X\tOpening VO_MODE_LOCAL display with image of " << current_frame.local_width << "x" << current_frame.local_height);
#ifdef HAVE_XV
if (!local_display_info.disable_hw_accel) {
lxWindow = new XVWindow ();
@@ -163,18 +161,18 @@
(int) (current_frame.local_height * current_frame.zoom / 100),
current_frame.local_width,
current_frame.local_height)) {
- videooutput_accel = VO_ACCEL_ALL;
- PTRACE(4, "GMVideoOutputManager_X\tLOCAL_VIDEO: Successfully opened XV Window");
+ current_frame.accel = Ekiga::VO_ACCEL_ALL;
+ PTRACE(4, "GMVideoOutputManager_X\tVO_MODE_LOCAL: Successfully opened XV Window");
}
else {
delete lxWindow;
lxWindow = NULL;
- videooutput_accel = VO_ACCEL_NONE;
- PTRACE(4, "GMVideoOutputManager_X\tLOCAL_VIDEO: Could not open XV Window");
+ current_frame.accel = Ekiga::VO_ACCEL_NONE;
+ PTRACE(4, "GMVideoOutputManager_X\tVO_MODE_LOCAL: Could not open XV Window");
}
}
#endif
- if (videooutput_accel == VO_ACCEL_NONE) {
+ if (current_frame.accel == Ekiga::VO_ACCEL_NONE) {
PTRACE(3, "GMVideoOutputManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel)
? " since HW acceleration was deactivated by configuration"
: " since HW acceleration failed to initalize"));
@@ -189,29 +187,29 @@
current_frame.local_width,
current_frame.local_height)) {
lxWindow->SetSwScalingAlgo(local_display_info.sw_scaling_algorithm);
- PTRACE(4, "GMVideoOutputManager_X\tLOCAL_VIDEO: Successfully opened X Window");
+ PTRACE(4, "GMVideoOutputManager_X\tVO_MODE_LOCAL: Successfully opened X Window");
}
else {
delete lxWindow;
lxWindow = NULL;
video_disabled = true;
- videooutput_accel = VO_ACCEL_NO_VIDEO;
- PTRACE(1, "GMVideoOutputManager_X\tLOCAL_VIDEO: Could not open X Window - no video");
+ current_frame.accel = Ekiga::VO_ACCEL_NO_VIDEO;
+ PTRACE(1, "GMVideoOutputManager_X\tVO_MODE_LOCAL: Could not open X Window - no video");
}
}
last_frame.embedded_x = local_display_info.x;
last_frame.embedded_y = local_display_info.y;
- last_frame.mode = LOCAL_VIDEO;
+ last_frame.mode = Ekiga::VO_MODE_LOCAL;
last_frame.local_width = current_frame.local_width;
last_frame.local_height = current_frame.local_height;
last_frame.zoom = current_frame.zoom;
break;
-// REMOTE_VIDEO ----------------------------------------------------------------
- case REMOTE_VIDEO:
- PTRACE(4, "GMVideoOutputManager_X\tOpening REMOTE_VIDEO display with image of " << current_frame.remote_width << "x" << current_frame.remote_height);
+// VO_MODE_REMOTE ----------------------------------------------------------------
+ case Ekiga::VO_MODE_REMOTE:
+ PTRACE(4, "GMVideoOutputManager_X\tOpening VO_MODE_REMOTE display with image of " << current_frame.remote_width << "x" << current_frame.remote_height);
#ifdef HAVE_XV
if (!local_display_info.disable_hw_accel) {
rxWindow = new XVWindow ();
@@ -224,19 +222,19 @@
(int) (current_frame.remote_height * current_frame.zoom / 100),
current_frame.remote_width,
current_frame.remote_height)) {
- videooutput_accel = VO_ACCEL_ALL;
- PTRACE(4, "GMVideoOutputManager_X\tREMOTE_VIDEO: Successfully opened XV Window");
+ current_frame.accel = Ekiga::VO_ACCEL_ALL;
+ PTRACE(4, "GMVideoOutputManager_X\tVO_MODE_REMOTE: Successfully opened XV Window");
}
else {
delete rxWindow;
rxWindow = NULL;
- videooutput_accel = VO_ACCEL_NONE;
- PTRACE(1, "GMVideoOutputManager_X\tLOCAL_VIDEO: Could not open XV Window");
+ current_frame.accel = Ekiga::VO_ACCEL_NONE;
+ PTRACE(1, "GMVideoOutputManager_X\tVO_MODE_LOCAL: Could not open XV Window");
}
}
#endif
- if (videooutput_accel == VO_ACCEL_NONE) {
+ if (current_frame.accel == Ekiga::VO_ACCEL_NONE) {
PTRACE(3, "GMVideoOutputManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel)
? " since HW acceleration was deactivated by configuration"
: " since HW acceleration failed to initalize"));
@@ -251,30 +249,30 @@
current_frame.remote_width,
current_frame.remote_height)) {
rxWindow->SetSwScalingAlgo(local_display_info.sw_scaling_algorithm);
- PTRACE(4, "GMVideoOutputManager_X\tREMOTE_VIDEO: Successfully opened X Window");
+ PTRACE(4, "GMVideoOutputManager_X\tVO_MODE_REMOTE: Successfully opened X Window");
}
else {
delete rxWindow;
rxWindow = NULL;
video_disabled = true;
- videooutput_accel = VO_ACCEL_NO_VIDEO;
- PTRACE(1, "GMVideoOutputManager_X\tREMOTE_VIDEO: Could not open X Window - no video");
+ current_frame.accel = Ekiga::VO_ACCEL_NO_VIDEO;
+ PTRACE(1, "GMVideoOutputManager_X\tVO_MODE_REMOTE: Could not open X Window - no video");
}
}
last_frame.embedded_x = local_display_info.x;
last_frame.embedded_y = local_display_info.y;
- last_frame.mode = REMOTE_VIDEO;
+ last_frame.mode = Ekiga::VO_MODE_REMOTE;
last_frame.remote_width = current_frame.remote_width;
last_frame.remote_height = current_frame.remote_height;
last_frame.zoom = current_frame.zoom;
break;
// PIP_VIDEO ------------------------------------------------------------------
- case FULLSCREEN:
- case PIP:
- case PIP_WINDOW:
+ case Ekiga::VO_MODE_FULLSCREEN:
+ case Ekiga::VO_MODE_PIP:
+ case Ekiga::VO_MODE_PIP_WINDOW:
PTRACE(4, "GMVideoOutputManager_X\tOpening display " << current_frame.mode << " with images of "
<< current_frame.local_width << "x" << current_frame.local_height << "(local) and "
<< current_frame.remote_width << "x" << current_frame.remote_height << "(remote)");
@@ -282,36 +280,36 @@
if (!local_display_info.disable_hw_accel) {
rxWindow = new XVWindow ();
if (rxWindow->Init ( rDisplay,
- (current_frame.mode == PIP) ? local_display_info.window : DefaultRootWindow (rDisplay),
- (current_frame.mode == PIP) ? local_display_info.gc : NULL,
- (current_frame.mode == PIP) ? local_display_info.x : 0,
- (current_frame.mode == PIP) ? local_display_info.y : 0,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.window : DefaultRootWindow (rDisplay),
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.gc : NULL,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.x : 0,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.y : 0,
(int) (current_frame.remote_width * current_frame.zoom / 100),
(int) (current_frame.remote_height * current_frame.zoom / 100),
current_frame.remote_width,
current_frame.remote_height)) {
- videooutput_accel = VO_ACCEL_REMOTE_ONLY;
+ current_frame.accel = Ekiga::VO_ACCEL_REMOTE_ONLY;
PTRACE(4, "GMVideoOutputManager_X\tPIP: Successfully opened remote XV Window");
}
else
{
delete rxWindow;
rxWindow = NULL;
- videooutput_accel = VO_ACCEL_NONE;
+ current_frame.accel = Ekiga::VO_ACCEL_NONE;
PTRACE(1, "GMVideoOutputManager_X\tPIP: Could not open remote XV Window");
}
}
#endif
- if (videooutput_accel == VO_ACCEL_NONE) {
+ if (current_frame.accel == Ekiga::VO_ACCEL_NONE) {
PTRACE(3, "GMVideoOutputManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel)
? " since HW acceleration was deactivated by configuration"
: " since HW acceleration failed to initalize"));
rxWindow = new XWindow ();
if (rxWindow->Init ( rDisplay,
- (current_frame.mode == PIP) ? local_display_info.window : DefaultRootWindow (rDisplay),
- (current_frame.mode == PIP) ? local_display_info.gc : NULL,
- (current_frame.mode == PIP) ? local_display_info.x : 0,
- (current_frame.mode == PIP) ? local_display_info.y : 0,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.window : DefaultRootWindow (rDisplay),
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.gc : NULL,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.x : 0,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.y : 0,
(int) (current_frame.remote_width * current_frame.zoom / 100),
(int) (current_frame.remote_height * current_frame.zoom / 100),
current_frame.remote_width,
@@ -323,14 +321,14 @@
delete rxWindow;
rxWindow = NULL;
video_disabled = true;
- videooutput_accel = VO_ACCEL_NO_VIDEO;
+ current_frame.accel = Ekiga::VO_ACCEL_NO_VIDEO;
PTRACE(1, "GMVideoOutputManager_X\tPIP: Could not open remote X Window - no video");
}
}
#ifdef HAVE_XV
- if (videooutput_accel == VO_ACCEL_REMOTE_ONLY) {
+ if (current_frame.accel == Ekiga::VO_ACCEL_REMOTE_ONLY) {
lxWindow = new XVWindow();
if (lxWindow->Init ( rxWindow->GetDisplay (),
rxWindow->GetWindowHandle (),
@@ -341,7 +339,7 @@
(int) (current_frame.remote_height * current_frame.zoom / 100 / 3),
current_frame.local_width,
current_frame.local_height)) {
- videooutput_accel = VO_ACCEL_ALL;
+ current_frame.accel = Ekiga::VO_ACCEL_ALL;
pip_window_available = true;
PTRACE(4, "GMVideoOutputManager_X\tPIP: Successfully opened local XV Window");
}
@@ -353,14 +351,14 @@
}
}
#endif
- if ((videooutput_accel != VO_ACCEL_ALL) && (local_display_info.allow_pip_sw_scaling)) {
+ if ((current_frame.accel != Ekiga::VO_ACCEL_ALL) && (local_display_info.allow_pip_sw_scaling)) {
PTRACE(3, "GMVideoOutputManager_X\tFalling back to SW" << ((local_display_info.disable_hw_accel)
? " since HW acceleration was deactivated by configuration"
: " since HW acceleration failed to initalize"));
lxWindow = new XWindow ();
if (lxWindow->Init ( lDisplay,
rxWindow->GetWindowHandle (),
- (current_frame.mode == PIP) ? local_display_info.gc : NULL,
+ (current_frame.mode == Ekiga::VO_MODE_PIP) ? local_display_info.gc : NULL,
(int) (current_frame.remote_width * current_frame.zoom / 100 * 2 / 3),
(int) (current_frame.remote_height * current_frame.zoom / 100 * 2 / 3),
(int) (current_frame.remote_width * current_frame.zoom / 100 / 3),
@@ -379,9 +377,9 @@
}
}
- if ((videooutput_accel != VO_ACCEL_ALL) && (!local_display_info.allow_pip_sw_scaling)) {
+ if ((current_frame.accel != Ekiga::VO_ACCEL_ALL) && (!local_display_info.allow_pip_sw_scaling)) {
PTRACE(3, "GMVideoOutputManager_X\tNot opening PIP window since HW acceleration is not available and SW fallback is disabled by configuration");
- videooutput_accel = VO_ACCEL_ALL;
+ current_frame.accel = Ekiga::VO_ACCEL_ALL;
}
if (rxWindow && lxWindow) {
@@ -390,10 +388,10 @@
lxWindow->RegisterMaster (rxWindow);
}
- if (rxWindow && current_frame.mode == FULLSCREEN)
+ if (rxWindow && current_frame.mode == Ekiga::VO_MODE_FULLSCREEN)
rxWindow->ToggleFullscreen ();
- if ((current_frame.mode != PIP_WINDOW) && (current_frame.mode != FULLSCREEN)) {
+ if ((current_frame.mode != Ekiga::VO_MODE_PIP_WINDOW) && (current_frame.mode != Ekiga::VO_MODE_FULLSCREEN)) {
last_frame.embedded_x = local_display_info.x;
last_frame.embedded_y = local_display_info.y;
}
@@ -406,7 +404,7 @@
last_frame.zoom = current_frame.zoom;
break;
- case UNSET:
+ case Ekiga::VO_MODE_UNSET:
default:
return;
break;
@@ -420,7 +418,8 @@
rxWindow->ToggleOntop ();
}
- runtime.run_in_main (sigc::bind (device_opened.make_slot (), videooutput_accel));
+ last_frame.both_streams_active = current_frame.both_streams_active;
+ runtime.run_in_main (sigc::bind (device_opened.make_slot (), current_frame.accel, current_frame.mode, current_frame.zoom, current_frame.both_streams_active));
}
void
@@ -455,10 +454,10 @@
if (lxWindow)
lxWindow->ProcessEvents();
- if ((current_frame.mode == LOCAL_VIDEO) && (lxWindow))
+ if ((current_frame.mode == Ekiga::VO_MODE_LOCAL) && (lxWindow))
lxWindow->PutFrame ((uint8_t *) frame, width, height);
- if ((current_frame.mode == REMOTE_VIDEO) && (rxWindow))
+ if ((current_frame.mode == Ekiga::VO_MODE_REMOTE) && (rxWindow))
rxWindow->PutFrame ((uint8_t *) frame, width, height);
}
@@ -476,8 +475,8 @@
if (lxWindow)
lxWindow->ProcessEvents();
- if (current_frame.mode == FULLSCREEN && rxWindow && !rxWindow->IsFullScreen ())
- runtime.run_in_main (sigc::bind (fullscreen_mode_changed.make_slot (), OFF));
+ if (current_frame.mode == Ekiga::VO_MODE_FULLSCREEN && rxWindow && !rxWindow->IsFullScreen ())
+ runtime.run_in_main (sigc::bind (fullscreen_mode_changed.make_slot (), Ekiga::VO_FS_OFF));
if (rxWindow && (update_required.remote || (!update_required.remote && !update_required.local)))
rxWindow->PutFrame ((uint8_t *) remote_frame, rf_width, rf_height);
Modified: trunk/src/gui/main.cpp
==============================================================================
--- trunk/src/gui/main.cpp (original)
+++ trunk/src/gui/main.cpp Wed May 28 05:44:45 2008
@@ -290,7 +290,7 @@
static void gm_mw_zooms_menu_update_sensitivity (GtkWidget *,
unsigned int);
-void gm_main_window_toggle_fullscreen (FSToggle toggle,
+void gm_main_window_toggle_fullscreen (Ekiga::VideoOutputFSToggle toggle,
GtkWidget *main_window);
static void gm_main_window_show_call_panel (GtkWidget *self);
@@ -657,7 +657,7 @@
if (mw->current_call) {
- VideoOutputStats videooutput_stats;
+ Ekiga::VideoOutputStats videooutput_stats;
Ekiga::VideoOutputCore *videooutput_core = dynamic_cast<Ekiga::VideoOutputCore *> (mw->core.get ("videooutput-core"));
videooutput_core->get_videooutput_stats(videooutput_stats);
@@ -958,31 +958,57 @@
*/
void
-on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* manager */, VideoOutputAccel /* accel */, gpointer /*self*/)
+on_videooutput_device_opened_cb (Ekiga::VideoOutputManager & /* manager */,
+ Ekiga::VideoOutputAccel /* accel */,
+ Ekiga::VideoOutputMode mode,
+ unsigned zoom,
+ bool both_streams,
+ gpointer self)
{
-}
+ GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
-void
-on_videooutput_device_closed_cb (Ekiga::VideoOutputManager & /* manager */, gpointer /*self*/)
-{
+ if (both_streams) {
+ gtk_menu_section_set_sensitive (mw->main_menu, "local_video", TRUE);
+ gtk_menu_section_set_sensitive (mw->main_menu, "fullscreen", TRUE);
+ }
+ else {
+
+ if (mode == Ekiga::VO_MODE_LOCAL)
+ gtk_menu_set_sensitive (mw->main_menu, "local_video", TRUE);
+
+ if (mode == Ekiga::VO_MODE_REMOTE)
+ gtk_menu_set_sensitive (mw->main_menu, "remote_video", TRUE);
+ }
+
+ gtk_radio_menu_select_with_id (mw->main_menu, "local_video", mode);
+
+ gtk_menu_set_sensitive (mw->main_menu, "zoom_in", (zoom == 200) ? FALSE : TRUE);
+ gtk_menu_set_sensitive (mw->main_menu, "zoom_out", (zoom == 50) ? FALSE : TRUE);
+ gtk_menu_set_sensitive (mw->main_menu, "normal_size", (zoom == 100) ? FALSE : TRUE);
}
void
-on_videooutput_mode_changed_cb (Ekiga::VideoOutputManager & /* manager */, VideoOutputMode mode, gpointer self)
+on_videooutput_device_closed_cb (Ekiga::VideoOutputManager & /* manager */, gpointer self)
{
GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
- gtk_radio_menu_select_with_id (mw->main_menu, "local_video", mode);
+ gtk_menu_section_set_sensitive (mw->main_menu, "local_video", FALSE);
+
+ gtk_menu_section_set_sensitive (mw->main_menu, "fullscreen", TRUE);
+
+ gtk_menu_section_set_sensitive (mw->main_menu, "zoom_in", FALSE);
+
+// gm_main_window_update_logo_have_window (GTK_WIDGET (self));
}
void
-on_fullscreen_mode_changed_cb (Ekiga::VideoOutputManager & /* manager */, FSToggle toggle, gpointer self)
+on_fullscreen_mode_changed_cb (Ekiga::VideoOutputManager & /* manager */, Ekiga::VideoOutputFSToggle toggle, gpointer self)
{
gm_main_window_toggle_fullscreen (toggle, GTK_WIDGET (self));
}
void
-on_display_size_changed_cb (Ekiga::VideoOutputManager & /* manager */, unsigned width, unsigned height, gpointer self)
+on_size_changed_cb (Ekiga::VideoOutputManager & /* manager */, unsigned width, unsigned height, gpointer self)
{
GmMainWindow *mw = gm_mw_get_mw (GTK_WIDGET (self));
@@ -1250,12 +1276,6 @@
g_free (tmp_msg);
}
-void
-on_logo_update_required_cb (Ekiga::VideoOutputManager & /* manager */,
- gpointer self)
-{
- gm_main_window_update_logo_have_window (GTK_WIDGET (self));
-}
/* Implementation */
static void
@@ -2522,7 +2542,7 @@
if (!GDK_IS_WINDOW(mw->main_video_image->window))
return FALSE;
- DisplayInfo display_info;
+ Ekiga::DisplayInfo display_info;
display_info.x = mw->main_video_image->allocation.x;
display_info.y = mw->main_video_image->allocation.y;
#ifdef WIN32
@@ -2712,7 +2732,7 @@
g_return_if_fail (data != NULL);
- DisplayInfo display_info;
+ Ekiga::DisplayInfo display_info;
display_info.zoom = gm_conf_get_int ((char *) data);
@@ -2736,7 +2756,7 @@
g_return_if_fail (data != NULL);
- DisplayInfo display_info;
+ Ekiga::DisplayInfo display_info;
display_info.zoom = gm_conf_get_int ((char *) data);
@@ -2760,7 +2780,7 @@
g_return_if_fail (data != NULL);
- DisplayInfo display_info;
+ Ekiga::DisplayInfo display_info;
display_info.zoom = 100;
@@ -2784,7 +2804,7 @@
GSList *group = NULL;
int group_last_pos = 0;
int active = 0;
- DisplayInfo display_info;
+ Ekiga::DisplayInfo display_info;
group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (widget));
group_last_pos = g_slist_length (group) - 1; /* If length 1, last pos is 0 */
@@ -2813,7 +2833,7 @@
{
GtkWidget* main_window = GnomeMeeting::Process()->GetMainWindow ();
g_return_if_fail (main_window != NULL);
- gm_main_window_toggle_fullscreen (TOGGLE, main_window);
+ gm_main_window_toggle_fullscreen (Ekiga::VO_FS_TOGGLE, main_window);
}
@@ -3157,78 +3177,10 @@
{
GmMainWindow *mw = NULL;
- unsigned int zoom = 100;
-
mw = gm_mw_get_mw (main_window);
g_return_if_fail (mw != NULL);
- zoom = gm_conf_get_int (VIDEO_DISPLAY_KEY "zoom");
-
-
- /* We are updating video related items */
- if (is_video) {
-
- /* Default to nothing being sensitive */
- gtk_menu_section_set_sensitive (mw->main_menu,
- "local_video", FALSE);
- gtk_menu_section_set_sensitive (mw->main_menu,
- "remote_video", FALSE);
- gtk_menu_section_set_sensitive (mw->main_menu,
- "both_incrusted", FALSE);
- gtk_menu_section_set_sensitive (mw->main_menu,
- "both_incrusted_window", FALSE);
-
-
- /* We are sending video, but not receiving
- * => local must be sensitive */
- if (is_transmitting) {
-
- gtk_menu_set_sensitive (mw->main_menu,
- "local_video", TRUE);
- }
- /* We are receiving video, but not transmitting,
- * => remote must be sensitive */
- if (is_receiving) {
-
- gtk_menu_set_sensitive (mw->main_menu,
- "remote_video", TRUE);
- }
-
- if (is_receiving && is_transmitting) {
- gtk_menu_set_sensitive (mw->main_menu,
- "both_incrusted", TRUE);
- gtk_menu_set_sensitive (mw->main_menu,
- "both_incrusted_window", TRUE);
- gm_main_window_fullscreen_menu_update_sensitivity (TRUE);
-
- }
- else {
-
- gm_main_window_fullscreen_menu_update_sensitivity (FALSE);
- }
-
- /* We are not transmitting, and not receiving anything,
- * => Disable the zoom completely */
- if (!is_receiving && !is_transmitting) {
- /* set the sensitivity of the zoom related menuitems as
- * if we were in fullscreen -> disable
- * all: zoom_{in,out},normal_size */
- gtk_menu_section_set_sensitive (mw->main_menu,
- "zoom_in", FALSE);
- gtk_menu_section_set_sensitive (mw->main_menu,
- "zoom_out", FALSE);
- gtk_menu_section_set_sensitive (mw->main_menu,
- "normal_size", FALSE);
- }
- else {
-
- /* Or activate it as at least something is transmitted or
- * received */
- gm_mw_zooms_menu_update_sensitivity (main_window, zoom);
- }
- }
-
if (is_transmitting) {
if (!is_video)
@@ -3244,76 +3196,47 @@
gtk_menu_set_sensitive (mw->main_menu, "suspend_video", FALSE);
}
-
- if (is_video) {
-
- g_signal_handlers_block_by_func (G_OBJECT (mw->preview_button),
- (gpointer) (toolbar_toggle_button_changed_cb),
- (gpointer) VIDEO_DEVICES_KEY "enable_preview");
-
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mw->preview_button), is_transmitting);
-
- g_signal_handlers_unblock_by_func (G_OBJECT (mw->preview_button),
- (gpointer) (toolbar_toggle_button_changed_cb),
- (gpointer) VIDEO_DEVICES_KEY "enable_preview");
- }
-}
-
-
-void
-gm_main_window_fullscreen_menu_update_sensitivity (bool FSMenu)
-{
- GtkWidget* main_window = NULL;
- GmMainWindow *mw = NULL;
-
- main_window = GnomeMeeting::Process()->GetMainWindow ();
- g_return_if_fail (main_window != NULL);
-
- mw = gm_mw_get_mw (main_window);
- g_return_if_fail (mw != NULL);
-
- gtk_menu_section_set_sensitive (mw->main_menu, "fullscreen", FSMenu);
}
void
-gm_main_window_toggle_fullscreen (FSToggle toggle,
+gm_main_window_toggle_fullscreen (Ekiga::VideoOutputFSToggle toggle,
GtkWidget *main_window)
{
GmMainWindow *mw = gm_mw_get_mw (main_window);
g_return_if_fail (mw != NULL);
- VideoOutputMode videooutput_mode;
+ Ekiga::VideoOutputMode videooutput_mode;
switch (toggle) {
- case OFF:
- if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == FULLSCREEN) {
+ case Ekiga::VO_FS_OFF:
+ if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == Ekiga::VO_MODE_FULLSCREEN) {
- videooutput_mode = (VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
+ videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", videooutput_mode);
}
break;
- case ON:
- if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") != FULLSCREEN) {
+ case Ekiga::VO_FS_ON:
+ if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") != Ekiga::VO_MODE_FULLSCREEN) {
- videooutput_mode = (VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
+ videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen", videooutput_mode);
- gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", FULLSCREEN);
+ gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_FULLSCREEN);
}
break;
- case TOGGLE:
+ case Ekiga::VO_FS_TOGGLE:
default:
- if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == FULLSCREEN) {
+ if (gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view") == Ekiga::VO_MODE_FULLSCREEN) {
- videooutput_mode = (VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
+ videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen");
gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", videooutput_mode);
}
else {
- videooutput_mode = (VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
+ videooutput_mode = (Ekiga::VideoOutputMode) gm_conf_get_int (VIDEO_DISPLAY_KEY "video_view");
gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view_before_fullscreen", videooutput_mode);
- gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", FULLSCREEN);
+ gm_conf_set_int (VIDEO_DISPLAY_KEY "video_view", Ekiga::VO_MODE_FULLSCREEN);
}
break;
}
@@ -3888,13 +3811,7 @@
conn = videooutput_core->device_closed.connect (sigc::bind (sigc::ptr_fun (on_videooutput_device_closed_cb), (gpointer) window));
mw->connections.push_back (conn);
- conn = videooutput_core->logo_update_required.connect (sigc::bind (sigc::ptr_fun (on_logo_update_required_cb), (gpointer) window));
- mw->connections.push_back (conn);
-
- conn = videooutput_core->display_size_changed.connect (sigc::bind (sigc::ptr_fun (on_display_size_changed_cb), (gpointer) window));
- mw->connections.push_back (conn);
-
- conn = videooutput_core->videooutput_mode_changed.connect (sigc::bind (sigc::ptr_fun (on_videooutput_mode_changed_cb), (gpointer) window));
+ conn = videooutput_core->size_changed.connect (sigc::bind (sigc::ptr_fun (on_size_changed_cb), (gpointer) window));
mw->connections.push_back (conn);
conn = videooutput_core->fullscreen_mode_changed.connect (sigc::bind (sigc::ptr_fun (on_fullscreen_mode_changed_cb), (gpointer) window));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]