Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: webrtc/test/fake_audio_device.cc

Issue 1674413004: Added A/V sync tests with drifting clocks. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: drift replaced by speed Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/test/fake_audio_device.cc
diff --git a/webrtc/test/fake_audio_device.cc b/webrtc/test/fake_audio_device.cc
index 31cebda6521a01455fbe17f5b789423d296aa82e..0381981c207a191b74a669ef1881133f80208443 100644
--- a/webrtc/test/fake_audio_device.cc
+++ b/webrtc/test/fake_audio_device.cc
@@ -22,13 +22,17 @@
namespace webrtc {
namespace test {
-FakeAudioDevice::FakeAudioDevice(Clock* clock, const std::string& filename)
+FakeAudioDevice::FakeAudioDevice(Clock* clock,
+ const std::string& filename,
+ float speed)
: audio_callback_(NULL),
capturing_(false),
captured_audio_(),
playout_buffer_(),
+ speed_(speed),
last_playout_ms_(-1),
- clock_(clock),
+ drifting_clock_(clock, speed),
+ clock_(speed == DriftingClock::kNoDrift ? clock : &drifting_clock_),
pbos-webrtc 2016/02/10 13:28:14 Just always use the drifting clock if it's a no-op
danilchap 2016/02/10 15:50:19 Simplified. After few failed tries to explain my r
tick_(EventTimerWrapper::Create()),
thread_(FakeAudioDevice::Run, this, "FakeAudioDevice"),
file_utility_(new ModuleFileUtility(0)),
@@ -51,7 +55,7 @@ int32_t FakeAudioDevice::Init() {
if (file_utility_->InitPCMReading(*input_stream_.get()) != 0)
return -1;
- if (!tick_->StartTimer(true, 10))
+ if (!tick_->StartTimer(true, 10 / speed_))
return -1;
thread_.Start();
thread_.SetPriority(rtc::kHighPriority);

Powered by Google App Engine
This is Rietveld 408576698