Break out RtpClock to system_wrappers and make it more generic.

The goal with this new clock interface is to have something which is used all
over WebRTC to make it easier to switch clock implementation depending on where
the components are used. This is a first step in that direction.

Next steps will be to, step by step, move all modules, video engine and voice
engine over to the new interface, effectively deprecating the old clock
interfaces. Long-term my vision is that we should be able to deprecate the clock
of WebRTC and rely on the user providing the implementation.

TEST=vie_auto_test, rtp_rtcp_unittests, trybots

Review URL: https://webrtc-codereview.appspot.com/1041004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@3381 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
stefan@webrtc.org
2013-01-17 14:01:20 +00:00
parent 3b7feb2a5d
commit 20ed36dada
31 changed files with 468 additions and 379 deletions

View File

@ -14,18 +14,21 @@
namespace webrtc {
class FakeRtpRtcpClock : public RtpRtcpClock {
class FakeRtpRtcpClock : public Clock {
public:
FakeRtpRtcpClock() {
time_in_ms_ = 123456;
}
// Return a timestamp in milliseconds relative to some arbitrary
// source; the source is fixed for this clock.
virtual WebRtc_Word64 GetTimeInMS() {
virtual WebRtc_Word64 TimeInMilliseconds() {
return time_in_ms_;
}
virtual int64_t TimeInMicroseconds() {
return time_in_ms_ * 1000;
}
// Retrieve an NTP absolute timestamp.
virtual void CurrentNTP(WebRtc_UWord32& secs, WebRtc_UWord32& frac) {
virtual void CurrentNtp(WebRtc_UWord32& secs, WebRtc_UWord32& frac) {
secs = time_in_ms_ / 1000;
frac = (time_in_ms_ % 1000) * 4294967;
}