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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // ============================================================================ | 380 // ============================================================================ |
381 | 381 |
382 // ---------------------------------------------------------------------------- | 382 // ---------------------------------------------------------------------------- |
383 // Module::TimeUntilNextProcess | 383 // Module::TimeUntilNextProcess |
384 // | 384 // |
385 // Returns the number of milliseconds until the module want a worker thread | 385 // Returns the number of milliseconds until the module want a worker thread |
386 // to call Process(). | 386 // to call Process(). |
387 // ---------------------------------------------------------------------------- | 387 // ---------------------------------------------------------------------------- |
388 | 388 |
389 int64_t AudioDeviceModuleImpl::TimeUntilNextProcess() { | 389 int64_t AudioDeviceModuleImpl::TimeUntilNextProcess() { |
390 LOG(LS_VERBOSE) << __FUNCTION__; | |
391 int64_t now = rtc::TimeMillis(); | 390 int64_t now = rtc::TimeMillis(); |
392 int64_t deltaProcess = kAdmMaxIdleTimeProcess - (now - _lastProcessTime); | 391 int64_t deltaProcess = kAdmMaxIdleTimeProcess - (now - _lastProcessTime); |
393 return deltaProcess; | 392 return deltaProcess; |
394 } | 393 } |
395 | 394 |
396 // ---------------------------------------------------------------------------- | 395 // ---------------------------------------------------------------------------- |
397 // Module::Process | 396 // Module::Process |
398 // | 397 // |
399 // Check for posted error and warning reports. Generate callbacks if | 398 // Check for posted error and warning reports. Generate callbacks if |
400 // new reports exists. | 399 // new reports exists. |
401 // ---------------------------------------------------------------------------- | 400 // ---------------------------------------------------------------------------- |
402 | 401 |
403 void AudioDeviceModuleImpl::Process() { | 402 void AudioDeviceModuleImpl::Process() { |
404 LOG(LS_VERBOSE) << __FUNCTION__; | |
405 _lastProcessTime = rtc::TimeMillis(); | 403 _lastProcessTime = rtc::TimeMillis(); |
406 | 404 |
407 // kPlayoutWarning | 405 // kPlayoutWarning |
408 if (_ptrAudioDevice->PlayoutWarning()) { | 406 if (_ptrAudioDevice->PlayoutWarning()) { |
409 CriticalSectionScoped lock(&_critSectEventCb); | 407 CriticalSectionScoped lock(&_critSectEventCb); |
410 if (_ptrCbAudioDeviceObserver) { | 408 if (_ptrCbAudioDeviceObserver) { |
411 LOG(WARNING) << "=> OnWarningIsReported(kPlayoutWarning)"; | 409 LOG(WARNING) << "=> OnWarningIsReported(kPlayoutWarning)"; |
412 _ptrCbAudioDeviceObserver->OnWarningIsReported( | 410 _ptrCbAudioDeviceObserver->OnWarningIsReported( |
413 AudioDeviceObserver::kPlayoutWarning); | 411 AudioDeviceObserver::kPlayoutWarning); |
414 } | 412 } |
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1599 | 1597 |
1600 LOG(INFO) << "output: type = " << *type << ", sizeMS = " << *sizeMS; | 1598 LOG(INFO) << "output: type = " << *type << ", sizeMS = " << *sizeMS; |
1601 return (0); | 1599 return (0); |
1602 } | 1600 } |
1603 | 1601 |
1604 // ---------------------------------------------------------------------------- | 1602 // ---------------------------------------------------------------------------- |
1605 // PlayoutDelay | 1603 // PlayoutDelay |
1606 // ---------------------------------------------------------------------------- | 1604 // ---------------------------------------------------------------------------- |
1607 | 1605 |
1608 int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const { | 1606 int32_t AudioDeviceModuleImpl::PlayoutDelay(uint16_t* delayMS) const { |
1609 LOG(LS_VERBOSE) << __FUNCTION__; | |
1610 CHECK_INITIALIZED(); | 1607 CHECK_INITIALIZED(); |
1611 | 1608 |
1612 uint16_t delay(0); | 1609 uint16_t delay(0); |
1613 | 1610 |
1614 if (_ptrAudioDevice->PlayoutDelay(delay) == -1) { | 1611 if (_ptrAudioDevice->PlayoutDelay(delay) == -1) { |
1615 LOG(LERROR) << "failed to retrieve the playout delay"; | 1612 LOG(LERROR) << "failed to retrieve the playout delay"; |
1616 return -1; | 1613 return -1; |
1617 } | 1614 } |
1618 | 1615 |
1619 *delayMS = delay; | 1616 *delayMS = delay; |
1620 LOG(LS_VERBOSE) << "output: " << *delayMS; | |
1621 return (0); | 1617 return (0); |
1622 } | 1618 } |
1623 | 1619 |
1624 // ---------------------------------------------------------------------------- | 1620 // ---------------------------------------------------------------------------- |
1625 // RecordingDelay | 1621 // RecordingDelay |
1626 // ---------------------------------------------------------------------------- | 1622 // ---------------------------------------------------------------------------- |
1627 | 1623 |
1628 int32_t AudioDeviceModuleImpl::RecordingDelay(uint16_t* delayMS) const { | 1624 int32_t AudioDeviceModuleImpl::RecordingDelay(uint16_t* delayMS) const { |
1629 LOG(INFO) << __FUNCTION__; | 1625 LOG(INFO) << __FUNCTION__; |
1630 CHECK_INITIALIZED(); | 1626 CHECK_INITIALIZED(); |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1869 // PlatformAudioLayer | 1865 // PlatformAudioLayer |
1870 // ---------------------------------------------------------------------------- | 1866 // ---------------------------------------------------------------------------- |
1871 | 1867 |
1872 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() | 1868 AudioDeviceModule::AudioLayer AudioDeviceModuleImpl::PlatformAudioLayer() |
1873 const { | 1869 const { |
1874 LOG(INFO) << __FUNCTION__; | 1870 LOG(INFO) << __FUNCTION__; |
1875 return _platformAudioLayer; | 1871 return _platformAudioLayer; |
1876 } | 1872 } |
1877 | 1873 |
1878 } // namespace webrtc | 1874 } // namespace webrtc |
OLD | NEW |