Inject TickTimeInterface into VCM and tests
The purpose of this change is to introduce dependency injection of the timer into the video coding module. Review URL: http://webrtc-codereview.appspot.com/332003 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1220 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -9,17 +9,20 @@
|
||||
*/
|
||||
|
||||
#include "internal_defines.h"
|
||||
#include "modules/video_coding/main/source/tick_time_interface.h"
|
||||
#include "timestamp_extrapolator.h"
|
||||
#include "tick_time.h"
|
||||
#include "trace.h"
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
VCMTimestampExtrapolator::VCMTimestampExtrapolator(WebRtc_Word32 vcmId, WebRtc_Word32 id)
|
||||
VCMTimestampExtrapolator::VCMTimestampExtrapolator(TickTimeInterface* clock,
|
||||
WebRtc_Word32 vcmId,
|
||||
WebRtc_Word32 id)
|
||||
:
|
||||
_rwLock(RWLockWrapper::CreateRWLock()),
|
||||
_vcmId(vcmId),
|
||||
_id(id),
|
||||
_clock(clock),
|
||||
_startMs(0),
|
||||
_firstTimestamp(0),
|
||||
_wrapArounds(0),
|
||||
@@ -35,7 +38,7 @@ _accDrift(6600), // in timestamp ticks, i.e. 15 ms
|
||||
_accMaxError(7000),
|
||||
_P11(1e10)
|
||||
{
|
||||
Reset(VCMTickTime::MillisecondTimestamp());
|
||||
Reset(_clock->MillisecondTimestamp());
|
||||
}
|
||||
|
||||
VCMTimestampExtrapolator::~VCMTimestampExtrapolator()
|
||||
@@ -53,7 +56,7 @@ VCMTimestampExtrapolator::Reset(const WebRtc_Word64 nowMs /* = -1 */)
|
||||
}
|
||||
else
|
||||
{
|
||||
_startMs = VCMTickTime::MillisecondTimestamp();
|
||||
_startMs = _clock->MillisecondTimestamp();
|
||||
}
|
||||
_prevMs = _startMs;
|
||||
_firstTimestamp = 0;
|
||||
|
||||
Reference in New Issue
Block a user