OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 speed_(speed), | 32 speed_(speed), |
33 last_playout_ms_(-1), | 33 last_playout_ms_(-1), |
34 clock_(clock, speed), | 34 clock_(clock, speed), |
35 tick_(EventTimerWrapper::Create()), | 35 tick_(EventTimerWrapper::Create()), |
36 thread_(FakeAudioDevice::Run, this, "FakeAudioDevice"), | 36 thread_(FakeAudioDevice::Run, this, "FakeAudioDevice"), |
37 file_utility_(new ModuleFileUtility(0)), | 37 file_utility_(new ModuleFileUtility(0)), |
38 input_stream_(FileWrapper::Create()) { | 38 input_stream_(FileWrapper::Create()) { |
39 memset(captured_audio_, 0, sizeof(captured_audio_)); | 39 memset(captured_audio_, 0, sizeof(captured_audio_)); |
40 memset(playout_buffer_, 0, sizeof(playout_buffer_)); | 40 memset(playout_buffer_, 0, sizeof(playout_buffer_)); |
41 // Open audio input file as read-only and looping. | 41 // Open audio input file as read-only and looping. |
42 EXPECT_EQ(0, input_stream_->OpenFile(filename.c_str(), true, true)) | 42 EXPECT_EQ(0, input_stream_->OpenFile(filename.c_str(), true)) << filename; |
43 << filename; | |
44 } | 43 } |
45 | 44 |
46 FakeAudioDevice::~FakeAudioDevice() { | 45 FakeAudioDevice::~FakeAudioDevice() { |
47 Stop(); | 46 Stop(); |
48 | 47 |
49 thread_.Stop(); | 48 thread_.Stop(); |
50 } | 49 } |
51 | 50 |
52 int32_t FakeAudioDevice::Init() { | 51 int32_t FakeAudioDevice::Init() { |
53 rtc::CritScope cs(&lock_); | 52 rtc::CritScope cs(&lock_); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 rtc::CritScope cs(&lock_); | 137 rtc::CritScope cs(&lock_); |
139 capturing_ = true; | 138 capturing_ = true; |
140 } | 139 } |
141 | 140 |
142 void FakeAudioDevice::Stop() { | 141 void FakeAudioDevice::Stop() { |
143 rtc::CritScope cs(&lock_); | 142 rtc::CritScope cs(&lock_); |
144 capturing_ = false; | 143 capturing_ = false; |
145 } | 144 } |
146 } // namespace test | 145 } // namespace test |
147 } // namespace webrtc | 146 } // namespace webrtc |
OLD | NEW |