[ekiga] common-videooutput: store the extended stream buffer
- From: Eugen Dedu <ededu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ekiga] common-videooutput: store the extended stream buffer
- Date: Thu, 13 Sep 2012 15:51:52 +0000 (UTC)
commit 83cc47e442683ac93653bdd8eb760ee62f39e09b
Author: VÃctor Manuel JÃquez Leal <vjaquez igalia com>
Date: Tue Sep 4 10:54:15 2012 -0500
common-videooutput: store the extended stream buffer
When a second remote video stream (extended stream) arrives, it is
stored in a new byte array called eframeStore. The dimensions of
the frame are also stored, along with a new boolean property that
confirms the existence of an extended stream in the connection.
This patch does not modify the current user experience, but it is a
requirement for the extended video display.
.../videooutput-manager-common.cpp | 20 +++++++++++++++++---
.../videooutput-manager-common.h | 17 +++++++++++------
2 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/lib/engine/components/common-videooutput/videooutput-manager-common.cpp b/lib/engine/components/common-videooutput/videooutput-manager-common.cpp
index 1a6757a..9df2022 100644
--- a/lib/engine/components/common-videooutput/videooutput-manager-common.cpp
+++ b/lib/engine/components/common-videooutput/videooutput-manager-common.cpp
@@ -96,7 +96,7 @@ GMVideoOutputManager::Main ()
if (initialised_thread) {
var_mutex.Wait ();
- do_sync = local_frame_received | remote_frame_received;
+ do_sync = local_frame_received | remote_frame_received | ext_frame_received;
if (do_sync)
sync_required = redraw();
var_mutex.Signal ();
@@ -151,6 +151,14 @@ void GMVideoOutputManager::set_frame_data (const char* data,
current_frame.remote_height= height;
memcpy (rframeStore.GetPointer(), data, (width * height * 3) >> 1);
remote_frame_received = true;
+ }
+ else if (type == 2) { // REMOTE 2 (extended video)
+ /* memcpy the frame */
+ eframeStore.SetSize (width * height * 3);
+ current_frame.ext_width = width;
+ current_frame.ext_height= height;
+ memcpy (eframeStore.GetPointer(), data, (width * height * 3) >> 1);
+ ext_frame_received = true;
} else {
var_mutex.Signal();
run_thread.Signal();
@@ -226,21 +234,26 @@ void GMVideoOutputManager::init()
last_frame.local_width = 0;
last_frame.local_height = 0;
last_frame.remote_width = 0;
- last_frame.remote_height = 0;
+ last_frame.remote_height = 0;
+ last_frame.ext_width = 0;
+ last_frame.ext_height = 0;
last_frame.zoom = 0;
last_frame.embedded_x = 0;
- last_frame.embedded_y = 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;
current_frame.remote_height = 0;
+ current_frame.ext_width = 0;
+ current_frame.ext_height = 0;
/* Initialisation */
video_disabled = false;
local_frame_received = false;
remote_frame_received = false;
+ ext_frame_received = false;
update_required.local = false;
update_required.remote = false;
@@ -251,6 +264,7 @@ void GMVideoOutputManager::uninit ()
/* This is common to all output classes */
lframeStore.SetSize (0);
rframeStore.SetSize (0);
+ eframeStore.SetSize (0);
}
void GMVideoOutputManager::update_gui_device ()
diff --git a/lib/engine/components/common-videooutput/videooutput-manager-common.h b/lib/engine/components/common-videooutput/videooutput-manager-common.h
index 3bdbf42..e716bc6 100644
--- a/lib/engine/components/common-videooutput/videooutput-manager-common.h
+++ b/lib/engine/components/common-videooutput/videooutput-manager-common.h
@@ -213,10 +213,11 @@
/* This variable has to be protected by display_info_mutex */
Ekiga::DisplayInfo display_info;
PMutex display_info_mutex; /* To protect the DisplayInfo object */
-
+
PBYTEArray lframeStore;
PBYTEArray rframeStore;
-
+ PBYTEArray eframeStore;
+
typedef struct {
Ekiga::VideoOutputMode mode;
Ekiga::VideoOutputAccel accel;
@@ -224,21 +225,25 @@
unsigned int remote_width;
unsigned int remote_height;
-
+
+ unsigned int ext_width; // 2nd remote (extended video)
+ unsigned int ext_height;
+
unsigned int local_width;
unsigned int local_height;
-
+
unsigned int zoom;
-
+
int embedded_x;
int embedded_y;
} FrameInfo;
FrameInfo last_frame;
FrameInfo current_frame;
-
+
bool local_frame_received;
bool remote_frame_received;
+ bool ext_frame_received;
bool video_disabled;
UpdateRequired update_required;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]