| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2009 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2009 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 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 // Reject negative payloads. | 341 // Reject negative payloads. |
| 342 VideoCodec negative_payload_type = codec; | 342 VideoCodec negative_payload_type = codec; |
| 343 negative_payload_type.id = -1; | 343 negative_payload_type.id = -1; |
| 344 EXPECT_FALSE(negative_payload_type.ValidateCodecFormat()); | 344 EXPECT_FALSE(negative_payload_type.ValidateCodecFormat()); |
| 345 | 345 |
| 346 // Reject too-high payloads. | 346 // Reject too-high payloads. |
| 347 VideoCodec too_high_payload_type = codec; | 347 VideoCodec too_high_payload_type = codec; |
| 348 too_high_payload_type.id = 128; | 348 too_high_payload_type.id = 128; |
| 349 EXPECT_FALSE(too_high_payload_type.ValidateCodecFormat()); | 349 EXPECT_FALSE(too_high_payload_type.ValidateCodecFormat()); |
| 350 | 350 |
| 351 // Reject zero-width codecs. | |
| 352 VideoCodec zero_width = codec; | |
| 353 zero_width.width = 0; | |
| 354 EXPECT_FALSE(zero_width.ValidateCodecFormat()); | |
| 355 | |
| 356 // Reject zero-height codecs. | |
| 357 VideoCodec zero_height = codec; | |
| 358 zero_height.height = 0; | |
| 359 EXPECT_FALSE(zero_height.ValidateCodecFormat()); | |
| 360 | |
| 361 // Accept non-video codecs with zero dimensions. | 351 // Accept non-video codecs with zero dimensions. |
| 362 VideoCodec zero_width_rtx_codec = VideoCodec::CreateRtxCodec(96, 120); | 352 VideoCodec zero_width_rtx_codec = VideoCodec::CreateRtxCodec(96, 120); |
| 363 zero_width_rtx_codec.width = 0; | 353 zero_width_rtx_codec.width = 0; |
| 364 EXPECT_TRUE(zero_width_rtx_codec.ValidateCodecFormat()); | 354 EXPECT_TRUE(zero_width_rtx_codec.ValidateCodecFormat()); |
| 365 | 355 |
| 366 // Reject codecs with min bitrate > max bitrate. | 356 // Reject codecs with min bitrate > max bitrate. |
| 367 VideoCodec incorrect_bitrates = codec; | 357 VideoCodec incorrect_bitrates = codec; |
| 368 incorrect_bitrates.params[kCodecParamMinBitrate] = "100"; | 358 incorrect_bitrates.params[kCodecParamMinBitrate] = "100"; |
| 369 incorrect_bitrates.params[kCodecParamMaxBitrate] = "80"; | 359 incorrect_bitrates.params[kCodecParamMaxBitrate] = "80"; |
| 370 EXPECT_FALSE(incorrect_bitrates.ValidateCodecFormat()); | 360 EXPECT_FALSE(incorrect_bitrates.ValidateCodecFormat()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 390 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); | 380 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); |
| 391 EXPECT_EQ(1, codec_params_1.channels); | 381 EXPECT_EQ(1, codec_params_1.channels); |
| 392 | 382 |
| 393 const AudioCodec a(97, "A", 44100, 20000, 2); | 383 const AudioCodec a(97, "A", 44100, 20000, 2); |
| 394 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); | 384 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); |
| 395 EXPECT_EQ(97, codec_params_2.payload_type); | 385 EXPECT_EQ(97, codec_params_2.payload_type); |
| 396 EXPECT_EQ("A", codec_params_2.mime_type); | 386 EXPECT_EQ("A", codec_params_2.mime_type); |
| 397 EXPECT_EQ(44100, codec_params_2.clock_rate); | 387 EXPECT_EQ(44100, codec_params_2.clock_rate); |
| 398 EXPECT_EQ(2, codec_params_2.channels); | 388 EXPECT_EQ(2, codec_params_2.channels); |
| 399 } | 389 } |
| OLD | NEW |