| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 int RegisterExternalReceiveCodec(int rtp_payload_type, | 129 int RegisterExternalReceiveCodec(int rtp_payload_type, |
| 130 AudioDecoder* external_decoder, | 130 AudioDecoder* external_decoder, |
| 131 int sample_rate_hz, | 131 int sample_rate_hz, |
| 132 int num_channels, | 132 int num_channels, |
| 133 const std::string& name) override; | 133 const std::string& name) override; |
| 134 | 134 |
| 135 // Get current received codec. | 135 // Get current received codec. |
| 136 int ReceiveCodec(CodecInst* current_codec) const override; | 136 int ReceiveCodec(CodecInst* current_codec) const override; |
| 137 | 137 |
| 138 rtc::Optional<SdpAudioFormat> ReceiveFormat() const override; |
| 139 |
| 138 // Incoming packet from network parsed and ready for decode. | 140 // Incoming packet from network parsed and ready for decode. |
| 139 int IncomingPacket(const uint8_t* incoming_payload, | 141 int IncomingPacket(const uint8_t* incoming_payload, |
| 140 const size_t payload_length, | 142 const size_t payload_length, |
| 141 const WebRtcRTPHeader& rtp_info) override; | 143 const WebRtcRTPHeader& rtp_info) override; |
| 142 | 144 |
| 143 // Incoming payloads, without rtp-info, the rtp-info will be created in ACM. | 145 // Incoming payloads, without rtp-info, the rtp-info will be created in ACM. |
| 144 // One usage for this API is when pre-encoded files are pushed in ACM. | 146 // One usage for this API is when pre-encoded files are pushed in ACM. |
| 145 int IncomingPayload(const uint8_t* incoming_payload, | 147 int IncomingPayload(const uint8_t* incoming_payload, |
| 146 const size_t payload_length, | 148 const size_t payload_length, |
| 147 uint8_t payload_type, | 149 uint8_t payload_type, |
| (...skipping 914 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1062 return receiver_.AddCodec(-1 /* external */, rtp_payload_type, num_channels, | 1064 return receiver_.AddCodec(-1 /* external */, rtp_payload_type, num_channels, |
| 1063 sample_rate_hz, external_decoder, name); | 1065 sample_rate_hz, external_decoder, name); |
| 1064 } | 1066 } |
| 1065 | 1067 |
| 1066 // Get current received codec. | 1068 // Get current received codec. |
| 1067 int AudioCodingModuleImpl::ReceiveCodec(CodecInst* current_codec) const { | 1069 int AudioCodingModuleImpl::ReceiveCodec(CodecInst* current_codec) const { |
| 1068 rtc::CritScope lock(&acm_crit_sect_); | 1070 rtc::CritScope lock(&acm_crit_sect_); |
| 1069 return receiver_.LastAudioCodec(current_codec); | 1071 return receiver_.LastAudioCodec(current_codec); |
| 1070 } | 1072 } |
| 1071 | 1073 |
| 1074 rtc::Optional<SdpAudioFormat> AudioCodingModuleImpl::ReceiveFormat() const { |
| 1075 rtc::CritScope lock(&acm_crit_sect_); |
| 1076 return receiver_.LastAudioFormat(); |
| 1077 } |
| 1078 |
| 1072 // Incoming packet from network parsed and ready for decode. | 1079 // Incoming packet from network parsed and ready for decode. |
| 1073 int AudioCodingModuleImpl::IncomingPacket(const uint8_t* incoming_payload, | 1080 int AudioCodingModuleImpl::IncomingPacket(const uint8_t* incoming_payload, |
| 1074 const size_t payload_length, | 1081 const size_t payload_length, |
| 1075 const WebRtcRTPHeader& rtp_header) { | 1082 const WebRtcRTPHeader& rtp_header) { |
| 1076 return receiver_.InsertPacket( | 1083 return receiver_.InsertPacket( |
| 1077 rtp_header, | 1084 rtp_header, |
| 1078 rtc::ArrayView<const uint8_t>(incoming_payload, payload_length)); | 1085 rtc::ArrayView<const uint8_t>(incoming_payload, payload_length)); |
| 1079 } | 1086 } |
| 1080 | 1087 |
| 1081 // Minimum playout delay (Used for lip-sync). | 1088 // Minimum playout delay (Used for lip-sync). |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 // Checks the validity of the parameters of the given codec | 1363 // Checks the validity of the parameters of the given codec |
| 1357 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { | 1364 bool AudioCodingModule::IsCodecValid(const CodecInst& codec) { |
| 1358 bool valid = acm2::RentACodec::IsCodecValid(codec); | 1365 bool valid = acm2::RentACodec::IsCodecValid(codec); |
| 1359 if (!valid) | 1366 if (!valid) |
| 1360 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1, | 1367 WEBRTC_TRACE(webrtc::kTraceError, webrtc::kTraceAudioCoding, -1, |
| 1361 "Invalid codec setting"); | 1368 "Invalid codec setting"); |
| 1362 return valid; | 1369 return valid; |
| 1363 } | 1370 } |
| 1364 | 1371 |
| 1365 } // namespace webrtc | 1372 } // namespace webrtc |
| OLD | NEW |