| OLD | NEW |
| 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 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 // ---------------------------------------------------------------------------- | 1395 // ---------------------------------------------------------------------------- |
| 1396 // StartPlayout | 1396 // StartPlayout |
| 1397 // ---------------------------------------------------------------------------- | 1397 // ---------------------------------------------------------------------------- |
| 1398 | 1398 |
| 1399 int32_t AudioDeviceModuleImpl::StartPlayout() { | 1399 int32_t AudioDeviceModuleImpl::StartPlayout() { |
| 1400 LOG(INFO) << __FUNCTION__; | 1400 LOG(INFO) << __FUNCTION__; |
| 1401 CHECK_INITIALIZED(); | 1401 CHECK_INITIALIZED(); |
| 1402 if (Playing()) { | 1402 if (Playing()) { |
| 1403 return 0; | 1403 return 0; |
| 1404 } | 1404 } |
| 1405 _audioDeviceBuffer.StartPlayout(); |
| 1405 int32_t result = _ptrAudioDevice->StartPlayout(); | 1406 int32_t result = _ptrAudioDevice->StartPlayout(); |
| 1406 LOG(INFO) << "output: " << result; | 1407 LOG(INFO) << "output: " << result; |
| 1407 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess", | 1408 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartPlayoutSuccess", |
| 1408 static_cast<int>(result == 0)); | 1409 static_cast<int>(result == 0)); |
| 1409 return result; | 1410 return result; |
| 1410 } | 1411 } |
| 1411 | 1412 |
| 1412 // ---------------------------------------------------------------------------- | 1413 // ---------------------------------------------------------------------------- |
| 1413 // StopPlayout | 1414 // StopPlayout |
| 1414 // ---------------------------------------------------------------------------- | 1415 // ---------------------------------------------------------------------------- |
| 1415 | 1416 |
| 1416 int32_t AudioDeviceModuleImpl::StopPlayout() { | 1417 int32_t AudioDeviceModuleImpl::StopPlayout() { |
| 1417 LOG(INFO) << __FUNCTION__; | 1418 LOG(INFO) << __FUNCTION__; |
| 1418 CHECK_INITIALIZED(); | 1419 CHECK_INITIALIZED(); |
| 1419 int32_t result = _ptrAudioDevice->StopPlayout(); | 1420 int32_t result = _ptrAudioDevice->StopPlayout(); |
| 1421 _audioDeviceBuffer.StopPlayout(); |
| 1420 LOG(INFO) << "output: " << result; | 1422 LOG(INFO) << "output: " << result; |
| 1421 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess", | 1423 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopPlayoutSuccess", |
| 1422 static_cast<int>(result == 0)); | 1424 static_cast<int>(result == 0)); |
| 1423 return result; | 1425 return result; |
| 1424 } | 1426 } |
| 1425 | 1427 |
| 1426 // ---------------------------------------------------------------------------- | 1428 // ---------------------------------------------------------------------------- |
| 1427 // Playing | 1429 // Playing |
| 1428 // ---------------------------------------------------------------------------- | 1430 // ---------------------------------------------------------------------------- |
| 1429 | 1431 |
| 1430 bool AudioDeviceModuleImpl::Playing() const { | 1432 bool AudioDeviceModuleImpl::Playing() const { |
| 1431 LOG(INFO) << __FUNCTION__; | 1433 LOG(INFO) << __FUNCTION__; |
| 1432 CHECK_INITIALIZED_BOOL(); | 1434 CHECK_INITIALIZED_BOOL(); |
| 1433 return (_ptrAudioDevice->Playing()); | 1435 return (_ptrAudioDevice->Playing()); |
| 1434 } | 1436 } |
| 1435 | 1437 |
| 1436 // ---------------------------------------------------------------------------- | 1438 // ---------------------------------------------------------------------------- |
| 1437 // StartRecording | 1439 // StartRecording |
| 1438 // ---------------------------------------------------------------------------- | 1440 // ---------------------------------------------------------------------------- |
| 1439 | 1441 |
| 1440 int32_t AudioDeviceModuleImpl::StartRecording() { | 1442 int32_t AudioDeviceModuleImpl::StartRecording() { |
| 1441 LOG(INFO) << __FUNCTION__; | 1443 LOG(INFO) << __FUNCTION__; |
| 1442 CHECK_INITIALIZED(); | 1444 CHECK_INITIALIZED(); |
| 1443 if (Recording()) { | 1445 if (Recording()) { |
| 1444 return 0; | 1446 return 0; |
| 1445 } | 1447 } |
| 1448 _audioDeviceBuffer.StartRecording(); |
| 1446 int32_t result = _ptrAudioDevice->StartRecording(); | 1449 int32_t result = _ptrAudioDevice->StartRecording(); |
| 1447 LOG(INFO) << "output: " << result; | 1450 LOG(INFO) << "output: " << result; |
| 1448 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess", | 1451 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StartRecordingSuccess", |
| 1449 static_cast<int>(result == 0)); | 1452 static_cast<int>(result == 0)); |
| 1450 return result; | 1453 return result; |
| 1451 } | 1454 } |
| 1452 // ---------------------------------------------------------------------------- | 1455 // ---------------------------------------------------------------------------- |
| 1453 // StopRecording | 1456 // StopRecording |
| 1454 // ---------------------------------------------------------------------------- | 1457 // ---------------------------------------------------------------------------- |
| 1455 | 1458 |
| 1456 int32_t AudioDeviceModuleImpl::StopRecording() { | 1459 int32_t AudioDeviceModuleImpl::StopRecording() { |
| 1457 LOG(INFO) << __FUNCTION__; | 1460 LOG(INFO) << __FUNCTION__; |
| 1458 CHECK_INITIALIZED(); | 1461 CHECK_INITIALIZED(); |
| 1459 int32_t result = _ptrAudioDevice->StopRecording(); | 1462 int32_t result = _ptrAudioDevice->StopRecording(); |
| 1463 _audioDeviceBuffer.StopRecording(); |
| 1460 LOG(INFO) << "output: " << result; | 1464 LOG(INFO) << "output: " << result; |
| 1461 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess", | 1465 RTC_HISTOGRAM_BOOLEAN("WebRTC.Audio.StopRecordingSuccess", |
| 1462 static_cast<int>(result == 0)); | 1466 static_cast<int>(result == 0)); |
| 1463 return result; | 1467 return result; |
| 1464 } | 1468 } |
| 1465 | 1469 |
| 1466 // ---------------------------------------------------------------------------- | 1470 // ---------------------------------------------------------------------------- |
| 1467 // Recording | 1471 // Recording |
| 1468 // ---------------------------------------------------------------------------- | 1472 // ---------------------------------------------------------------------------- |
| 1469 | 1473 |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1876 // PlatformAudioLayer | 1880 // PlatformAudioLayer |
| 1877 // ---------------------------------------------------------------------------- | 1881 // ---------------------------------------------------------------------------- |
| 1878 | 1882 |
| 1879 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() | 1883 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() |
| 1880 const { | 1884 const { |
| 1881 LOG(INFO) << __FUNCTION__; | 1885 LOG(INFO) << __FUNCTION__; |
| 1882 return _platformAudioLayer; | 1886 return _platformAudioLayer; |
| 1883 } | 1887 } |
| 1884 | 1888 |
| 1885 } // namespace webrtc | 1889 } // namespace webrtc |
| OLD | NEW |