summaryrefslogtreecommitdiff
path: root/pjsip-apps
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2012-04-17 09:55:30 +0000
committerLiong Sauw Ming <ming@teluu.com>2012-04-17 09:55:30 +0000
commit64f7c5f55ec54621141ba3676298510dcf0bdb70 (patch)
treee3bd385008e68fd0e184b9c145a92d4fc4d97b07 /pjsip-apps
parent892a5865b3e1fb6277689a8111f3154045574419 (diff)
Re #1355: vidgui: new rendering window may cause all rendering processes to stop
Despite this fix, there is still a possibility that the rendering window can occasionally get stuck because SDL_PollEvent() gets stuck. This is most likely because there are two unsynchronized event pollers, Qt and SDL. The problem only happened on Windows with SDL 1.3 r5538, runs fine on Mac. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4060 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps')
-rw-r--r--pjsip-apps/src/vidgui/vidgui.cpp4
-rw-r--r--pjsip-apps/src/vidgui/vidwin.cpp7
-rw-r--r--pjsip-apps/src/vidgui/vidwin.h3
3 files changed, 12 insertions, 2 deletions
diff --git a/pjsip-apps/src/vidgui/vidgui.cpp b/pjsip-apps/src/vidgui/vidgui.cpp
index 77f805d7..4a0b4d7d 100644
--- a/pjsip-apps/src/vidgui/vidgui.cpp
+++ b/pjsip-apps/src/vidgui/vidgui.cpp
@@ -260,7 +260,7 @@ void MainWin::preview()
pjsua_vid_win_get_info(wid, &wi);
video_prev_ = new VidWin(&wi.hwnd);
- vbox_left->addWidget(video_prev_, 1);
+ video_prev_->putIntoLayout(vbox_left);
//Using this will cause SDL window to display blank
//screen sometimes, probably because it's using different
//X11 Display
@@ -339,7 +339,7 @@ void MainWin::initVideoWindow()
pjsua_vid_win_get_info(ci.media[i].stream.vid.win_in, &wi);
video_= new VidWin(&wi.hwnd);
- vbox_left->addWidget(video_, 1);
+ video_->putIntoLayout(vbox_left);
break;
}
diff --git a/pjsip-apps/src/vidgui/vidwin.cpp b/pjsip-apps/src/vidgui/vidwin.cpp
index 654035c1..3e38b6cd 100644
--- a/pjsip-apps/src/vidgui/vidwin.cpp
+++ b/pjsip-apps/src/vidgui/vidwin.cpp
@@ -50,6 +50,13 @@ VidWin::~VidWin()
detach();
}
+void VidWin::putIntoLayout(QBoxLayout *box)
+{
+ box->addWidget(this, 1);
+ show();
+ activateWindow();
+}
+
bool VidWin::event(QEvent *e)
{
switch(e->type()) {
diff --git a/pjsip-apps/src/vidgui/vidwin.h b/pjsip-apps/src/vidgui/vidwin.h
index b784943b..8ab4a76d 100644
--- a/pjsip-apps/src/vidgui/vidwin.h
+++ b/pjsip-apps/src/vidgui/vidwin.h
@@ -21,6 +21,7 @@
#include <pjsua.h>
#include <QWidget>
+#include <QBoxLayout>
class VidWin : public QWidget
{
@@ -33,6 +34,8 @@ public:
virtual ~VidWin();
QSize sizeHint() const { return size_hint; }
+ void putIntoLayout(QBoxLayout *layout);
+
protected:
virtual bool event(QEvent *e);