| 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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 bool VideoCodec::ValidateCodecFormat() const { | 308 bool VideoCodec::ValidateCodecFormat() const { |
| 309 if (id < 0 || id > 127) { | 309 if (id < 0 || id > 127) { |
| 310 LOG(LS_ERROR) << "Codec with invalid payload type: " << ToString(); | 310 LOG(LS_ERROR) << "Codec with invalid payload type: " << ToString(); |
| 311 return false; | 311 return false; |
| 312 } | 312 } |
| 313 if (GetCodecType() != CODEC_VIDEO) { | 313 if (GetCodecType() != CODEC_VIDEO) { |
| 314 return true; | 314 return true; |
| 315 } | 315 } |
| 316 | 316 |
| 317 // Video validation from here on. | 317 // Video validation from here on. |
| 318 | |
| 319 if (width <= 0 || height <= 0) { | |
| 320 LOG(LS_ERROR) << "Codec with invalid dimensions: " << ToString(); | |
| 321 return false; | |
| 322 } | |
| 323 int min_bitrate = -1; | 318 int min_bitrate = -1; |
| 324 int max_bitrate = -1; | 319 int max_bitrate = -1; |
| 325 if (GetParam(kCodecParamMinBitrate, &min_bitrate) && | 320 if (GetParam(kCodecParamMinBitrate, &min_bitrate) && |
| 326 GetParam(kCodecParamMaxBitrate, &max_bitrate)) { | 321 GetParam(kCodecParamMaxBitrate, &max_bitrate)) { |
| 327 if (max_bitrate < min_bitrate) { | 322 if (max_bitrate < min_bitrate) { |
| 328 LOG(LS_ERROR) << "Codec with max < min bitrate: " << ToString(); | 323 LOG(LS_ERROR) << "Codec with max < min bitrate: " << ToString(); |
| 329 return false; | 324 return false; |
| 330 } | 325 } |
| 331 } | 326 } |
| 332 return true; | 327 return true; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 362 bool HasTransportCc(const Codec& codec) { | 357 bool HasTransportCc(const Codec& codec) { |
| 363 return codec.HasFeedbackParam( | 358 return codec.HasFeedbackParam( |
| 364 FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); | 359 FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); |
| 365 } | 360 } |
| 366 | 361 |
| 367 bool CodecNamesEq(const std::string& name1, const std::string& name2) { | 362 bool CodecNamesEq(const std::string& name1, const std::string& name2) { |
| 368 return _stricmp(name1.c_str(), name2.c_str()) == 0; | 363 return _stricmp(name1.c_str(), name2.c_str()) == 0; |
| 369 } | 364 } |
| 370 | 365 |
| 371 } // namespace cricket | 366 } // namespace cricket |
| OLD | NEW |