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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 | 114 |
115 // Initialize receiver, resets codec database etc. | 115 // Initialize receiver, resets codec database etc. |
116 int InitializeReceiver() override; | 116 int InitializeReceiver() override; |
117 | 117 |
118 // Get current receive frequency. | 118 // Get current receive frequency. |
119 int ReceiveFrequency() const override; | 119 int ReceiveFrequency() const override; |
120 | 120 |
121 // Get current playout frequency. | 121 // Get current playout frequency. |
122 int PlayoutFrequency() const override; | 122 int PlayoutFrequency() const override; |
123 | 123 |
| 124 void SetReceiveCodecs(const std::map<int, SdpAudioFormat>& codecs) override; |
| 125 |
124 bool RegisterReceiveCodec(int rtp_payload_type, | 126 bool RegisterReceiveCodec(int rtp_payload_type, |
125 const SdpAudioFormat& audio_format) override; | 127 const SdpAudioFormat& audio_format) override; |
126 | 128 |
127 int RegisterReceiveCodec(const CodecInst& receive_codec) override; | 129 int RegisterReceiveCodec(const CodecInst& receive_codec) override; |
128 int RegisterReceiveCodec( | 130 int RegisterReceiveCodec( |
129 const CodecInst& receive_codec, | 131 const CodecInst& receive_codec, |
130 rtc::FunctionView<std::unique_ptr<AudioDecoder>()> isac_factory) override; | 132 rtc::FunctionView<std::unique_ptr<AudioDecoder>()> isac_factory) override; |
131 | 133 |
132 int RegisterExternalReceiveCodec(int rtp_payload_type, | 134 int RegisterExternalReceiveCodec(int rtp_payload_type, |
133 AudioDecoder* external_decoder, | 135 AudioDecoder* external_decoder, |
(...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 : receiver_.last_output_sample_rate_hz(); | 982 : receiver_.last_output_sample_rate_hz(); |
981 } | 983 } |
982 | 984 |
983 // Get current playout frequency. | 985 // Get current playout frequency. |
984 int AudioCodingModuleImpl::PlayoutFrequency() const { | 986 int AudioCodingModuleImpl::PlayoutFrequency() const { |
985 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, | 987 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, |
986 "PlayoutFrequency()"); | 988 "PlayoutFrequency()"); |
987 return receiver_.last_output_sample_rate_hz(); | 989 return receiver_.last_output_sample_rate_hz(); |
988 } | 990 } |
989 | 991 |
| 992 void AudioCodingModuleImpl::SetReceiveCodecs( |
| 993 const std::map<int, SdpAudioFormat>& codecs) { |
| 994 rtc::CritScope lock(&acm_crit_sect_); |
| 995 receiver_.SetCodecs(codecs); |
| 996 } |
| 997 |
990 bool AudioCodingModuleImpl::RegisterReceiveCodec( | 998 bool AudioCodingModuleImpl::RegisterReceiveCodec( |
991 int rtp_payload_type, | 999 int rtp_payload_type, |
992 const SdpAudioFormat& audio_format) { | 1000 const SdpAudioFormat& audio_format) { |
993 rtc::CritScope lock(&acm_crit_sect_); | 1001 rtc::CritScope lock(&acm_crit_sect_); |
994 RTC_DCHECK(receiver_initialized_); | 1002 RTC_DCHECK(receiver_initialized_); |
995 | 1003 |
996 if (!acm2::RentACodec::IsPayloadTypeValid(rtp_payload_type)) { | 1004 if (!acm2::RentACodec::IsPayloadTypeValid(rtp_payload_type)) { |
997 LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type | 1005 LOG_F(LS_ERROR) << "Invalid payload-type " << rtp_payload_type |
998 << " for decoder."; | 1006 << " for decoder."; |
999 return false; | 1007 return false; |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1376 // Checks the validity of the parameters of the given codec | 1384 // Checks the validity of the parameters of the given codec |
1377 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { | 1385 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { |
1378 bool valid = acm2::RentACodec::IsCodecValid(codec); | 1386 bool valid = acm2::RentACodec::IsCodecValid(codec); |
1379 if (!valid) | 1387 if (!valid) |
1380 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1, | 1388 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1, |
1381 "Invalid codec setting"); | 1389 "Invalid codec setting"); |
1382 return valid; | 1390 return valid; |
1383 } | 1391 } |
1384 | 1392 |
1385 } // namespace webrtc | 1393 } // namespace webrtc |
OLD | NEW |