| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2011 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 // address to IP6 ::. | 198 // address to IP6 ::. |
| 199 // TODO(perkj): FF can not parse IP6 ::. See http://crbug/430333 | 199 // TODO(perkj): FF can not parse IP6 ::. See http://crbug/430333 |
| 200 // Use IPV4 per default. | 200 // Use IPV4 per default. |
| 201 static const char kDummyAddress[] = "0.0.0.0"; | 201 static const char kDummyAddress[] = "0.0.0.0"; |
| 202 static const char kDummyPort[] = "9"; | 202 static const char kDummyPort[] = "9"; |
| 203 // RFC 3556 | 203 // RFC 3556 |
| 204 static const char kApplicationSpecificMaximum[] = "AS"; | 204 static const char kApplicationSpecificMaximum[] = "AS"; |
| 205 | 205 |
| 206 static const int kDefaultVideoClockrate = 90000; | 206 static const int kDefaultVideoClockrate = 90000; |
| 207 | 207 |
| 208 // ISAC special-case. | |
| 209 static const char kIsacCodecName[] = "ISAC"; // From webrtcvoiceengine.cc | |
| 210 static const int kIsacWbDefaultRate = 32000; // From acm_common_defs.h | |
| 211 static const int kIsacSwbDefaultRate = 56000; // From acm_common_defs.h | |
| 212 | |
| 213 static const char kDefaultSctpmapProtocol[] = "webrtc-datachannel"; | 208 static const char kDefaultSctpmapProtocol[] = "webrtc-datachannel"; |
| 214 | 209 |
| 215 // RTP payload type is in the 0-127 range. Use -1 to indicate "all" payload | 210 // RTP payload type is in the 0-127 range. Use -1 to indicate "all" payload |
| 216 // types. | 211 // types. |
| 217 const int kWildcardPayloadType = -1; | 212 const int kWildcardPayloadType = -1; |
| 218 | 213 |
| 219 struct SsrcInfo { | 214 struct SsrcInfo { |
| 220 uint32_t ssrc_id; | 215 uint32_t ssrc_id; |
| 221 std::string cname; | 216 std::string cname; |
| 222 std::string stream_id; | 217 std::string stream_id; |
| (...skipping 2868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3091 // For audio streams, <encoding parameters> indicates the number | 3086 // For audio streams, <encoding parameters> indicates the number |
| 3092 // of audio channels. This parameter is OPTIONAL and may be | 3087 // of audio channels. This parameter is OPTIONAL and may be |
| 3093 // omitted if the number of channels is one, provided that no | 3088 // omitted if the number of channels is one, provided that no |
| 3094 // additional parameters are needed. | 3089 // additional parameters are needed. |
| 3095 size_t channels = 1; | 3090 size_t channels = 1; |
| 3096 if (codec_params.size() == 3) { | 3091 if (codec_params.size() == 3) { |
| 3097 if (!GetValueFromString(line, codec_params[2], &channels, error)) { | 3092 if (!GetValueFromString(line, codec_params[2], &channels, error)) { |
| 3098 return false; | 3093 return false; |
| 3099 } | 3094 } |
| 3100 } | 3095 } |
| 3101 int bitrate = 0; | |
| 3102 // The default behavior for ISAC (bitrate == 0) in webrtcvoiceengine.cc | |
| 3103 // (specifically FindWebRtcCodec) is bandwidth-adaptive variable bitrate. | |
| 3104 // The bandwidth adaptation doesn't always work well, so this code | |
| 3105 // sets a fixed target bitrate instead. | |
| 3106 if (_stricmp(encoding_name.c_str(), kIsacCodecName) == 0) { | |
| 3107 if (clock_rate <= 16000) { | |
| 3108 bitrate = kIsacWbDefaultRate; | |
| 3109 } else { | |
| 3110 bitrate = kIsacSwbDefaultRate; | |
| 3111 } | |
| 3112 } | |
| 3113 AudioContentDescription* audio_desc = | 3096 AudioContentDescription* audio_desc = |
| 3114 static_cast<AudioContentDescription*>(media_desc); | 3097 static_cast<AudioContentDescription*>(media_desc); |
| 3115 UpdateCodec(payload_type, encoding_name, clock_rate, bitrate, channels, | 3098 UpdateCodec(payload_type, encoding_name, clock_rate, 0, channels, |
| 3116 audio_desc); | 3099 audio_desc); |
| 3117 } else if (media_type == cricket::MEDIA_TYPE_DATA) { | 3100 } else if (media_type == cricket::MEDIA_TYPE_DATA) { |
| 3118 DataContentDescription* data_desc = | 3101 DataContentDescription* data_desc = |
| 3119 static_cast<DataContentDescription*>(media_desc); | 3102 static_cast<DataContentDescription*>(media_desc); |
| 3120 data_desc->AddCodec(cricket::DataCodec(payload_type, encoding_name)); | 3103 data_desc->AddCodec(cricket::DataCodec(payload_type, encoding_name)); |
| 3121 } | 3104 } |
| 3122 return true; | 3105 return true; |
| 3123 } | 3106 } |
| 3124 | 3107 |
| 3125 bool ParseFmtpParam(const std::string& line, std::string* parameter, | 3108 bool ParseFmtpParam(const std::string& line, std::string* parameter, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3231 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( | 3214 UpdateCodec<AudioContentDescription, cricket::AudioCodec>( |
| 3232 media_desc, payload_type, feedback_param); | 3215 media_desc, payload_type, feedback_param); |
| 3233 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { | 3216 } else if (media_type == cricket::MEDIA_TYPE_VIDEO) { |
| 3234 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( | 3217 UpdateCodec<VideoContentDescription, cricket::VideoCodec>( |
| 3235 media_desc, payload_type, feedback_param); | 3218 media_desc, payload_type, feedback_param); |
| 3236 } | 3219 } |
| 3237 return true; | 3220 return true; |
| 3238 } | 3221 } |
| 3239 | 3222 |
| 3240 } // namespace webrtc | 3223 } // namespace webrtc |
| OLD | NEW |