Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. Microsoft Media Foundation - Replacing Time Source / Clock

Microsoft Media Foundation - Replacing Time Source / Clock

Scheduled Pinned Locked Moved Windows API
c++comtutorialquestion
1 Posts 1 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 9365504
    wrote on last edited by
    #1

    I want to playback videos with Microsoft Media foundation with a custom clock. I am starting with the example found at http://archive.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=mediafoundation&DownloadId=8413[^] The idea is to replace the clock with one that is driven by UDP packets. The videos will be silent (the audio turned off, preferably not even decoded). I have stubbed out what I think is a clock replacement, but what I can't figure out is why my calls to GetCorrellatedTime seem to only occur at the start of playback. I expected GetCorrellatedTime to be called by the playback engine repeatedly.... but that's just not happening. Here's the cpp code for my timesource. Note that it doesn't do much of anything yet... it is just a stub. Any Ideas? Thanks in advance

    #include "MFPlayer.h"
    #include "TimeSource.h"

    HRESULT STDMETHODCALLTYPE UDPClock::GetClockCharacteristics( /* [out] */ __RPC__out DWORD *pdwCharacteristics)
    {
    *pdwCharacteristics = MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ;
    return S_OK;
    }

    HRESULT STDMETHODCALLTYPE UDPClock::GetCorrelatedTime( /* [in] */ DWORD dwReserved,/* [out] */ __RPC__out LONGLONG *pllClockTime,/* [out] */ __RPC__out MFTIME *phnsSystemTime)
    {
    m_Time = GetTickCount64();
    m_System_Time = GetTickCount64();

    \*pllClockTime = m\_Time;
    \*phnsSystemTime = m\_System\_Time;
    return S\_OK;
    

    }

    HRESULT STDMETHODCALLTYPE UDPClock::GetContinuityKey( /* [out] */ __RPC__out DWORD *pdwContinuityKey)
    {
    *pdwContinuityKey = 0;
    return S_OK;
    }

    HRESULT STDMETHODCALLTYPE UDPClock::GetState( /* [in] */ DWORD dwReserved,/* [out] */ __RPC__out MFCLOCK_STATE *peClockState)
    {
    *peClockState = MFCLOCK_STATE_RUNNING;
    return S_OK;
    }

    HRESULT STDMETHODCALLTYPE UDPClock::GetProperties( /* [out] */ __RPC__out MFCLOCK_PROPERTIES *pClockProperties)
    {
    pClockProperties->qwCorrelationRate = 1000000;
    pClockProperties->guidClockId = GUID_NULL;
    pClockProperties->qwClockFrequency = MFCLOCK_CHARACTERISTICS_FLAG_FREQUENCY_10MHZ;
    pClockProperties->dwClockTolerance = MFCLOCK_TOLERANCE_UNKNOWN;
    pClockProperties->dwClockJitter = 1;//10000;
    pClockProperties->dwClockFlags = MFCLOCK_RELATIONAL_FL

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups