Friday, October 17, 2008

Without calling Pause () fn we are not able to set seek position...

 


Without calling  Pause () fn we are not able to set seek position...
--------------------------------------------------------------------------

we are able to do the SetPosition ( set the seek position) on the fly while running the video.

    In our Source Filter we are not able to set the seek position. Before setting the seek position, we have to the

following:

        Pause() of IMediaControl;
 SetPosition();
 Run()

then only  we are able to set the seek position to the source filter.

 

Solution:
--------------
       The reason we are not able to do the seek position while running the video is we are not handling
setPosition properly.


  if Source Filter's output pin thread  exists , that represents the video is running; then

          i)call the stop on Source Filter's output pins .

  if(m_paStreams[i]->ThreadExists())
   {
     if(m_paStreams[i]->IsConnected())
     {
    hr = m_paStreams[i]->DeliverBeginFlush() ;
     }
    
     if(m_State != State_Stopped )
     {
      hr = m_paStreams[i]->Stop();
     }
         
     if(m_paStreams[i]->IsConnected())
     {
    hr = m_paStreams[i]->DeliverEndFlush() ;
     }  
   }
 

         ii)Set the seek position

 iii)call the Pause () fn on Each output pins of the source Filter


 
If the filter graph is stopped, the video renderer does not update the image after a seek operation. To the user, it will

appear as if the seek did not happen. To update the image, pause the graph after the seek operation. Pausing the graph cues a

new video frame for the video renderer. You can use the IMediaControl::StopWhenReady method, which pauses the graph and then

stops it.
 

0 Comments:

Post a Comment

<< Home