| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 EXPECT_TRUE(c1.HasFeedbackParam(a1)); | 232 EXPECT_TRUE(c1.HasFeedbackParam(a1)); |
| 233 EXPECT_FALSE(c1.HasFeedbackParam(b2)); | 233 EXPECT_FALSE(c1.HasFeedbackParam(b2)); |
| 234 EXPECT_FALSE(c1.HasFeedbackParam(c3)); | 234 EXPECT_FALSE(c1.HasFeedbackParam(c3)); |
| 235 } | 235 } |
| 236 | 236 |
| 237 TEST(CodecTest, TestGetCodecType) { | 237 TEST(CodecTest, TestGetCodecType) { |
| 238 // Codec type comparison should be case insenstive on names. | 238 // Codec type comparison should be case insenstive on names. |
| 239 const VideoCodec codec(96, "V"); | 239 const VideoCodec codec(96, "V"); |
| 240 const VideoCodec rtx_codec(96, "rTx"); | 240 const VideoCodec rtx_codec(96, "rTx"); |
| 241 const VideoCodec ulpfec_codec(96, "ulpFeC"); | 241 const VideoCodec ulpfec_codec(96, "ulpFeC"); |
| 242 const VideoCodec flexfec_codec(96, "FlExFeC-03"); |
| 242 const VideoCodec red_codec(96, "ReD"); | 243 const VideoCodec red_codec(96, "ReD"); |
| 243 EXPECT_EQ(VideoCodec::CODEC_VIDEO, codec.GetCodecType()); | 244 EXPECT_EQ(VideoCodec::CODEC_VIDEO, codec.GetCodecType()); |
| 244 EXPECT_EQ(VideoCodec::CODEC_RTX, rtx_codec.GetCodecType()); | 245 EXPECT_EQ(VideoCodec::CODEC_RTX, rtx_codec.GetCodecType()); |
| 245 EXPECT_EQ(VideoCodec::CODEC_ULPFEC, ulpfec_codec.GetCodecType()); | 246 EXPECT_EQ(VideoCodec::CODEC_ULPFEC, ulpfec_codec.GetCodecType()); |
| 247 EXPECT_EQ(VideoCodec::CODEC_FLEXFEC, flexfec_codec.GetCodecType()); |
| 246 EXPECT_EQ(VideoCodec::CODEC_RED, red_codec.GetCodecType()); | 248 EXPECT_EQ(VideoCodec::CODEC_RED, red_codec.GetCodecType()); |
| 247 } | 249 } |
| 248 | 250 |
| 249 TEST(CodecTest, TestCreateRtxCodec) { | 251 TEST(CodecTest, TestCreateRtxCodec) { |
| 250 VideoCodec rtx_codec = VideoCodec::CreateRtxCodec(96, 120); | 252 VideoCodec rtx_codec = VideoCodec::CreateRtxCodec(96, 120); |
| 251 EXPECT_EQ(96, rtx_codec.id); | 253 EXPECT_EQ(96, rtx_codec.id); |
| 252 EXPECT_EQ(VideoCodec::CODEC_RTX, rtx_codec.GetCodecType()); | 254 EXPECT_EQ(VideoCodec::CODEC_RTX, rtx_codec.GetCodecType()); |
| 253 int associated_payload_type; | 255 int associated_payload_type; |
| 254 ASSERT_TRUE(rtx_codec.GetParam(kCodecParamAssociatedPayloadType, | 256 ASSERT_TRUE(rtx_codec.GetParam(kCodecParamAssociatedPayloadType, |
| 255 &associated_payload_type)); | 257 &associated_payload_type)); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); | 307 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); |
| 306 EXPECT_EQ(1, codec_params_1.channels); | 308 EXPECT_EQ(1, codec_params_1.channels); |
| 307 | 309 |
| 308 const AudioCodec a(97, "A", 44100, 20000, 2); | 310 const AudioCodec a(97, "A", 44100, 20000, 2); |
| 309 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); | 311 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); |
| 310 EXPECT_EQ(97, codec_params_2.payload_type); | 312 EXPECT_EQ(97, codec_params_2.payload_type); |
| 311 EXPECT_EQ("A", codec_params_2.mime_type); | 313 EXPECT_EQ("A", codec_params_2.mime_type); |
| 312 EXPECT_EQ(44100, codec_params_2.clock_rate); | 314 EXPECT_EQ(44100, codec_params_2.clock_rate); |
| 313 EXPECT_EQ(2, codec_params_2.channels); | 315 EXPECT_EQ(2, codec_params_2.channels); |
| 314 } | 316 } |
| OLD | NEW |