Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1089)

Side by Side Diff: webrtc/media/base/codec_unittest.cc

Issue 2651883010: Adding C++ versions of currently spec'd "RtpParameters" structs. (Closed)
Patch Set: Update unit tests (due to switch from special-case values to rtc::Optional) Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/media/base/codec.cc ('k') | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 VideoCodec different_bitrates = codec; 304 VideoCodec different_bitrates = codec;
305 different_bitrates.params[kCodecParamMinBitrate] = "99"; 305 different_bitrates.params[kCodecParamMinBitrate] = "99";
306 different_bitrates.params[kCodecParamMaxBitrate] = "100"; 306 different_bitrates.params[kCodecParamMaxBitrate] = "100";
307 EXPECT_TRUE(different_bitrates.ValidateCodecFormat()); 307 EXPECT_TRUE(different_bitrates.ValidateCodecFormat());
308 } 308 }
309 309
310 TEST(CodecTest, TestToCodecParameters) { 310 TEST(CodecTest, TestToCodecParameters) {
311 const VideoCodec v(96, "V"); 311 const VideoCodec v(96, "V");
312 webrtc::RtpCodecParameters codec_params_1 = v.ToCodecParameters(); 312 webrtc::RtpCodecParameters codec_params_1 = v.ToCodecParameters();
313 EXPECT_EQ(96, codec_params_1.payload_type); 313 EXPECT_EQ(96, codec_params_1.payload_type);
314 EXPECT_EQ("V", codec_params_1.mime_type); 314 EXPECT_EQ(cricket::MEDIA_TYPE_VIDEO, codec_params_1.kind);
315 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate); 315 EXPECT_EQ("V", codec_params_1.name);
316 EXPECT_EQ(1, codec_params_1.channels); 316 EXPECT_EQ(rtc::Optional<int>(cricket::kVideoCodecClockrate),
317 codec_params_1.clock_rate);
318 EXPECT_EQ(rtc::Optional<int>(), codec_params_1.num_channels);
317 319
318 const AudioCodec a(97, "A", 44100, 20000, 2); 320 const AudioCodec a(97, "A", 44100, 20000, 2);
319 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters(); 321 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters();
320 EXPECT_EQ(97, codec_params_2.payload_type); 322 EXPECT_EQ(97, codec_params_2.payload_type);
321 EXPECT_EQ("A", codec_params_2.mime_type); 323 EXPECT_EQ(cricket::MEDIA_TYPE_AUDIO, codec_params_2.kind);
322 EXPECT_EQ(44100, codec_params_2.clock_rate); 324 EXPECT_EQ("A", codec_params_2.name);
323 EXPECT_EQ(2, codec_params_2.channels); 325 EXPECT_EQ(rtc::Optional<int>(44100), codec_params_2.clock_rate);
326 EXPECT_EQ(rtc::Optional<int>(2), codec_params_2.num_channels);
324 } 327 }
OLDNEW
« no previous file with comments | « webrtc/media/base/codec.cc ('k') | webrtc/media/engine/webrtcvideoengine2.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698