| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 VideoCodec VideoCodec::CreateRtxCodec(int rtx_payload_type, | 259 VideoCodec VideoCodec::CreateRtxCodec(int rtx_payload_type, |
| 260 int associated_payload_type) { | 260 int associated_payload_type) { |
| 261 VideoCodec rtx_codec(rtx_payload_type, kRtxCodecName); | 261 VideoCodec rtx_codec(rtx_payload_type, kRtxCodecName); |
| 262 rtx_codec.SetParam(kCodecParamAssociatedPayloadType, associated_payload_type); | 262 rtx_codec.SetParam(kCodecParamAssociatedPayloadType, associated_payload_type); |
| 263 return rtx_codec; | 263 return rtx_codec; |
| 264 } | 264 } |
| 265 | 265 |
| 266 // static |
| 267 VideoCodec VideoCodec::CreateStereoCodec(int stereo_payload_type, |
| 268 const VideoCodec& codec) { |
| 269 VideoCodec stereo_codec(stereo_payload_type, kStereoCodecName); |
| 270 stereo_codec.SetParam(kCodecParamAssociatedPayloadType, codec.id); |
| 271 return stereo_codec; |
| 272 } |
| 273 |
| 274 // static |
| 275 bool VideoCodec::IsStereoCodec(const VideoCodec& codec) { |
| 276 return CodecNamesEq(codec.name.c_str(), kStereoCodecName); |
| 277 } |
| 278 |
| 266 VideoCodec::CodecType VideoCodec::GetCodecType() const { | 279 VideoCodec::CodecType VideoCodec::GetCodecType() const { |
| 267 const char* payload_name = name.c_str(); | 280 const char* payload_name = name.c_str(); |
| 268 if (_stricmp(payload_name, kRedCodecName) == 0) { | 281 if (_stricmp(payload_name, kRedCodecName) == 0) { |
| 269 return CODEC_RED; | 282 return CODEC_RED; |
| 270 } | 283 } |
| 271 if (_stricmp(payload_name, kUlpfecCodecName) == 0) { | 284 if (_stricmp(payload_name, kUlpfecCodecName) == 0) { |
| 272 return CODEC_ULPFEC; | 285 return CODEC_ULPFEC; |
| 273 } | 286 } |
| 274 if (_stricmp(payload_name, kFlexfecCodecName) == 0) { | 287 if (_stricmp(payload_name, kFlexfecCodecName) == 0) { |
| 275 return CODEC_FLEXFEC; | 288 return CODEC_FLEXFEC; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 if (CodecNamesEq(codec.name.c_str(), kH264CodecName) && | 366 if (CodecNamesEq(codec.name.c_str(), kH264CodecName) && |
| 354 !IsSameH264Profile(codec.params, supported_codec.params)) { | 367 !IsSameH264Profile(codec.params, supported_codec.params)) { |
| 355 continue; | 368 continue; |
| 356 } | 369 } |
| 357 return &supported_codec; | 370 return &supported_codec; |
| 358 } | 371 } |
| 359 return nullptr; | 372 return nullptr; |
| 360 } | 373 } |
| 361 | 374 |
| 362 } // namespace cricket | 375 } // namespace cricket |
| OLD | NEW |