Search code examples
streaminglive-streamingms-media-foundation

Can I relate MFTIME to the real system time?


I am writing some code that forwards samples from Windows Media Foundation to live555. While MF uses its 100 ns timestamps, live555 uses "real time" in form of struct timeval. I know how to fake the latter from GetSystemTime(), but I wonder whether it is possible to derive the "real time" from the MF sample time and the data passed to IMFClockStateSink::OnClockStart?


Solution

  • Media Foundation also provides a presentation time source based on the system clock.

    While this presentation source is providing time stamps based on system clock (presumably using or using shared source with timeGetTime but I did not check), this source is not the only option.

    So you basically should not make assumptions on correlation between clock time and current system "absolute" time. Time stamps are supposed to only provide relative time increments at 10 MHz rate.

    If the presentation clock uses some other time source, ...