[ekiga/ds-gsettings] Moved VideoOutputCore to GSettings.
- From: Damien Sandras <dsandras src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga/ds-gsettings] Moved VideoOutputCore to GSettings.
- Date: Sun, 23 Jun 2013 14:08:26 +0000 (UTC)
commit 96445a5a23d28b90b4008d27ff7a5dbe700ee698
Author: Damien Sandras <dsandras beip be>
Date: Sun Jun 23 15:53:25 2013 +0200
Moved VideoOutputCore to GSettings.
This is all done.
lib/Makefile.am | 4 +-
lib/ekiga-settings.h | 1 +
lib/engine/engine.cpp | 2 +-
lib/engine/gui/gtk-frontend/ext-window.cpp | 1 +
lib/engine/videooutput/videooutput-core.cpp | 73 ++++++++++++++++++++++++---
lib/engine/videooutput/videooutput-core.h | 9 ++--
6 files changed, 75 insertions(+), 15 deletions(-)
---
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 450bea3..2c50ce3 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -341,9 +341,7 @@ libekiga_la_SOURCES += \
$(engine_dir)/videooutput/videooutput-info.h \
$(engine_dir)/videooutput/videooutput-manager.h \
$(engine_dir)/videooutput/videooutput-core.h \
- $(engine_dir)/videooutput/videooutput-core.cpp \
- $(engine_dir)/videooutput/videooutput-gmconf-bridge.h \
- $(engine_dir)/videooutput/videooutput-gmconf-bridge.cpp
+ $(engine_dir)/videooutput/videooutput-core.cpp
##
# Sources of the video input stack
diff --git a/lib/ekiga-settings.h b/lib/ekiga-settings.h
index a0cf2b7..fba4634 100644
--- a/lib/ekiga-settings.h
+++ b/lib/ekiga-settings.h
@@ -47,6 +47,7 @@
#define SOUND_EVENTS_SCHEMA "org.gnome." PACKAGE_NAME ".general.sound-events"
#define AUDIO_DEVICES_SCHEMA "org.gnome." PACKAGE_NAME ".devices.audio"
#define VIDEO_DEVICES_SCHEMA "org.gnome." PACKAGE_NAME ".devices.video"
+#define VIDEO_DISPLAY_SCHEMA USER_INTERFACE ".video-display"
namespace Ekiga {
diff --git a/lib/engine/engine.cpp b/lib/engine/engine.cpp
index a0cd1b3..381e7c9 100644
--- a/lib/engine/engine.cpp
+++ b/lib/engine/engine.cpp
@@ -199,7 +199,7 @@ engine_init (Ekiga::ServiceCorePtr service_core,
code in question to do it itself
*/
- videooutput_core->setup_conf_bridge();
+ videooutput_core->setup ();
videoinput_core->setup ("any");
audioinput_core->setup ();
audiooutput_core->setup ();
diff --git a/lib/engine/gui/gtk-frontend/ext-window.cpp b/lib/engine/gui/gtk-frontend/ext-window.cpp
index 368d844..c68607a 100644
--- a/lib/engine/gui/gtk-frontend/ext-window.cpp
+++ b/lib/engine/gui/gtk-frontend/ext-window.cpp
@@ -28,6 +28,7 @@
#include "config.h"
#include "ext-window.h"
+#include "gmconf.h"
#ifndef WIN32
#include <gdk/gdkx.h>
diff --git a/lib/engine/videooutput/videooutput-core.cpp b/lib/engine/videooutput/videooutput-core.cpp
index 19ceed1..33a1066 100644
--- a/lib/engine/videooutput/videooutput-core.cpp
+++ b/lib/engine/videooutput/videooutput-core.cpp
@@ -55,16 +55,15 @@ VideoOutputCore::VideoOutputCore ()
videooutput_stats.rx_frames = 0;
videooutput_stats.tx_frames = 0;
number_times_started = 0;
- videooutput_core_conf_bridge = NULL;
+
+ settings = new Settings (VIDEO_DISPLAY_SCHEMA);
+ settings->changed.connect (boost::bind (&VideoOutputCore::setup, this, _1));
}
VideoOutputCore::~VideoOutputCore ()
{
PWaitAndSignal m(core_mutex);
- if (videooutput_core_conf_bridge)
- delete videooutput_core_conf_bridge;
-
for (std::set<VideoOutputManager *>::iterator iter = managers.begin ();
iter != managers.end ();
iter++)
@@ -73,11 +72,71 @@ VideoOutputCore::~VideoOutputCore ()
managers.clear();
}
-void VideoOutputCore::setup_conf_bridge ()
+void VideoOutputCore::setup (std::string setting)
{
- PWaitAndSignal m(core_mutex);
+ GSettings *s = settings->get_g_settings ();
+ if (setting.empty () || setting == "video-view") {
- videooutput_core_conf_bridge = new VideoOutputCoreConfBridge (*this);
+ DisplayInfo display_info;
+ PTRACE(4, "VideoOutputCore\tUpdating video view");
+
+ if ((g_settings_get_int (s, "video-view") < Ekiga::VO_MODE_LOCAL) ||
+ (g_settings_get_int (s, "video-view") >= Ekiga::VO_MODE_UNSET))
+ g_settings_set_int (s, "video-view", Ekiga::VO_MODE_LOCAL);
+
+ display_info.mode = (VideoOutputMode) g_settings_get_int (s, "video-view");
+ set_display_info (display_info);
+ }
+
+ if (setting.empty () || setting == "zoom") {
+
+ DisplayInfo display_info;
+ PTRACE(4, "VideoOutputCore\tUpdating zoom");
+
+ display_info.zoom = g_settings_get_int (s, "zoom");
+ if ((display_info.zoom != 100) &&
+ (display_info.zoom != 50) &&
+ (display_info.zoom != 200)) {
+ display_info.zoom = 100;
+ g_settings_set_int (s, "zoom", 100);
+ }
+
+ set_display_info (display_info);
+ }
+
+ if (setting.empty () || setting == "ext-zoom") {
+
+ DisplayInfo display_info;
+
+ display_info.zoom = g_settings_get_int (s, "ext-zoom");
+ if ((display_info.zoom != 100) &&
+ (display_info.zoom != 50) &&
+ (display_info.zoom != 200)) {
+ display_info.zoom = 100;
+ g_settings_set_int (s, "ext-zoom", 100);
+ }
+
+ set_ext_display_info(display_info);
+ }
+
+ if (setting.empty () || setting == "stay-on-top" || setting == "disable-hw-accel"
+ || setting == "allow-pip-sw-scaling" || setting == "sw-scaling-algorithm") {
+
+ PTRACE(4, "VideoOutputCore\tUpdating Video Settings");
+ DisplayInfo display_info;
+
+ display_info.on_top = g_settings_get_boolean (s, "stay-on-top");
+ display_info.disable_hw_accel = g_settings_get_boolean (s, "disable-hw-accel");
+ display_info.allow_pip_sw_scaling = g_settings_get_boolean (s,"allow-pip-sw-scaling");
+ display_info.sw_scaling_algorithm = g_settings_get_int (s, "sw-scaling-algorithm");
+ if (display_info.sw_scaling_algorithm > 3) {
+ display_info.sw_scaling_algorithm = 0;
+ g_settings_set_int (s, "sw-scaling-algorithm", 0);
+ }
+ display_info.config_info_set = TRUE;
+
+ set_display_info(display_info);
+ }
}
void VideoOutputCore::add_manager (VideoOutputManager &manager)
diff --git a/lib/engine/videooutput/videooutput-core.h b/lib/engine/videooutput/videooutput-core.h
index 2ff261d..dff5361 100644
--- a/lib/engine/videooutput/videooutput-core.h
+++ b/lib/engine/videooutput/videooutput-core.h
@@ -39,7 +39,6 @@
#include "services.h"
-#include "videooutput-gmconf-bridge.h"
#include "videooutput-manager.h"
#include <boost/signals.hpp>
@@ -52,6 +51,8 @@
#include "ptbuildopts.h"
#include "ptlib.h"
+#include "ekiga-settings.h"
+
namespace Ekiga
{
@@ -82,9 +83,9 @@ namespace Ekiga
*/
~VideoOutputCore ();
- /** Set up gmconf bridge
+ /** Set up core
*/
- void setup_conf_bridge();
+ void setup (std::string setting = "");
/*** Service Implementation ***/
@@ -196,7 +197,7 @@ namespace Ekiga
PMutex core_mutex;
- VideoOutputCoreConfBridge* videooutput_core_conf_bridge;
+ Settings* settings;
};
/**
* @}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]