[Live-devel] Converting timeval to DateTime .NET

Ross Finlayson finlayson at live555.com
Thu Dec 11 04:54:31 PST 2008


>  I would like to know how can I convert a timeval presentationTime value in
>  function afterGettingFrame(..., struct timeval presentationTime) to .NET
>  DateTime ticks (number of ticks passed since 0001-01-01)?

I don't know, but this seems completely unrelated to your next question:

>  In my afterGettingFrame(frameSize, presentationTime) function I made
>a log call
>  LOG("Video frame received: %d bytes (%d:%d)\n"), frameSize,
>presentationTime.tv_sec, presentationTime.tv_usec);
>
>  And the logs is
>2008-12-11 14:30:09   Video frame received: 14796 bytes (8970:592115)
>2008-12-11 14:30:09   Video frame received: 1050 bytes (8971:592259)
>2008-12-11 14:30:10   Video frame received: 1031 bytes (8972:592403)
>2008-12-11 14:30:12   Video frame received: 1074 bytes
>(9745106:531920)        <------ gap
>2008-12-11 14:30:12   Video frame received: 1045 bytes (9745107:532064)
>2008-12-11 14:30:13   Video frame received: 1040 bytes (9745108:532197)
>2008-12-11 14:30:14   Video frame received: 1121 bytes (9745109:532341)
>2008-12-11 14:30:15   Video frame received: 1121 bytes (9745110:532485)
>2008-12-11 14:30:17   Video frame received: 14666 bytes (9745111:532618)
>2008-12-11 14:30:17   Video frame received: 1132 bytes (9745112:532762)
>2008-12-11 14:30:18   Video frame received: 1103 bytes (9745113:532895)
>2008-12-11 14:30:19   Video frame received: 1100 bytes (9745114:533039)
>
>  It's not clear for me why there is a gap between 3rd and 4th record?

It's because the first few presentation times - before RTCP 
synchronization occurs - are just 'guesses' made by the receiving 
code (based on the receiver's 'wall clock' and the RTP timestamp). 
However, once RTCP synchronization occurs, all subsequent 
presentation times will be accurate.

This means is that a receiver should be prepared for the fact that 
the first few presentation times (until RTCP synchronization starts) 
will not be accurate.  The code, however, can check this by calling 
"RTPSource:: hasBeenSynchronizedUsingRTCP()".  If this returns False, 
then the presentation times are not accurate, and should be treated 
with 'a grain of salt'.  However, once the call to returns True, then 
the presentation times (from then on) will be accurate.
-- 

Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


More information about the live-devel mailing list