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

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

Issue 2445363003: Improvements in how WebRTC.Audio.RecordedOnlyZeros is added as histogram (Closed)
Patch Set: Added TODO(henrika) Created 4 years, 1 month 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 | « webrtc/modules/audio_device/audio_device_buffer.cc ('k') | 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 1328 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 // ---------------------------------------------------------------------------- 1339 // ----------------------------------------------------------------------------
1340 // InitPlayout 1340 // InitPlayout
1341 // ---------------------------------------------------------------------------- 1341 // ----------------------------------------------------------------------------
1342 1342
1343 int32_t AudioDeviceModuleImpl::InitPlayout() { 1343 int32_t AudioDeviceModuleImpl::InitPlayout() {
1344 LOG(INFO) << __FUNCTION__; 1344 LOG(INFO) << __FUNCTION__;
1345 CHECK_INITIALIZED(); 1345 CHECK_INITIALIZED();
1346 if (PlayoutIsInitialized()) { 1346 if (PlayoutIsInitialized()) {
1347 return 0; 1347 return 0;
1348 } 1348 }
1349 _audioDeviceBuffer.InitPlayout();
1350 int32_t result = _ptrAudioDevice->InitPlayout(); 1349 int32_t result = _ptrAudioDevice->InitPlayout();
1351 LOG(INFO) << "output: " << result; 1350 LOG(INFO) << "output: " << result;
1352 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess", 1351 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitPlayoutSuccess",
1353 static_cast<int>(result == 0)); 1352 static_cast<int>(result == 0));
1354 return result; 1353 return result;
1355 } 1354 }
1356 1355
1357 // ---------------------------------------------------------------------------- 1356 // ----------------------------------------------------------------------------
1358 // InitRecording 1357 // InitRecording
1359 // ---------------------------------------------------------------------------- 1358 // ----------------------------------------------------------------------------
1360 1359
1361 int32_t AudioDeviceModuleImpl::InitRecording() { 1360 int32_t AudioDeviceModuleImpl::InitRecording() {
1362 LOG(INFO) << __FUNCTION__; 1361 LOG(INFO) << __FUNCTION__;
1363 CHECK_INITIALIZED(); 1362 CHECK_INITIALIZED();
1364 if (RecordingIsInitialized()) { 1363 if (RecordingIsInitialized()) {
1365 return 0; 1364 return 0;
1366 } 1365 }
1367 _audioDeviceBuffer.InitRecording();
1368 int32_t result = _ptrAudioDevice->InitRecording(); 1366 int32_t result = _ptrAudioDevice->InitRecording();
1369 LOG(INFO) << "output: " << result; 1367 LOG(INFO) << "output: " << result;
1370 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess", 1368 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.InitRecordingSuccess",
1371 static_cast<int>(result == 0)); 1369 static_cast<int>(result == 0));
1372 return result; 1370 return result;
1373 } 1371 }
1374 1372
1375 // ---------------------------------------------------------------------------- 1373 // ----------------------------------------------------------------------------
1376 // PlayoutIsInitialized 1374 // PlayoutIsInitialized
1377 // ---------------------------------------------------------------------------- 1375 // ----------------------------------------------------------------------------
(...skipping 17 matching lines...) Expand all
1395 // ---------------------------------------------------------------------------- 1393 // ----------------------------------------------------------------------------
1396 // StartPlayout 1394 // StartPlayout
1397 // ---------------------------------------------------------------------------- 1395 // ----------------------------------------------------------------------------
1398 1396
1399 int32_t AudioDeviceModuleImpl::StartPlayout() { 1397 int32_t AudioDeviceModuleImpl::StartPlayout() {
1400 LOG(INFO) << __FUNCTION__; 1398 LOG(INFO) << __FUNCTION__;
1401 CHECK_INITIALIZED(); 1399 CHECK_INITIALIZED();
1402 if (Playing()) { 1400 if (Playing()) {
1403 return 0; 1401 return 0;
1404 } 1402 }
1403 _audioDeviceBuffer.StartPlayout();
1405 int32_t result = _ptrAudioDevice->StartPlayout(); 1404 int32_t result = _ptrAudioDevice->StartPlayout();
1406 LOG(INFO) << "output: " << result; 1405 LOG(INFO) << "output: " << result;
1407 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess", 1406 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess",
1408 static_cast<int>(result == 0)); 1407 static_cast<int>(result == 0));
1409 return result; 1408 return result;
1410 } 1409 }
1411 1410
1412 // ---------------------------------------------------------------------------- 1411 // ----------------------------------------------------------------------------
1413 // StopPlayout 1412 // StopPlayout
1414 // ---------------------------------------------------------------------------- 1413 // ----------------------------------------------------------------------------
1415 1414
1416 int32_t AudioDeviceModuleImpl::StopPlayout() { 1415 int32_t AudioDeviceModuleImpl::StopPlayout() {
1417 LOG(INFO) << __FUNCTION__; 1416 LOG(INFO) << __FUNCTION__;
1418 CHECK_INITIALIZED(); 1417 CHECK_INITIALIZED();
1419 int32_t result = _ptrAudioDevice->StopPlayout(); 1418 int32_t result = _ptrAudioDevice->StopPlayout();
1419 _audioDeviceBuffer.StopPlayout();
1420 LOG(INFO) << "output: " << result; 1420 LOG(INFO) << "output: " << result;
1421 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess", 1421 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess",
1422 static_cast<int>(result == 0)); 1422 static_cast<int>(result == 0));
1423 return result; 1423 return result;
1424 } 1424 }
1425 1425
1426 // ---------------------------------------------------------------------------- 1426 // ----------------------------------------------------------------------------
1427 // Playing 1427 // Playing
1428 // ---------------------------------------------------------------------------- 1428 // ----------------------------------------------------------------------------
1429 1429
1430 bool AudioDeviceModuleImpl::Playing() const { 1430 bool AudioDeviceModuleImpl::Playing() const {
1431 LOG(INFO) << __FUNCTION__; 1431 LOG(INFO) << __FUNCTION__;
1432 CHECK_INITIALIZED_BOOL(); 1432 CHECK_INITIALIZED_BOOL();
1433 return (_ptrAudioDevice->Playing()); 1433 return (_ptrAudioDevice->Playing());
1434 } 1434 }
1435 1435
1436 // ---------------------------------------------------------------------------- 1436 // ----------------------------------------------------------------------------
1437 // StartRecording 1437 // StartRecording
1438 // ---------------------------------------------------------------------------- 1438 // ----------------------------------------------------------------------------
1439 1439
1440 int32_t AudioDeviceModuleImpl::StartRecording() { 1440 int32_t AudioDeviceModuleImpl::StartRecording() {
1441 LOG(INFO) << __FUNCTION__; 1441 LOG(INFO) << __FUNCTION__;
1442 CHECK_INITIALIZED(); 1442 CHECK_INITIALIZED();
1443 if (Recording()) { 1443 if (Recording()) {
1444 return 0; 1444 return 0;
1445 } 1445 }
1446 _audioDeviceBuffer.StartRecording();
1446 int32_t result = _ptrAudioDevice->StartRecording(); 1447 int32_t result = _ptrAudioDevice->StartRecording();
1447 LOG(INFO) << "output: " << result; 1448 LOG(INFO) << "output: " << result;
1448 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess", 1449 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess",
1449 static_cast<int>(result == 0)); 1450 static_cast<int>(result == 0));
1450 return result; 1451 return result;
1451 } 1452 }
1452 // ---------------------------------------------------------------------------- 1453 // ----------------------------------------------------------------------------
1453 // StopRecording 1454 // StopRecording
1454 // ---------------------------------------------------------------------------- 1455 // ----------------------------------------------------------------------------
1455 1456
1456 int32_t AudioDeviceModuleImpl::StopRecording() { 1457 int32_t AudioDeviceModuleImpl::StopRecording() {
1457 LOG(INFO) << __FUNCTION__; 1458 LOG(INFO) << __FUNCTION__;
1458 CHECK_INITIALIZED(); 1459 CHECK_INITIALIZED();
1459 int32_t result = _ptrAudioDevice->StopRecording(); 1460 int32_t result = _ptrAudioDevice->StopRecording();
1461 _audioDeviceBuffer.StopRecording();
1460 LOG(INFO) << "output: " << result; 1462 LOG(INFO) << "output: " << result;
1461 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess", 1463 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess",
1462 static_cast<int>(result == 0)); 1464 static_cast<int>(result == 0));
1463 return result; 1465 return result;
1464 } 1466 }
1465 1467
1466 // ---------------------------------------------------------------------------- 1468 // ----------------------------------------------------------------------------
1467 // Recording 1469 // Recording
1468 // ---------------------------------------------------------------------------- 1470 // ----------------------------------------------------------------------------
1469 1471
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1876 // PlatformAudioLayer 1878 // PlatformAudioLayer
1877 // ---------------------------------------------------------------------------- 1879 // ----------------------------------------------------------------------------
1878 1880
1879 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() 1881 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer()
1880 const { 1882 const {
1881 LOG(INFO) << __FUNCTION__; 1883 LOG(INFO) << __FUNCTION__;
1882 return _platformAudioLayer; 1884 return _platformAudioLayer;
1883 } 1885 }
1884 1886
1885 } // namespace webrtc 1887 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_device/audio_device_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698