diff options
author | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-28 14:04:54 (GMT) |
---|---|---|
committer | Gareth Stockwell <gareth.stockwell@sosco.com> | 2009-08-28 14:04:54 (GMT) |
commit | 316ae5a88b71993de3e1e2e16f8b82c4e9c7a1cf (patch) | |
tree | 823796522a07d7074fb9f4b3bdf7bc66cbce7c05 /src | |
parent | b806fe453139ca67d192fda7fa6de8d23889c7c6 (diff) | |
download | Qt-316ae5a88b71993de3e1e2e16f8b82c4e9c7a1cf.zip Qt-316ae5a88b71993de3e1e2e16f8b82c4e9c7a1cf.tar.gz Qt-316ae5a88b71993de3e1e2e16f8b82c4e9c7a1cf.tar.bz2 |
Deferred call to CVideoPlayerUtility::SetDisplayWindowL until MMF controller has been loaded
Diffstat (limited to 'src')
-rw-r--r-- | src/3rdparty/phonon/mmf/videoplayer.cpp | 35 | ||||
-rw-r--r-- | src/3rdparty/phonon/mmf/videoplayer.h | 9 |
2 files changed, 39 insertions, 5 deletions
diff --git a/src/3rdparty/phonon/mmf/videoplayer.cpp b/src/3rdparty/phonon/mmf/videoplayer.cpp index f008edd..7f08405 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.cpp +++ b/src/3rdparty/phonon/mmf/videoplayer.cpp @@ -40,6 +40,7 @@ MMF::VideoPlayer::VideoPlayer() , m_screenDevice(NULL) , m_window(NULL) , m_totalTime(0) + , m_mmfOutputChangePending(false) { construct(); } @@ -50,6 +51,7 @@ MMF::VideoPlayer::VideoPlayer(const AbstractPlayer& player) , m_screenDevice(NULL) , m_window(NULL) , m_totalTime(0) + , m_mmfOutputChangePending(false) { construct(); } @@ -222,6 +224,12 @@ void MMF::VideoPlayer::MvpuoPrepareComplete(TInt aError) videoOutput().setFrameSize(m_frameSize); + // See comment in updateMmfOutput + if(m_mmfOutputChangePending) { + TRACE_0("MMF output change pending - pushing now"); + updateMmfOutput(); + } + emit totalTimeChanged(totalTime()); changeState(StoppedState); } else { @@ -288,7 +296,7 @@ void MMF::VideoPlayer::MvpuoEvent(const TMMFEvent &aEvent) void MMF::VideoPlayer::videoOutputRegionChanged() { TRACE_CONTEXT(VideoPlayer::videoOutputRegionChanged, EVideoInternal); - TRACE_ENTRY_0(); + TRACE_ENTRY("state %d", state()); #ifdef PHONON_MMF_DEBUG_VIDEO_OUTPUT videoOutput().dump(); @@ -296,6 +304,27 @@ void MMF::VideoPlayer::videoOutputRegionChanged() getNativeWindowSystemHandles(); + // See comment in updateMmfOutput + if(state() == LoadingState) + m_mmfOutputChangePending = true; + else + updateMmfOutput(); + + TRACE_EXIT_0(); +} + +void MMF::VideoPlayer::updateMmfOutput() +{ + TRACE_CONTEXT(VideoPlayer::updateMmfOutput, EVideoInternal); + TRACE_ENTRY_0(); + + // Calling SetDisplayWindowL is a no-op unless the MMF controller has + // been loaded, so we shouldn't do it. Instead, the + // m_mmfOutputChangePending flag is used to record the fact that we + // need to call SetDisplayWindowL, and this is checked in + // MvpuoPrepareComplete, at which point the MMF controller has been + // loaded. + TRAPD(err, m_player->SetDisplayWindowL ( @@ -309,7 +338,9 @@ void MMF::VideoPlayer::videoOutputRegionChanged() TRACE("SetDisplayWindowL error %d", err); setError(NormalError); } - + + m_mmfOutputChangePending = false; + TRACE_EXIT_0(); } diff --git a/src/3rdparty/phonon/mmf/videoplayer.h b/src/3rdparty/phonon/mmf/videoplayer.h index da373ab..1fad4c4 100644 --- a/src/3rdparty/phonon/mmf/videoplayer.h +++ b/src/3rdparty/phonon/mmf/videoplayer.h @@ -85,9 +85,10 @@ private: // AbstractPlayer virtual void videoOutputChanged(); - + void getNativeWindowSystemHandles(); - + void updateMmfOutput(); + private: CVideoPlayerUtility* m_player; QScopedPointer<VideoOutput> m_dummyVideoOutput; @@ -98,10 +99,12 @@ private: RWindowBase* m_window; TRect m_windowRect; TRect m_clipRect; - + QSize m_frameSize; qint64 m_totalTime; + bool m_mmfOutputChangePending; + }; } } |