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

Side by Side Diff: webrtc/modules/audio_device/audio_device_impl.cc

Issue 2169903002: Remove redundant UMA stat reporting. Remove logs that are noisy on Windows. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Undo ignoring StopPlayout and StopRecording 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 640 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 bool isInitialized = _ptrAudioDevice->MicrophoneIsInitialized(); 651 bool isInitialized = _ptrAudioDevice->MicrophoneIsInitialized();
652 LOG(INFO) << "output: " << isInitialized; 652 LOG(INFO) << "output: " << isInitialized;
653 return (isInitialized); 653 return (isInitialized);
654 } 654 }
655 655
656 // ---------------------------------------------------------------------------- 656 // ----------------------------------------------------------------------------
657 // MaxSpeakerVolume 657 // MaxSpeakerVolume
658 // ---------------------------------------------------------------------------- 658 // ----------------------------------------------------------------------------
659 659
660 int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const { 660 int32_t AudioDeviceModuleImpl::MaxSpeakerVolume(uint32_t* maxVolume) const {
661 LOG(INFO) << __FUNCTION__;
662 CHECK_INITIALIZED(); 661 CHECK_INITIALIZED();
663 662
664 uint32_t maxVol(0); 663 uint32_t maxVol(0);
665 664
666 if (_ptrAudioDevice->MaxSpeakerVolume(maxVol) == -1) { 665 if (_ptrAudioDevice->MaxSpeakerVolume(maxVol) == -1) {
667 return -1; 666 return -1;
668 } 667 }
669 668
670 *maxVolume = maxVol; 669 *maxVolume = maxVol;
671 LOG(INFO) << "output: " << *maxVolume;
672 return (0); 670 return (0);
673 } 671 }
674 672
675 // ---------------------------------------------------------------------------- 673 // ----------------------------------------------------------------------------
676 // MinSpeakerVolume 674 // MinSpeakerVolume
677 // ---------------------------------------------------------------------------- 675 // ----------------------------------------------------------------------------
678 676
679 int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const { 677 int32_t AudioDeviceModuleImpl::MinSpeakerVolume(uint32_t* minVolume) const {
680 LOG(INFO) << __FUNCTION__;
681 CHECK_INITIALIZED(); 678 CHECK_INITIALIZED();
682 679
683 uint32_t minVol(0); 680 uint32_t minVol(0);
684 681
685 if (_ptrAudioDevice->MinSpeakerVolume(minVol) == -1) { 682 if (_ptrAudioDevice->MinSpeakerVolume(minVol) == -1) {
686 return -1; 683 return -1;
687 } 684 }
688 685
689 *minVolume = minVol; 686 *minVolume = minVol;
690 LOG(INFO) << "output: " << *minVolume;
691 return (0); 687 return (0);
692 } 688 }
693 689
694 // ---------------------------------------------------------------------------- 690 // ----------------------------------------------------------------------------
695 // SpeakerVolumeStepSize 691 // SpeakerVolumeStepSize
696 // ---------------------------------------------------------------------------- 692 // ----------------------------------------------------------------------------
697 693
698 int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const { 694 int32_t AudioDeviceModuleImpl::SpeakerVolumeStepSize(uint16_t* stepSize) const {
699 LOG(INFO) << __FUNCTION__; 695 LOG(INFO) << __FUNCTION__;
700 CHECK_INITIALIZED(); 696 CHECK_INITIALIZED();
(...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1140 *available = isAvailable; 1136 *available = isAvailable;
1141 LOG(INFO) << "output: " << isAvailable; 1137 LOG(INFO) << "output: " << isAvailable;
1142 return (0); 1138 return (0);
1143 } 1139 }
1144 1140
1145 // ---------------------------------------------------------------------------- 1141 // ----------------------------------------------------------------------------
1146 // MaxMicrophoneVolume 1142 // MaxMicrophoneVolume
1147 // ---------------------------------------------------------------------------- 1143 // ----------------------------------------------------------------------------
1148 1144
1149 int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const { 1145 int32_t AudioDeviceModuleImpl::MaxMicrophoneVolume(uint32_t* maxVolume) const {
1150 LOG(INFO) << __FUNCTION__;
1151 CHECK_INITIALIZED(); 1146 CHECK_INITIALIZED();
1152 1147
1153 uint32_t maxVol(0); 1148 uint32_t maxVol(0);
1154 1149
1155 if (_ptrAudioDevice->MaxMicrophoneVolume(maxVol) == -1) { 1150 if (_ptrAudioDevice->MaxMicrophoneVolume(maxVol) == -1) {
1156 return -1; 1151 return -1;
1157 } 1152 }
1158 1153
1159 *maxVolume = maxVol; 1154 *maxVolume = maxVol;
1160 LOG(INFO) << "output: " << *maxVolume;
1161 return (0); 1155 return (0);
1162 } 1156 }
1163 1157
1164 // ---------------------------------------------------------------------------- 1158 // ----------------------------------------------------------------------------
1165 // MinMicrophoneVolume 1159 // MinMicrophoneVolume
1166 // ---------------------------------------------------------------------------- 1160 // ----------------------------------------------------------------------------
1167 1161
1168 int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const { 1162 int32_t AudioDeviceModuleImpl::MinMicrophoneVolume(uint32_t* minVolume) const {
1169 LOG(INFO) << __FUNCTION__;
1170 CHECK_INITIALIZED(); 1163 CHECK_INITIALIZED();
1171 1164
1172 uint32_t minVol(0); 1165 uint32_t minVol(0);
1173 1166
1174 if (_ptrAudioDevice->MinMicrophoneVolume(minVol) == -1) { 1167 if (_ptrAudioDevice->MinMicrophoneVolume(minVol) == -1) {
1175 return -1; 1168 return -1;
1176 } 1169 }
1177 1170
1178 *minVolume = minVol; 1171 *minVolume = minVol;
1179 LOG(INFO) << "output: " << *minVolume;
1180 return (0); 1172 return (0);
1181 } 1173 }
1182 1174
1183 // ---------------------------------------------------------------------------- 1175 // ----------------------------------------------------------------------------
1184 // MicrophoneVolumeStepSize 1176 // MicrophoneVolumeStepSize
1185 // ---------------------------------------------------------------------------- 1177 // ----------------------------------------------------------------------------
1186 1178
1187 int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize( 1179 int32_t AudioDeviceModuleImpl::MicrophoneVolumeStepSize(
1188 uint16_t* stepSize) const { 1180 uint16_t* stepSize) const {
1189 LOG(INFO) << __FUNCTION__; 1181 LOG(INFO) << __FUNCTION__;
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1329 return (_ptrAudioDevice->SetRecordingDevice(device)); 1321 return (_ptrAudioDevice->SetRecordingDevice(device));
1330 } 1322 }
1331 1323
1332 // ---------------------------------------------------------------------------- 1324 // ----------------------------------------------------------------------------
1333 // InitPlayout 1325 // InitPlayout
1334 // ---------------------------------------------------------------------------- 1326 // ----------------------------------------------------------------------------
1335 1327
1336 int32_t AudioDeviceModuleImpl::InitPlayout() { 1328 int32_t AudioDeviceModuleImpl::InitPlayout() {
1337 LOG(INFO) << __FUNCTION__; 1329 LOG(INFO) << __FUNCTION__;
1338 CHECK_INITIALIZED(); 1330 CHECK_INITIALIZED();
1331 if (PlayoutIsInitialized()) {
1332 return 0;
1333 }
1339 _audioDeviceBuffer.InitPlayout(); 1334 _audioDeviceBuffer.InitPlayout();
1340 int32_t result = _ptrAudioDevice->InitPlayout(); 1335 int32_t result = _ptrAudioDevice->InitPlayout();
1341 LOG(INFO) << "output: " << result; 1336 LOG(INFO) << "output: " << result;
1342 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess", 1337 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess",
1343 static_cast<int>(result == 0)); 1338 static_cast<int>(result == 0));
1344 return result; 1339 return result;
1345 } 1340 }
1346 1341
1347 // ---------------------------------------------------------------------------- 1342 // ----------------------------------------------------------------------------
1348 // InitRecording 1343 // InitRecording
1349 // ---------------------------------------------------------------------------- 1344 // ----------------------------------------------------------------------------
1350 1345
1351 int32_t AudioDeviceModuleImpl::InitRecording() { 1346 int32_t AudioDeviceModuleImpl::InitRecording() {
1352 LOG(INFO) << __FUNCTION__; 1347 LOG(INFO) << __FUNCTION__;
1353 CHECK_INITIALIZED(); 1348 CHECK_INITIALIZED();
1349 if (RecordingIsInitialized()) {
1350 return 0;
1351 }
1354 _audioDeviceBuffer.InitRecording(); 1352 _audioDeviceBuffer.InitRecording();
1355 int32_t result = _ptrAudioDevice->InitRecording(); 1353 int32_t result = _ptrAudioDevice->InitRecording();
1356 LOG(INFO) << "output: " << result; 1354 LOG(INFO) << "output: " << result;
1357 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess", 1355 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess",
1358 static_cast<int>(result == 0)); 1356 static_cast<int>(result == 0));
1359 return result; 1357 return result;
1360 } 1358 }
1361 1359
1362 // ---------------------------------------------------------------------------- 1360 // ----------------------------------------------------------------------------
1363 // PlayoutIsInitialized 1361 // PlayoutIsInitialized
(...skipping 15 matching lines...) Expand all
1379 return (_ptrAudioDevice->RecordingIsInitialized()); 1377 return (_ptrAudioDevice->RecordingIsInitialized());
1380 } 1378 }
1381 1379
1382 // ---------------------------------------------------------------------------- 1380 // ----------------------------------------------------------------------------
1383 // StartPlayout 1381 // StartPlayout
1384 // ---------------------------------------------------------------------------- 1382 // ----------------------------------------------------------------------------
1385 1383
1386 int32_t AudioDeviceModuleImpl::StartPlayout() { 1384 int32_t AudioDeviceModuleImpl::StartPlayout() {
1387 LOG(INFO) << __FUNCTION__; 1385 LOG(INFO) << __FUNCTION__;
1388 CHECK_INITIALIZED(); 1386 CHECK_INITIALIZED();
1387 if (Playing()) {
1388 return 0;
1389 }
1389 int32_t result = _ptrAudioDevice->StartPlayout(); 1390 int32_t result = _ptrAudioDevice->StartPlayout();
1390 LOG(INFO) << "output: " << result; 1391 LOG(INFO) << "output: " << result;
1391 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess", 1392 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
1392 static_cast<int>(result == 0)); 1393 static_cast<int>(result == 0));
1393 return result; 1394 return result;
1394 } 1395 }
1395 1396
1396 // ---------------------------------------------------------------------------- 1397 // ----------------------------------------------------------------------------
1397 // StopPlayout 1398 // StopPlayout
1398 // ---------------------------------------------------------------------------- 1399 // ----------------------------------------------------------------------------
(...skipping 18 matching lines...) Expand all
1417 return (_ptrAudioDevice->Playing()); 1418 return (_ptrAudioDevice->Playing());
1418 } 1419 }
1419 1420
1420 // ---------------------------------------------------------------------------- 1421 // ----------------------------------------------------------------------------
1421 // StartRecording 1422 // StartRecording
1422 // ---------------------------------------------------------------------------- 1423 // ----------------------------------------------------------------------------
1423 1424
1424 int32_t AudioDeviceModuleImpl::StartRecording() { 1425 int32_t AudioDeviceModuleImpl::StartRecording() {
1425 LOG(INFO) << __FUNCTION__; 1426 LOG(INFO) << __FUNCTION__;
1426 CHECK_INITIALIZED(); 1427 CHECK_INITIALIZED();
1428 if (Recording()) {
1429 return 0;
1430 }
1427 int32_t result = _ptrAudioDevice->StartRecording(); 1431 int32_t result = _ptrAudioDevice->StartRecording();
1428 LOG(INFO) << "output: " << result; 1432 LOG(INFO) << "output: " << result;
1429 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess", 1433 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess",
1430 static_cast<int>(result == 0)); 1434 static_cast<int>(result == 0));
1431 return result; 1435 return result;
1432 } 1436 }
1433 // ---------------------------------------------------------------------------- 1437 // ----------------------------------------------------------------------------
1434 // StopRecording 1438 // StopRecording
1435 // ---------------------------------------------------------------------------- 1439 // ----------------------------------------------------------------------------
1436 1440
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1865 // PlatformAudioLayer 1869 // PlatformAudioLayer
1866 // ---------------------------------------------------------------------------- 1870 // ----------------------------------------------------------------------------
1867 1871
1868 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() 1872 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer()
1869 const { 1873 const {
1870 LOG(INFO) << __FUNCTION__; 1874 LOG(INFO) << __FUNCTION__;
1871 return _platformAudioLayer; 1875 return _platformAudioLayer;
1872 } 1876 }
1873 1877
1874 } // namespace webrtc 1878 } // 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