diff options
author | Marko Kenttala <ext-marko.r.kenttala@nokia.com> | 2012-09-10 09:01:26 +0300 |
---|---|---|
committer | Juha Kukkonen <ext-juha.kukkonen@nokia.com> | 2012-09-10 09:02:41 +0300 |
commit | 2fa60a5fc2d10b639c258d019ed8b46ea2aa434b (patch) | |
tree | e81157a9e0a61f705dcfcf5c22d6d7427dd2485a | |
parent | d262f8602661f222819c5d4b468a1c23257e643c (diff) |
Fix for Symbian video resume from pause after screen lock and unlock
In Symbian video was not able to resume from paused state after screen
lock. Only way to resume was to stop, load again and play from start.
Fixed S60VideoPlayerSession to wait for surface before enabling
buffering if surface was removed earlier.
Task-Number: QTMOBILITY-1418
Reviewed-by: Juha Kukkonen
-rw-r--r-- | plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp | 20 | ||||
-rw-r--r-- | plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h | 1 |
2 files changed, 21 insertions, 0 deletions
diff --git a/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp b/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp index 95069a04bf..1cc11f6685 100644 --- a/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp +++ b/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.cpp @@ -167,6 +167,7 @@ S60VideoPlayerSession::S60VideoPlayerSession(QMediaService *service, S60MediaNet , m_player(0) #ifdef VIDEOOUTPUT_GRAPHICS_SURFACES , m_nativeSurface(TSurfaceId::CreateNullId()) + , m_bufferingWaitingSurface(false) #else , m_dsaActive(false) , m_dsaStopped(false) @@ -692,6 +693,11 @@ void S60VideoPlayerSession::MvpuoEvent(const TMMFEvent &aEvent) // MMF sends this event when video playback is paused due to foreground lost event applicationLostFocus(); } else { +#ifdef VIDEOOUTPUT_GRAPHICS_SURFACES + // Ignore KErrNotFound when loading for null surface + if (aEvent.iErrorCode == KErrNotFound && m_bufferingWaitingSurface) + return; +#endif setError(aEvent.iErrorCode); doClose(); } @@ -708,6 +714,13 @@ void S60VideoPlayerSession::MmsehSurfaceCreated(TInt aDisplayId, const TSurfaceI Q_UNUSED(aAspectRatio) Q_ASSERT(m_nativeSurface.IsNull()); m_nativeSurface = aId; +#ifdef VIDEOOUTPUT_GRAPHICS_SURFACES + if (m_bufferingWaitingSurface) { + // Loading had started before surface, start buffering now + m_bufferingWaitingSurface = false; + buffering(); + } +#endif emit nativeSurfaceChanged(m_nativeSurface); } @@ -817,6 +830,13 @@ bool S60VideoPlayerSession::stopDirectScreenAccess() void S60VideoPlayerSession::MvloLoadingStarted() { TRACE("S60VideoPlayerSession::MvloLoadingStarted" << qtThisPtr()); +#ifdef VIDEOOUTPUT_GRAPHICS_SURFACES + if (m_nativeSurface.IsNull()) { + // Wait for surface before starting buffering + m_bufferingWaitingSurface = true; + } + else +#endif buffering(); } diff --git a/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h b/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h index c9bb7154cc..2cc9595a47 100644 --- a/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h +++ b/plugins/multimedia/symbian/mmf/mediaplayer/s60videoplayersession.h @@ -209,6 +209,7 @@ private: CVideoPlayerUtility2 *m_player; TSurfaceId m_nativeSurface; S60NativeWindow *m_dummyWindow; + bool m_bufferingWaitingSurface; #else CVideoPlayerUtility *m_player; bool m_dsaActive; |