diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-18 00:46:22 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-03-18 00:46:22 (GMT) |
commit | 19c41b7de6596453f16d52f05953b153cd40e36e (patch) | |
tree | 549bb5ca3e8c19911434904924a4b8ac4551fd6d | |
parent | f9ca0df998a8a3a942816f2954603ad996210d8d (diff) | |
parent | 2d1095e5a5c3cbf054d87d3f5b10c6ecaa1e98c3 (diff) | |
download | Qt-19c41b7de6596453f16d52f05953b153cd40e36e.zip Qt-19c41b7de6596453f16d52f05953b153cd40e36e.tar.gz Qt-19c41b7de6596453f16d52f05953b153cd40e36e.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-multimedia-staging:
Pause the direct show graph when the playback rate is 0.0.
Rebuild configure.exe (again enable QtDeclarative module by default)
-rw-r--r-- | src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp | 2 | ||||
-rw-r--r-- | src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp | 61 |
2 files changed, 47 insertions, 16 deletions
diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp index bb7bac3..67d07e1 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp @@ -87,7 +87,7 @@ DirectShowPlayerControl::DirectShowPlayerControl(DirectShowPlayerService *servic , m_muteVolume(-1) , m_position(0) , m_duration(0) - , m_playbackRate(0) + , m_playbackRate(1.0) , m_seekable(false) { } diff --git a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp index 317fa5c..d54d188 100644 --- a/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp +++ b/src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp @@ -274,7 +274,7 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker) } if (SUCCEEDED(hr)) { - m_executedTasks = SetSource; + m_executedTasks |= SetSource; m_pendingTasks |= Render; if (m_audioOutput) @@ -282,7 +282,7 @@ void DirectShowPlayerService::doSetUrlSource(QMutexLocker *locker) if (m_videoOutput) m_pendingTasks |= SetVideoOutput; - if (m_rate != 1.0) + if (m_rate != 1.0 && m_rate != 0.0) m_pendingTasks |= SetRate; m_source = source; @@ -319,7 +319,7 @@ void DirectShowPlayerService::doSetStreamSource(QMutexLocker *locker) source->setDevice(m_stream); if (SUCCEEDED(m_graph->AddFilter(source, L"Source"))) { - m_executedTasks = SetSource; + m_executedTasks |= SetSource; m_pendingTasks |= Render; if (m_audioOutput) @@ -327,7 +327,7 @@ void DirectShowPlayerService::doSetStreamSource(QMutexLocker *locker) if (m_videoOutput) m_pendingTasks |= SetVideoOutput; - if (m_rate != 1.0) + if (m_rate != 1.0 && m_rate != 0.0) m_pendingTasks |= SetRate; m_source = source; @@ -346,7 +346,10 @@ void DirectShowPlayerService::doSetStreamSource(QMutexLocker *locker) void DirectShowPlayerService::doRender(QMutexLocker *locker) { - m_pendingTasks |= m_executedTasks & (Play | Pause); + if (m_executedTasks & Pause) + m_pendingTasks |= Pause; + else if (m_executedTasks & Play && m_rate != 0.0) + m_pendingTasks |= Play; if (IMediaControl *control = com_cast<IMediaControl>(m_graph, IID_IMediaControl)) { control->Stop(); @@ -624,8 +627,13 @@ void DirectShowPlayerService::play() { QMutexLocker locker(&m_mutex); - m_pendingTasks &= ~Pause; - m_pendingTasks |= Play; + if (m_rate != 0.0) { + m_pendingTasks &= ~Pause; + m_pendingTasks |= Play; + } else { + m_pendingTasks |= Pause; + m_executedTasks |= Play; + } if (m_executedTasks & Render) { if (m_executedTasks & Stop) { @@ -650,6 +658,7 @@ void DirectShowPlayerService::doPlay(QMutexLocker *locker) if (SUCCEEDED(hr)) { m_executedTasks |= Play; + m_executedTasks &= ~Pause; QCoreApplication::postEvent(this, new QEvent(QEvent::Type(StatusChange))); } else { @@ -704,6 +713,9 @@ void DirectShowPlayerService::doPause(QMutexLocker *locker) m_executedTasks |= Pause; + if (m_rate != 0.0) + m_executedTasks &= ~Play; + QCoreApplication::postEvent(this, new QEvent(QEvent::Type(StatusChange))); } else { m_error = QMediaPlayer::ResourceError; @@ -764,9 +776,27 @@ void DirectShowPlayerService::setRate(qreal rate) { QMutexLocker locker(&m_mutex); - m_rate = rate; + if (m_rate == rate) + return; + + if (rate == 0.0) { + if (m_pendingTasks & Play) { + m_executedTasks |= Play; + m_pendingTasks &= ~(Play | SetRate); + + if (!((m_executingTask | m_executedTasks) & Pause)) + m_pendingTasks |= Pause; + } else if ((m_executingTask | m_executedTasks) & Play) { + m_pendingTasks |= Pause; + } + } else { + m_pendingTasks |= SetRate; + + if (m_rate == 0.0 && (m_executedTasks & Play) && !(m_executingTask & Play)) + m_pendingTasks |= Play; + } - m_pendingTasks |= SetRate; + m_rate = rate; if (m_executedTasks & FinalizeLoad) ::SetEvent(m_taskHandle); @@ -800,8 +830,9 @@ void DirectShowPlayerService::doSetRate(QMutexLocker *locker) seeking->Release(); } else if (m_rate != 1.0) { - m_rate = 1.0; + m_rate = 1.0; } + QCoreApplication::postEvent(this, new QEvent(QEvent::Type(RateChange))); } @@ -1344,16 +1375,16 @@ void DirectShowPlayerService::run() m_executingTask = Stop; doStop(&locker); - } else if (m_pendingTasks & SetRate) { - m_pendingTasks ^= SetRate; - m_executingTask = SetRate; - - doSetRate(&locker); } else if (m_pendingTasks & Pause) { m_pendingTasks ^= Pause; m_executingTask = Pause; doPause(&locker); + } else if (m_pendingTasks & SetRate) { + m_pendingTasks ^= SetRate; + m_executingTask = SetRate; + + doSetRate(&locker); } else if (m_pendingTasks & Seek) { m_pendingTasks ^= Seek; m_executingTask = Seek; |