summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-17 17:22:26 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-17 17:22:26 (GMT)
commit2d1095e5a5c3cbf054d87d3f5b10c6ecaa1e98c3 (patch)
tree8539beecbb94d35fca800cb91cba8784ab5d4140 /src
parent4c1f54097a1fb1acff817ba8caa8af347ae56cd2 (diff)
parent5f23bb62e1e4862c89bccebb93d128685cdb8e7a (diff)
downloadQt-2d1095e5a5c3cbf054d87d3f5b10c6ecaa1e98c3.zip
Qt-2d1095e5a5c3cbf054d87d3f5b10c6ecaa1e98c3.tar.gz
Qt-2d1095e5a5c3cbf054d87d3f5b10c6ecaa1e98c3.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)
Diffstat (limited to 'src')
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayercontrol.cpp2
-rw-r--r--src/plugins/mediaservices/directshow/mediaplayer/directshowplayerservice.cpp61
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;