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 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1007 bool AudioCodingImpl::RegisterSendCodec(AudioEncoder* send_codec) { | 1007 bool AudioCodingImpl::RegisterSendCodec(AudioEncoder* send_codec) { |
1008 FATAL() << "Not implemented yet."; | 1008 FATAL() << "Not implemented yet."; |
1009 return false; | 1009 return false; |
1010 } | 1010 } |
1011 | 1011 |
1012 bool AudioCodingImpl::RegisterSendCodec(int encoder_type, | 1012 bool AudioCodingImpl::RegisterSendCodec(int encoder_type, |
1013 uint8_t payload_type, | 1013 uint8_t payload_type, |
1014 int frame_size_samples) { | 1014 int frame_size_samples) { |
1015 std::string codec_name; | 1015 std::string codec_name; |
1016 int sample_rate_hz; | 1016 int sample_rate_hz; |
1017 int channels; | 1017 size_t channels; |
1018 if (!MapCodecTypeToParameters( | 1018 if (!MapCodecTypeToParameters( |
1019 encoder_type, &codec_name, &sample_rate_hz, &channels)) { | 1019 encoder_type, &codec_name, &sample_rate_hz, &channels)) { |
1020 return false; | 1020 return false; |
1021 } | 1021 } |
1022 webrtc::CodecInst codec; | 1022 webrtc::CodecInst codec; |
1023 AudioCodingModule::Codec( | 1023 AudioCodingModule::Codec( |
1024 codec_name.c_str(), &codec, sample_rate_hz, channels); | 1024 codec_name.c_str(), &codec, sample_rate_hz, channels); |
1025 codec.pltype = payload_type; | 1025 codec.pltype = payload_type; |
1026 if (frame_size_samples > 0) { | 1026 if (frame_size_samples > 0) { |
1027 codec.pacsize = frame_size_samples; | 1027 codec.pacsize = frame_size_samples; |
(...skipping 28 matching lines...) Expand all Loading... |
1056 | 1056 |
1057 bool AudioCodingImpl::RegisterReceiveCodec(AudioDecoder* receive_codec) { | 1057 bool AudioCodingImpl::RegisterReceiveCodec(AudioDecoder* receive_codec) { |
1058 FATAL() << "Not implemented yet."; | 1058 FATAL() << "Not implemented yet."; |
1059 return false; | 1059 return false; |
1060 } | 1060 } |
1061 | 1061 |
1062 bool AudioCodingImpl::RegisterReceiveCodec(int decoder_type, | 1062 bool AudioCodingImpl::RegisterReceiveCodec(int decoder_type, |
1063 uint8_t payload_type) { | 1063 uint8_t payload_type) { |
1064 std::string codec_name; | 1064 std::string codec_name; |
1065 int sample_rate_hz; | 1065 int sample_rate_hz; |
1066 int channels; | 1066 size_t channels; |
1067 if (!MapCodecTypeToParameters( | 1067 if (!MapCodecTypeToParameters( |
1068 decoder_type, &codec_name, &sample_rate_hz, &channels)) { | 1068 decoder_type, &codec_name, &sample_rate_hz, &channels)) { |
1069 return false; | 1069 return false; |
1070 } | 1070 } |
1071 webrtc::CodecInst codec; | 1071 webrtc::CodecInst codec; |
1072 AudioCodingModule::Codec( | 1072 AudioCodingModule::Codec( |
1073 codec_name.c_str(), &codec, sample_rate_hz, channels); | 1073 codec_name.c_str(), &codec, sample_rate_hz, channels); |
1074 codec.pltype = payload_type; | 1074 codec.pltype = payload_type; |
1075 return acm_old_->RegisterReceiveCodec(codec) == 0; | 1075 return acm_old_->RegisterReceiveCodec(codec) == 0; |
1076 } | 1076 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 } | 1143 } |
1144 | 1144 |
1145 void AudioCodingImpl::GetDecodingCallStatistics( | 1145 void AudioCodingImpl::GetDecodingCallStatistics( |
1146 AudioDecodingCallStats* call_stats) const { | 1146 AudioDecodingCallStats* call_stats) const { |
1147 acm_old_->GetDecodingCallStatistics(call_stats); | 1147 acm_old_->GetDecodingCallStatistics(call_stats); |
1148 } | 1148 } |
1149 | 1149 |
1150 bool AudioCodingImpl::MapCodecTypeToParameters(int codec_type, | 1150 bool AudioCodingImpl::MapCodecTypeToParameters(int codec_type, |
1151 std::string* codec_name, | 1151 std::string* codec_name, |
1152 int* sample_rate_hz, | 1152 int* sample_rate_hz, |
1153 int* channels) { | 1153 size_t* channels) { |
1154 switch (codec_type) { | 1154 switch (codec_type) { |
1155 #ifdef WEBRTC_CODEC_PCM16 | 1155 #ifdef WEBRTC_CODEC_PCM16 |
1156 case acm2::ACMCodecDB::kPCM16B: | 1156 case acm2::ACMCodecDB::kPCM16B: |
1157 *codec_name = "L16"; | 1157 *codec_name = "L16"; |
1158 *sample_rate_hz = 8000; | 1158 *sample_rate_hz = 8000; |
1159 *channels = 1; | 1159 *channels = 1; |
1160 break; | 1160 break; |
1161 case acm2::ACMCodecDB::kPCM16Bwb: | 1161 case acm2::ACMCodecDB::kPCM16Bwb: |
1162 *codec_name = "L16"; | 1162 *codec_name = "L16"; |
1163 *sample_rate_hz = 16000; | 1163 *sample_rate_hz = 16000; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 *channels = 1; | 1276 *channels = 1; |
1277 break; | 1277 break; |
1278 #endif | 1278 #endif |
1279 default: | 1279 default: |
1280 FATAL() << "Codec type " << codec_type << " not supported."; | 1280 FATAL() << "Codec type " << codec_type << " not supported."; |
1281 } | 1281 } |
1282 return true; | 1282 return true; |
1283 } | 1283 } |
1284 | 1284 |
1285 } // namespace webrtc | 1285 } // namespace webrtc |
OLD | NEW |