[Helix-client-dev] CR: EGRS-7VBVGU: Video frame is not updated with current position after seeking in pause state

<[email protected]> Fri, 6 Nov 2009 06:24:43 +0100
Newsgroups gmane.comp.multimedia.helix.devel
Message-ID <20D73E2631F7914F868646E119DEC1CE20FCDD1ED1@NOK-EUMSG-02.mgdnok.nokia.com>
"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:  [email protected]
 
Reviewed by:
 
TSW Id: EGRS-7VBVGU 
 
Date: 11/6/2009
	 
Project: SymbianMmf_wm
 
Synopsis: Video frame is not updated with current position after seeking in pause state
 
Overview:
This error was introduced after CR 417-21674 and CPHU-7RJRN9, the first fix introduces an interface to enable pausing and resuming scheduler and the second one resumes the scheduler in audio and video controllers as soon as HXPlayer gets the play command. The problem occurs when we seek after pausing, the Video frame is not updated with current position as scheduler has already been paused.

Fix:
Now we are resuming the scheduler for a brief time (till the video frame is updated) and then pausing it again. ResumeScheduler() is called after SetPositionL() just to update the Video frame after seeking. Once the video frame has been updated, calling m_pAdviseSink->OnPostSeek(,) from HXPlayer::SendPostSeekIfNecessary() just to notify HXMMFStateCtrl of OnPostSeek event. An additional interface had to be defined at hxmmfstatectrl observer for this OnPostSeek event to notify the MMF only if we are in Paused state. And at the implementation of OnPostSeek() checking if Scheduler is not paused then pausing it.

Files modified & changes:
/clientapps/symbianMmf/common/hxmmfbasectrl.cpp
/clientapps/symbianMmf/common/hxmmfbasectrl.h
/clientapps/symbianMmf/hxmmfstatectrl.cpp
/clientapps/symbianMmf/hxmmfstatectrlobs.h
/clientapps/symbianMmf/videocontroller/hxmmfctrlimpl.cpp
/clientapps/symbianMmf/videocontroller/hxmmfctrlimpl.h
/clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp
/clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.h
/client/core/hxplay.cpp

Image Size and Heap Use impact: No major impact
 
Module Release testing (STIF) : Passed
 
Test case(s) Added  : No

Memory leak check performed : Passed, No additional leaks introduced.
 
Platforms and Profiles Build Verified: helix-client-s60-50-mmf-mdf-dsp
 
Platforms and Profiles Functionality verified: armv5
 
Branch: 223Cays, 221Cays, 210Cays, HEAD and 420Brizo

CVS Diff on 223Cays: Attached

_______________________________________________
Helix-client-dev mailing list
[email protected]
http://lists.helixcommunity.org/mailman/listinfo/helix-client-dev
hxmmbasectrl.cpp.diff (application/octet-stream, 750 B)
Index: hxmmfbasectrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/common/hxmmfbasectrl.cpp,v
retrieving revision 1.1.2.47.4.4
diff -u -w -r1.1.2.47.4.4 hxmmfbasectrl.cpp
--- hxmmfbasectrl.cpp   24 Sep 2009 13:12:19 -0000      1.1.2.47.4.4
+++ hxmmfbasectrl.cpp   4 Nov 2009 08:41:52 -0000
@@ -954,6 +954,15 @@
         HXLOGL1(HXLOG_SMMF, "HXMMFBaseCtrl::SetPositionL(%lu)", seekTime);

         m_pStateCtrl->SetPosition(seekTime);
+
+    }
+    // Resuming the Scheduler briefly just to update the Video Frame
+    if(m_pScheduler3)
+    {
+        if (m_pScheduler3->IsPaused())
+        {
+           m_pScheduler3->ResumeScheduler();
+        }
     }
 }
