[Clientapps-cvs] symbianMmf/common hxmmfbasectrl.cpp, 1.1.2.65, 1.1.2.66
anugrahk at helixcommunity.org anugrahk at helixcommunity.orgUpdate of /cvsroot/clientapps/symbianMmf/common
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv23454
Modified Files:
Tag: hxclient_2_1_0_cayennes
hxmmfbasectrl.cpp
Log Message:
"Nokia submits this code under the terms of a commercial contribution agreement with RealNetworks, and I am authorized to contribute this code under said agreement."
Modified by: ext-anugrah.2.kashari at nokia.com
Reviewed by: Ramanovich Yury
Gupta Ashish.As
ext Sheldon Fu [sfu at real.com]
TSW Id: ESLM-84F6JE
Date: 04/05/2010
Project: SymbianMmf_wm
Synopsis: Video resumes after 5-7 seconds when switching from background to foreground
Overview:
When the player goes to background, decoder flushes the input queue with HXR_DEVVIDEO_RESOURCE_LOST notification. Later, when the application comes to foreground, Helix pushes encoded buffers from where it stopped before going to background. Now, the decoder looks for the next available key frame to commence decoding. This scenario causes the video to appear as frozen for a while (it could range from a fraction of a second to a few seconds). Moreover, since audio continues to play, the video appears to resume at a different location compared to where it was paused.
The reasons for the delay in resuming are:
a) Decoder loses all the en-queued data (yet to be decoded) when the player goes background. This may amount to less than a sec.
b) It may take several buffers before decoder gets a key frame. This may amount to several seconds, in this case its about 3 to 4 sec.
c) After decoder starts decoding and starts feeding to post-processor, it may take further 1 or 2 sec to catch-up with the sync-clock.
The combined effect of all the above, causes the video to appear as frozen for a while.
Fix:
1. Set the position on Resource Lost so as to seek the stream backwards by just few milli secs (KResourceLostOffset = 10ms) from the last displayed frame position when the player comes foreground (When Play() is being issued). This should ensure seeking back to the first available key frame before the last displayed frame, which in turn solves all the three reasons stated above. In addition also removing the check with the flags: m_prebufferEnabled and m_bfirstPlayHasBeenSent at Play() as same is being already handled by the flag: m_setPositionSent.
2. Added new interface in MHXStateCtrlObs as CanSeek() which returns TRUE if content is seek-able. XPS content and live streams are not seek-able. This seek information is cached once.
But the playback shall resume from a position which was already played before going to background. This behavior, however, is more acceptable compared to a frozen video for few seconds.
Files modified & changes:
clientapps/symbianMmf/hxmmfstatectrl.cpp
clientapps/symbianMmf/hxmmfstatectrl.h
clientapps/symbianMmf/hxmmfstatectrlobs.h
clientapps/symbianMmf/hxmmfstatepaused.cpp
clientapps/symbianMmf/hxmmfstatepaused.h
clientapps/symbianMmf/common/hxmmfbasectrl.h
clientapps/symbianMmf/common/hxmmfbasectrl.cpp
Image Size and Heap Use impact: No major impact
Module Release testing (STIF) : Ongoing
Test case(s) Added : No
Memory leak check performed : Passed, No additional leaks introduced.
Platforms and Profiles Build Verified: helix-client-s60-52-mmf-mdf-dsp
Platforms and Profiles Functionality verified: armv5
Branch: 210CayS, 420Bizo and HEAD
Attached diff.
Index: hxmmfbasectrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/common/hxmmfbasectrl.cpp,v
retrieving revision 1.1.2.65
retrieving revision 1.1.2.66
diff -u -d -r1.1.2.65 -r1.1.2.66
--- hxmmfbasectrl.cpp 6 Apr 2010 15:38:26 -0000 1.1.2.65
+++ hxmmfbasectrl.cpp 12 Apr 2010 04:57:02 -0000 1.1.2.66
@@ -257,6 +257,8 @@
, m_bMetadataEventConfig(FALSE)
,m_eDataSourceChoice( EDataSynchronousSource )
,m_bLocalPlayback(TRUE)
+ ,m_bSeekable(TRUE)
+ ,m_bSeekCached(FALSE)
{
}
@@ -1429,6 +1431,42 @@
}
}
+HXBOOL HXMMFBaseCtrl::CanSeek()
+{
+ if(!m_bSeekCached)
+ {
+ TInt isLive = 0;
+ TInt isSeekable = 1;
+ TInt isPauseSupported = 1;
+ TInt isXPSStream = 0;
+
+ m_pMetaData->FindMetaDataValueByName("LiveStream",isLive);
+ m_pMetaData->FindMetaDataValueByName("Seekable",isSeekable);
+ m_pMetaData->FindMetaDataValueByName("streamingPauseSupport",isPauseSupported);
+
+ if(!m_url.IsEmpty())
+ {
+ isXPSStream = m_url.Find("XPSServer"); // This is used to find the XPS server name.
+ }
+
+ if(isLive || !isSeekable || !isPauseSupported || isXPSStream > 0 )
+ {
+ m_bSeekable = FALSE;
+ }
+ else
+ {
+ m_bSeekable = TRUE;
+ }
+
+ m_bSeekCached = TRUE;
+ }
+
+ HXLOGL1(HXLOG_SMMF, "HXMMFBaseCtrl::CanSeek() %d", m_bSeekable);
+
+ return m_bSeekable;
+
+}
+
void
HXMMFBaseCtrl::HandleEnvChange()
{