diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-12-18 23:33:28 -0800 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-12-18 23:33:28 -0800 |
commit | 75978a702b9acc29a17366273bc6f306fb32f999 (patch) | |
tree | 79a31779886f4387e434544eca94a1cb19581a7a /vrplayer | |
parent | d60fd3f5133749502f1c1d1ea0af5c4090baa9d2 (diff) | |
download | xrdp-proprietary-75978a702b9acc29a17366273bc6f306fb32f999.tar.gz xrdp-proprietary-75978a702b9acc29a17366273bc6f306fb32f999.zip |
vrplayer: many fixes
Diffstat (limited to 'vrplayer')
-rw-r--r-- | vrplayer/demuxmedia.cpp | 12 | ||||
-rw-r--r-- | vrplayer/demuxmedia.h | 1 | ||||
-rw-r--r-- | vrplayer/mainwindow.cpp | 23 | ||||
-rw-r--r-- | vrplayer/ourinterface.cpp | 17 | ||||
-rw-r--r-- | vrplayer/ourinterface.h | 4 |
5 files changed, 42 insertions, 15 deletions
diff --git a/vrplayer/demuxmedia.cpp b/vrplayer/demuxmedia.cpp index 0e2091f6..a8de41a1 100644 --- a/vrplayer/demuxmedia.cpp +++ b/vrplayer/demuxmedia.cpp @@ -29,6 +29,18 @@ void DemuxMedia::setVcrOp(int op) vcrMutex.lock(); vcrFlag = op; vcrMutex.unlock(); + if (op == VCR_STOP) + { + clear(); + } +} + +int DemuxMedia::clear() +{ + sendMutex.lock(); + videoQueue->clear(); + sendMutex.unlock(); + return 0; } void DemuxMedia::startDemuxing() diff --git a/vrplayer/demuxmedia.h b/vrplayer/demuxmedia.h index 0b3935d7..742ce525 100644 --- a/vrplayer/demuxmedia.h +++ b/vrplayer/demuxmedia.h @@ -41,6 +41,7 @@ public: void *channel = 0, int stream_id = 101); void setVcrOp(int op); + int clear(); public slots: void startDemuxing(); diff --git a/vrplayer/mainwindow.cpp b/vrplayer/mainwindow.cpp index 0ce04674..e8884726 100644 --- a/vrplayer/mainwindow.cpp +++ b/vrplayer/mainwindow.cpp @@ -295,11 +295,9 @@ void MainWindow::getVdoGeometry(QRect *rect) void MainWindow::clearDisplay() { - QPixmap pixmap(100,100); - pixmap.fill(QColor(0x00, 0x00, 0x00)); - QPainter painter(&pixmap); - painter.setBrush(QBrush(Qt::black)); - lblVideo->setPixmap(pixmap); + /* TODO: this needs to be set after video actually stops + * a few frames come after this */ + lblVideo->update(); } /******************************************************************************* @@ -333,11 +331,21 @@ void MainWindow::on_actionOpen_Media_File_triggered() { remoteClientInited = false; interface->deInitRemoteClient(); - interface->initRemoteClient(); + if (interface->initRemoteClient() != 0) + { + QMessageBox::question(this, "vrplayer", "Unsupported codec", + QMessageBox::Ok); + return; + } } else { - interface->initRemoteClient(); + if (interface->initRemoteClient() != 0) + { + QMessageBox::question(this, "vrplayer", "Unsupported codec", + QMessageBox::Ok); + return; + } } demuxMedia = interface->getDemuxMediaInstance(); @@ -413,6 +421,7 @@ void MainWindow::onBtnStopClicked(bool) lblCurrentPos->setText("00:00:00"); /* clear screen by filling it with black */ + usleep(500 * 1000); clearDisplay(); btnPlay->setChecked(false); diff --git a/vrplayer/ourinterface.cpp b/vrplayer/ourinterface.cpp index e13e6e8b..261ba04d 100644 --- a/vrplayer/ourinterface.cpp +++ b/vrplayer/ourinterface.cpp @@ -32,7 +32,8 @@ void OurInterface::oneTimeDeinit() closeVirtualChannel(); } -void OurInterface::initRemoteClient() +/* returns error */ +int OurInterface::initRemoteClient() { int64_t start_time; int64_t duration; @@ -40,18 +41,21 @@ void OurInterface::initRemoteClient() //elapsedTime = 0; if (sendMetadataFile()) - return; + return 1; if (sendVideoFormat()) - return; + return 1; if (sendAudioFormat()) - return; + return 1; if (sendGeometry(savedGeometry)) - return; + return 1; - xrdpvr_play_media(channel, 101, filename.toAscii().data()); + if (xrdpvr_play_media(channel, 101, filename.toAscii().data()) != 0) + { + return 1; + } xrdpvr_get_media_duration(&start_time, &duration); //qDebug() << "ourInterface:initRemoteClient: emit onMediaDurationInSecs: dur=" << duration; @@ -66,6 +70,7 @@ void OurInterface::initRemoteClient() demuxMedia->moveToThread(demuxMediaThread); //playVideo = demuxMedia->getPlayVideoInstance(); } + return 0; } void OurInterface::deInitRemoteClient() diff --git a/vrplayer/ourinterface.h b/vrplayer/ourinterface.h index 51f88e6b..be354025 100644 --- a/vrplayer/ourinterface.h +++ b/vrplayer/ourinterface.h @@ -31,11 +31,11 @@ class OurInterface : public QObject public: explicit OurInterface(QObject *parent = 0); - + /* public methods */ int oneTimeInit(); void oneTimeDeinit(); - void initRemoteClient(); + int initRemoteClient(); void deInitRemoteClient(); int sendGeometry(QRect rect); void setFilename(QString filename); |