hxmmfstatectrl.cpp.diff (application/octet-stream, 668 B)
Index: hxmmfstatectrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstatectrl.cpp,v
retrieving revision 1.4.2.25
diff -u -w -r1.4.2.25 hxmmfstatectrl.cpp
--- hxmmfstatectrl.cpp  27 Jan 2009 18:01:15 -0000      1.4.2.25
+++ hxmmfstatectrl.cpp  5 Nov 2009 09:36:34 -0000
@@ -174,7 +174,11 @@
 {
     TInt lError;
     lError = m_pCurrentState->OnPostSeek(ulOldTime,ulNewTime);
-
+    //tell MMF for OnPostSeek Event Only if we are in Paused state
+    if (m_pCurrentState == m_pPaused)
+    {
+        m_pObserver->OnPostSeek(ulOldTime,ulNewTime);
+    }
     return(lError);
 }
hxmmfstatectrlobs.h.diff (application/octet-stream, 722 B)
Index: hxmmfstatectrlobs.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/hxmmfstatectrlobs.h,v
retrieving revision 1.1.2.4
diff -u -w -r1.1.2.4 hxmmfstatectrlobs.h
--- hxmmfstatectrlobs.h 27 Jan 2009 18:01:15 -0000      1.1.2.4
+++ hxmmfstatectrlobs.h 4 Nov 2009 08:40:29 -0000
@@ -67,6 +67,7 @@
     virtual void OnPrepareComplete() = 0;
     virtual void OnPlaying() = 0;
     virtual void OnPaused() = 0;
+    virtual void OnPostSeek(ULONG32 ulOldTime, ULONG32 ulNewTime) = 0;
     virtual void OnMetadataUpdate(IHXBuffer* pKey, IHXBuffer* pValue) = 0;
     virtual void OnError( const UINT8 unSeverity,
               const ULONG32 ulHXCode,
hxmmbasectrl.h.diff (application/octet-stream, 727 B)
Index: hxmmfbasectrl.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/common/hxmmfbasectrl.h,v
retrieving revision 1.1.2.17.4.1
diff -u -w -r1.1.2.17.4.1 hxmmfbasectrl.h
--- hxmmfbasectrl.h     15 Apr 2009 15:36:03 -0000      1.1.2.17.4.1
+++ hxmmfbasectrl.h     4 Nov 2009 08:42:36 -0000
@@ -158,6 +158,7 @@
     virtual void OnPrepareComplete()    = 0;
     virtual void OnPlaying();
     virtual void OnPaused();
+    virtual void OnPostSeek(ULONG32 ulOldTime, ULONG32 ulNewTime) = 0;
     virtual void OnMetadataUpdate(IHXBuffer* pKey, IHXBuffer* pValue);
     virtual void OnLoadingStarted()     = 0;
     virtual void OnLoadingComplete()    = 0;
hxmmfctrlimpl.cpp.diff (application/octet-stream, 822 B)
Index: hxmmfctrlimpl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/hxmmfctrlimpl.cpp,v
retrieving revision 1.12.2.65.4.3
diff -u -w -r1.12.2.65.4.3 hxmmfctrlimpl.cpp
--- hxmmfctrlimpl.cpp   9 Jun 2009 20:15:25 -0000       1.12.2.65.4.3
+++ hxmmfctrlimpl.cpp   4 Nov 2009 08:43:41 -0000
@@ -1298,6 +1298,20 @@
 }

 void
+HXMMFCtrlImpl::OnPostSeek(ULONG32 /*ulOldTime*/, ULONG32 /*ulNewTime*/)
+{
+    HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::OnPostSeek()");
+
+    if(m_pScheduler3)
+    {
+        if(!(m_pScheduler3->IsPaused()))
+        {
+            m_pScheduler3->PauseScheduler();
+        }
+    }
+}
+
+void
 HXMMFCtrlImpl::OnLoadingStarted()
 {
     HXLOGL1(HXLOG_SMMF, "HXMMFCtrlImpl::OnLoadingStarted()");
hxmmfctrlimpl.h.diff (application/octet-stream, 686 B)
Index: hxmmfctrlimpl.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/videocontroller/hxmmfctrlimpl.h,v
retrieving revision 1.3.2.25
diff -u -w -r1.3.2.25 hxmmfctrlimpl.h
--- hxmmfctrlimpl.h     23 Feb 2009 17:47:31 -0000      1.3.2.25
+++ hxmmfctrlimpl.h     4 Nov 2009 08:44:53 -0000
@@ -194,6 +194,7 @@
                       const char* pUserString,
                       const char* pMoreInfoURL );
         void OnPrepareComplete();
