DirectShow IMediaSeeker

This is a discussion on DirectShow IMediaSeeker within the Windows Programming forums, part of the Platform Specific Boards category; OK, I'm playing a videofile using IMediaControl and IGraphBuilder, and it works great. When the playback i paused and I ...

  1. #1
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072

    DirectShow IMediaSeeker

    OK, I'm playing a videofile using IMediaControl and IGraphBuilder, and it works great.

    When the playback i paused and I try to seek using IMediaSeeker, it works. However, the frame at the new position doesn't show uop until the playback starts again.

    How do I seek to a new position and display the frame at that position without starting the playback?
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  2. #2
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    Göteborg, Sweden
    Posts
    2,072
    Perhaps some code is appropriate:

    This method jumps back 0.2 seconds, but it doesn't display the fram until the playback resumes.

    Code:
    // DirectShow interfaces
    IMediaSeeking *pMS = NULL;
    //..
    void GoBack()
    {
        HRESULT hr;
    
        if (!pMS)
            return;
    
        if (g_psCurrent == Paused)
        {
            double BackTime      = -0.2;
            LONGLONG BackTimeFmt = BackTime * 10000000.0;
            LONGLONG MediaStreamTime,CurrentMediaStreamTime,Dummy;
            pMS->ConvertTimeFormat(&MediaStreamTime,NULL,BackTimeFmt,&TIME_FORMAT_MEDIA_TIME);
     
    
            pMS->GetPositions(&CurrentMediaStreamTime,&Dummy);
            MediaStreamTime += CurrentMediaStreamTime;
            pMS->SetPositions(&MediaStreamTime,AM_SEEKING_AbsolutePositioning,NULL,AM_SEEKING_NoPositioning);
        }
    }
    //..
    By the way: Why was the forum down for about a week recently?
    Last edited by Sang-drax; 09-25-2002 at 12:00 PM.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  3. #3
    ˇAmo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136
    server problems

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DirectShow knowledge, anyone ?
    By foxman in forum Tech Board
    Replies: 3
    Last Post: 11-26-2008, 06:58 AM
  2. Debugging DirectShow
    By Elysia in forum Windows Programming
    Replies: 0
    Last Post: 10-28-2007, 12:01 PM
  3. DirectShow NEWBIE Tutorial Request
    By WaterNut in forum C++ Programming
    Replies: 4
    Last Post: 07-23-2006, 11:26 PM
  4. DirectShow code - long night of coding
    By VirtualAce in forum Game Programming
    Replies: 2
    Last Post: 03-27-2006, 10:50 AM
  5. DirectShow tutorial in C or C++
    By BobS0327 in forum Windows Programming
    Replies: 0
    Last Post: 10-23-2005, 01:15 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21