| 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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 equal_bitrates.params[kCodecParamMinBitrate] = "100"; | 314 equal_bitrates.params[kCodecParamMinBitrate] = "100"; |
| 315 equal_bitrates.params[kCodecParamMaxBitrate] = "100"; | 315 equal_bitrates.params[kCodecParamMaxBitrate] = "100"; |
| 316 EXPECT_TRUE(equal_bitrates.ValidateCodecFormat()); | 316 EXPECT_TRUE(equal_bitrates.ValidateCodecFormat()); |
| 317 | 317 |
| 318 // Accept min bitrate < max bitrate. | 318 // Accept min bitrate < max bitrate. |
| 319 VideoCodec different_bitrates = codec; | 319 VideoCodec different_bitrates = codec; |
| 320 different_bitrates.params[kCodecParamMinBitrate] = "99"; | 320 different_bitrates.params[kCodecParamMinBitrate] = "99"; |
| 321 different_bitrates.params[kCodecParamMaxBitrate] = "100"; | 321 different_bitrates.params[kCodecParamMaxBitrate] = "100"; |
| 322 EXPECT_TRUE(different_bitrates.ValidateCodecFormat()); | 322 EXPECT_TRUE(different_bitrates.ValidateCodecFormat()); |
| 323 } | 323 } |
| 324 |
| 325 TEST_F(CodecTest, TestToCodecParameters) { |
| 326 const VideoCodec v(96, "V", 320, 200, 30); |
| 327 webrtc::RtpCodecParameters codec_params_1 = v.ToCodecParameters(); |
| 328 EXPECT_EQ(96, codec_params_1.payload_type); |
| 329 EXPECT_EQ("V", codec_params_1.mime_type); |
| 330 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); |
| 331 EXPECT_EQ(1, codec_params_1.channels); |
| 332 |
| 333 const AudioCodec a(97, "A", 44100, 20000, 2); |
| 334 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); |
| 335 EXPECT_EQ(97, codec_params_2.payload_type); |
| 336 EXPECT_EQ("A", codec_params_2.mime_type); |
| 337 EXPECT_EQ(44100, codec_params_2.clock_rate); |
| 338 EXPECT_EQ(2, codec_params_2.channels); |
| 339 } |
| OLD | NEW |