+        void OnPostSeek(ULONG32 ulOldTime, ULONG32 ulNewTime);
         void OnLoadingStarted();
         void OnLoadingComplete();
         void OnPresentationClosed();
hxmmfaudioctrl.cpp.diff (application/octet-stream, 844 B)
Index: hxmmfaudioctrl.cpp
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.cpp,v
retrieving revision 1.1.2.22.4.3
diff -u -w -r1.1.2.22.4.3 hxmmfaudioctrl.cpp
--- hxmmfaudioctrl.cpp  9 Jun 2009 20:15:25 -0000       1.1.2.22.4.3
+++ hxmmfaudioctrl.cpp  4 Nov 2009 08:46:00 -0000
@@ -783,6 +783,20 @@
 }

 void
+CHXAudioController::OnPostSeek(ULONG32 /*ulOldTime*/, ULONG32 /*ulNewTime*/)
+{
+    HXLOGL1(HXLOG_SMMF, "CHXAudioController::OnPostSeek()");
+
+    if(m_pScheduler3)
+    {
+         if(!(m_pScheduler3->IsPaused()))
+         {
+             m_pScheduler3->PauseScheduler();
+         }
+    }
+}
+
+void
 CHXAudioController::OnLoadingStarted()
 {
     HXLOGL1(HXLOG_SMMF, "CHXAudioController::OnLoadingStarted()");
hxmmfaudioctrl.h.diff (application/octet-stream, 686 B)
Index: hxmmfaudioctrl.h
===================================================================
RCS file: /cvsroot/clientapps/symbianMmf/audiocontroller/hxmmfaudioctrl.h,v
retrieving revision 1.1.2.7
diff -u -w -r1.1.2.7 hxmmfaudioctrl.h
--- hxmmfaudioctrl.h    4 Sep 2007 20:35:48 -0000       1.1.2.7
+++ hxmmfaudioctrl.h    4 Nov 2009 08:47:03 -0000
@@ -158,6 +158,7 @@
                       const char* pUserString,
                       const char* pMoreInfoURL );
         void OnPrepareComplete();
+        void OnPostSeek(ULONG32 ulOldTime, ULONG32 ulNewTime);
         void OnLoadingStarted();
         void OnLoadingComplete();
         void OnPresentationClosed();
hxplay.cpp.diff (application/octet-stream, 830 B)
Index: hxplay.cpp
===================================================================
RCS file: /cvsroot/client/core/hxplay.cpp,v
retrieving revision 1.123.2.17
diff -u -w -r1.123.2.17 hxplay.cpp
--- hxplay.cpp  13 Mar 2009 21:37:35 -0000      1.123.2.17
+++ hxplay.cpp  4 Nov 2009 08:48:35 -0000
@@ -9478,7 +9478,10 @@
         pRendererInfo->m_pRenderer->OnPostSeek(
                 pRendererInfo->m_pStreamInfo->m_ulTimeBeforeSeek,
                 pRendererInfo->m_pStreamInfo->m_ulTimeAfterSeek);
-
+        // Call just to Notify OnPostSeek Event
+        m_pAdviseSink->OnPostSeek(
+                pRendererInfo->m_pStreamInfo->m_ulTimeBeforeSeek,
+                pRendererInfo->m_pStreamInfo->m_ulTimeAfterSeek);
         pRendererInfo->m_pStreamInfo->m_pStream->m_bPostSeekToBeSent = FALSE;
     }
 }