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

Side by Side Diff: webrtc/modules/audio_device/dummy/file_audio_device.cc

Issue 2116003003: Implement RecordingIsInitialized in file_audio_device.cc. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 #include "webrtc/base/platform_thread.h" 10 #include "webrtc/base/platform_thread.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 _recordingFramesIn10MS = static_cast<size_t>(kRecordingFixedSampleRate / 100); 166 _recordingFramesIn10MS = static_cast<size_t>(kRecordingFixedSampleRate / 100);
167 167
168 if (_ptrAudioBuffer) { 168 if (_ptrAudioBuffer) {
169 _ptrAudioBuffer->SetRecordingSampleRate(kRecordingFixedSampleRate); 169 _ptrAudioBuffer->SetRecordingSampleRate(kRecordingFixedSampleRate);
170 _ptrAudioBuffer->SetRecordingChannels(kRecordingNumChannels); 170 _ptrAudioBuffer->SetRecordingChannels(kRecordingNumChannels);
171 } 171 }
172 return 0; 172 return 0;
173 } 173 }
174 174
175 bool FileAudioDevice::RecordingIsInitialized() const { 175 bool FileAudioDevice::RecordingIsInitialized() const {
176 return true; 176 return _recordingFramesIn10MS != 0;
177 } 177 }
178 178
179 int32_t FileAudioDevice::StartPlayout() { 179 int32_t FileAudioDevice::StartPlayout() {
180 if (_playing) { 180 if (_playing) {
181 return 0; 181 return 0;
182 } 182 }
183 183
184 _playoutFramesIn10MS = static_cast<size_t>(kPlayoutFixedSampleRate / 100); 184 _playoutFramesIn10MS = static_cast<size_t>(kPlayoutFixedSampleRate / 100);
185 _playing = true; 185 _playing = true;
186 _playoutFramesLeft = 0; 186 _playoutFramesLeft = 0;
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 524
525 uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime; 525 uint64_t deltaTimeMillis = _clock->CurrentNtpInMilliseconds() - currentTime;
526 if(deltaTimeMillis < 10) { 526 if(deltaTimeMillis < 10) {
527 SleepMs(10 - deltaTimeMillis); 527 SleepMs(10 - deltaTimeMillis);
528 } 528 }
529 529
530 return true; 530 return true;
531 } 531 }
532 532
533 } // namespace webrtc 533 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698