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 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 | 652 |
653 int AudioCodingModuleImpl::SetMaximumPlayoutDelay(int time_ms) { | 653 int AudioCodingModuleImpl::SetMaximumPlayoutDelay(int time_ms) { |
654 if ((time_ms < 0) || (time_ms > 10000)) { | 654 if ((time_ms < 0) || (time_ms > 10000)) { |
655 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, | 655 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, |
656 "Delay must be in the range of 0-1000 milliseconds."); | 656 "Delay must be in the range of 0-1000 milliseconds."); |
657 return -1; | 657 return -1; |
658 } | 658 } |
659 return receiver_.SetMaximumDelay(time_ms); | 659 return receiver_.SetMaximumDelay(time_ms); |
660 } | 660 } |
661 | 661 |
662 // Set playout mode for: voice, fax, streaming or off. | |
663 int AudioCodingModuleImpl::SetPlayoutMode(AudioPlayoutMode mode) { | |
664 receiver_.SetPlayoutMode(mode); | |
665 return 0; // TODO(turajs): return value is for backward compatibility. | |
666 } | |
667 | |
668 // Get playout mode voice, fax, streaming or off. | |
669 AudioPlayoutMode AudioCodingModuleImpl::PlayoutMode() const { | |
670 return receiver_.PlayoutMode(); | |
671 } | |
672 | |
673 // Get 10 milliseconds of raw audio data to play out. | 662 // Get 10 milliseconds of raw audio data to play out. |
674 // Automatic resample to the requested frequency. | 663 // Automatic resample to the requested frequency. |
675 int AudioCodingModuleImpl::PlayoutData10Ms(int desired_freq_hz, | 664 int AudioCodingModuleImpl::PlayoutData10Ms(int desired_freq_hz, |
676 AudioFrame* audio_frame) { | 665 AudioFrame* audio_frame) { |
677 // GetAudio always returns 10 ms, at the requested sample rate. | 666 // GetAudio always returns 10 ms, at the requested sample rate. |
678 if (receiver_.GetAudio(desired_freq_hz, audio_frame) != 0) { | 667 if (receiver_.GetAudio(desired_freq_hz, audio_frame) != 0) { |
679 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, | 668 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, id_, |
680 "PlayoutData failed, RecOut Failed"); | 669 "PlayoutData failed, RecOut Failed"); |
681 return -1; | 670 return -1; |
682 } | 671 } |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1119 *sample_rate_hz = 8000; | 1108 *sample_rate_hz = 8000; |
1120 *channels = 1; | 1109 *channels = 1; |
1121 break; | 1110 break; |
1122 default: | 1111 default: |
1123 FATAL() << "Codec type " << codec_type << " not supported."; | 1112 FATAL() << "Codec type " << codec_type << " not supported."; |
1124 } | 1113 } |
1125 return true; | 1114 return true; |
1126 } | 1115 } |
1127 | 1116 |
1128 } // namespace webrtc | 1117 } // namespace webrtc |
OLD | NEW |