diff --git a/MainWindow.cpp b/MainWindow.cpp index 2357244..7adfa97 100644 --- a/MainWindow.cpp +++ b/MainWindow.cpp @@ -777,7 +777,7 @@ void MainWindow::createLayout() destinationCanvas->setMinimumSize(CANVAS_MINIMUM_WIDTH, CANVAS_MINIMUM_HEIGHT); outputWindow = new OutputGLWindow(this, this, sourceCanvas); - outputWindow->setVisible(true); + outputWindow->mySetVisible(true); // Source changed -> change destination connect(sourceCanvas, SIGNAL(shapeChanged(Shape*)), @@ -944,7 +944,7 @@ void MainWindow::createActions() displayOutputWindow->setCheckable(true); displayOutputWindow->setChecked(true); // Manage show/hide of GL output window. - connect(displayOutputWindow, SIGNAL(toggled(bool)), outputWindow, SLOT(setVisible(bool))); + connect(displayOutputWindow, SIGNAL(toggled(bool)), outputWindow, SLOT(mySetVisible(bool))); // When closing the GL output window, uncheck the action in menu. connect(outputWindow, SIGNAL(closed()), displayOutputWindow, SLOT(toggle())); diff --git a/OutputGLWindow.cpp b/OutputGLWindow.cpp index da9d34b..a2347c6 100644 --- a/OutputGLWindow.cpp +++ b/OutputGLWindow.cpp @@ -41,6 +41,27 @@ void OutputGLWindow::closeEvent(QCloseEvent *event) event->accept(); } +void OutputGLWindow::fullscreen(bool is_fullscreen) +{ + if (is_fullscreen) + { + this->showFullScreen(); + } + else + { + this->showNormal(); + } +} + +void OutputGLWindow::mySetVisible(bool value) +{ + this->setVisible(value); + if (value) + { + this->fullscreen(value); + } +} + //void OutputGLWindow::updateCanvas() { // qDebug() << "Update output canvas" << endl; // canvas->updateCanvas(); diff --git a/OutputGLWindow.h b/OutputGLWindow.h index feadc97..dd7bfac 100644 --- a/OutputGLWindow.h +++ b/OutputGLWindow.h @@ -23,12 +23,17 @@ #include #include "DestinationGLCanvas.h" +// TODO: add SLOT for mySetVisible +// TODO: Maybe improve support for Ubuntu: http://stackoverflow.com/questions/12645880/fullscreen-for-qdialog-from-within-mainwindow-only-working-sometimes + class OutputGLWindow : public QDialog { Q_OBJECT public: OutputGLWindow(MainWindow* mainWindow, QWidget* parent = 0, const QGLWidget * shareWidget = 0); + void fullscreen(bool is_fullscreen); + void mySetVisible(bool value); protected: void closeEvent(QCloseEvent* event); diff --git a/prototypes/shm/read.sh b/prototypes/shm/read.sh index a3a64f6..46806fb 100755 --- a/prototypes/shm/read.sh +++ b/prototypes/shm/read.sh @@ -1,4 +1,4 @@ -gst-launch -e shmsrc socket-path=/tmp/test is-live=1 ! \ +gst-launch-0.10 -e shmsrc socket-path=/tmp/test is-live=1 ! \ video/x-raw-yuv,format=\(fourcc\)I420,framerate=30/1,width=640,height=480 ! \ xvimagesink diff --git a/prototypes/shm/write.sh b/prototypes/shm/write.sh index 4af6776..14b1f66 100755 --- a/prototypes/shm/write.sh +++ b/prototypes/shm/write.sh @@ -1,4 +1,4 @@ -gst-launch -v videotestsrc ! \ +gst-launch-0.10 -v videotestsrc ! \ 'video/x-raw-yuv, width=640, height=480, framerate=30/1, format=(fourcc)I420' ! \ shmsink socket-path=/tmp/test shm-size=10000000 wait-for-connection=0