blob: 230cf08fa631c1ddb88827c103b16de517da3f5f [file] [log] [blame]
henrike@webrtc.org28e20752013-07-10 00:45:36 +00001/*
kjellander1afca732016-02-07 20:46:45 -08002 * Copyright (c) 2009 The WebRTC project authors. All Rights Reserved.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00003 *
kjellander1afca732016-02-07 20:46:45 -08004 * 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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
henrike@webrtc.org28e20752013-07-10 00:45:36 +00009 */
10
buildbot@webrtc.orga09a9992014-08-13 17:26:08 +000011#include "webrtc/base/gunit.h"
kjellandera96e2d72016-02-04 23:52:28 -080012#include "webrtc/media/base/codec.h"
henrike@webrtc.org28e20752013-07-10 00:45:36 +000013
14using cricket::AudioCodec;
15using cricket::Codec;
16using cricket::DataCodec;
17using cricket::FeedbackParam;
18using cricket::VideoCodec;
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +000019using cricket::kCodecParamAssociatedPayloadType;
20using cricket::kCodecParamMaxBitrate;
21using cricket::kCodecParamMinBitrate;
henrike@webrtc.org28e20752013-07-10 00:45:36 +000022
magjed68979ab2016-10-06 02:15:49 -070023TEST(CodecTest, TestCodecOperators) {
deadbeef67cf2c12016-04-13 10:07:16 -070024 Codec c0(96, "D", 1000);
jiayl@webrtc.org9c16c392014-05-01 18:30:30 +000025 c0.SetParam("a", 1);
26
27 Codec c1 = c0;
28 EXPECT_TRUE(c1 == c0);
29
30 int param_value0;
31 int param_value1;
32 EXPECT_TRUE(c0.GetParam("a", &param_value0));
33 EXPECT_TRUE(c1.GetParam("a", &param_value1));
34 EXPECT_EQ(param_value0, param_value1);
35
36 c1.id = 86;
37 EXPECT_TRUE(c0 != c1);
38
39 c1 = c0;
40 c1.name = "x";
41 EXPECT_TRUE(c0 != c1);
42
43 c1 = c0;
44 c1.clockrate = 2000;
45 EXPECT_TRUE(c0 != c1);
46
47 c1 = c0;
jiayl@webrtc.org9c16c392014-05-01 18:30:30 +000048 c1.SetParam("a", 2);
49 EXPECT_TRUE(c0 != c1);
50
51 Codec c5;
deadbeef67cf2c12016-04-13 10:07:16 -070052 Codec c6(0, "", 0);
jiayl@webrtc.org9c16c392014-05-01 18:30:30 +000053 EXPECT_TRUE(c5 == c6);
54}
55
magjed68979ab2016-10-06 02:15:49 -070056TEST(CodecTest, TestAudioCodecOperators) {
deadbeef67cf2c12016-04-13 10:07:16 -070057 AudioCodec c0(96, "A", 44100, 20000, 2);
58 AudioCodec c1(95, "A", 44100, 20000, 2);
59 AudioCodec c2(96, "x", 44100, 20000, 2);
60 AudioCodec c3(96, "A", 48000, 20000, 2);
61 AudioCodec c4(96, "A", 44100, 10000, 2);
62 AudioCodec c5(96, "A", 44100, 20000, 1);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000063 EXPECT_TRUE(c0 != c1);
64 EXPECT_TRUE(c0 != c2);
65 EXPECT_TRUE(c0 != c3);
66 EXPECT_TRUE(c0 != c4);
67 EXPECT_TRUE(c0 != c5);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000068
69 AudioCodec c7;
deadbeef67cf2c12016-04-13 10:07:16 -070070 AudioCodec c8(0, "", 0, 0, 0);
henrike@webrtc.org28e20752013-07-10 00:45:36 +000071 AudioCodec c9 = c0;
72 EXPECT_TRUE(c8 == c7);
73 EXPECT_TRUE(c9 != c7);
74 EXPECT_TRUE(c9 == c0);
75
76 AudioCodec c10(c0);
77 AudioCodec c11(c0);
78 AudioCodec c12(c0);
79 AudioCodec c13(c0);
80 c10.params["x"] = "abc";
81 c11.params["x"] = "def";
82 c12.params["y"] = "abc";
83 c13.params["x"] = "abc";
84 EXPECT_TRUE(c10 != c0);
85 EXPECT_TRUE(c11 != c0);
86 EXPECT_TRUE(c11 != c10);
87 EXPECT_TRUE(c12 != c0);
88 EXPECT_TRUE(c12 != c10);
89 EXPECT_TRUE(c12 != c11);
90 EXPECT_TRUE(c13 == c10);
91}
92
magjed68979ab2016-10-06 02:15:49 -070093TEST(CodecTest, TestAudioCodecMatches) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +000094 // Test a codec with a static payload type.
deadbeef67cf2c12016-04-13 10:07:16 -070095 AudioCodec c0(95, "A", 44100, 20000, 1);
96 EXPECT_TRUE(c0.Matches(AudioCodec(95, "", 44100, 20000, 1)));
97 EXPECT_TRUE(c0.Matches(AudioCodec(95, "", 44100, 20000, 0)));
98 EXPECT_TRUE(c0.Matches(AudioCodec(95, "", 44100, 0, 0)));
99 EXPECT_TRUE(c0.Matches(AudioCodec(95, "", 0, 0, 0)));
100 EXPECT_FALSE(c0.Matches(AudioCodec(96, "", 44100, 20000, 1)));
101 EXPECT_FALSE(c0.Matches(AudioCodec(95, "", 55100, 20000, 1)));
102 EXPECT_FALSE(c0.Matches(AudioCodec(95, "", 44100, 30000, 1)));
103 EXPECT_FALSE(c0.Matches(AudioCodec(95, "", 44100, 20000, 2)));
104 EXPECT_FALSE(c0.Matches(AudioCodec(95, "", 55100, 30000, 2)));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000105
106 // Test a codec with a dynamic payload type.
deadbeef67cf2c12016-04-13 10:07:16 -0700107 AudioCodec c1(96, "A", 44100, 20000, 1);
108 EXPECT_TRUE(c1.Matches(AudioCodec(96, "A", 0, 0, 0)));
109 EXPECT_TRUE(c1.Matches(AudioCodec(97, "A", 0, 0, 0)));
110 EXPECT_TRUE(c1.Matches(AudioCodec(96, "a", 0, 0, 0)));
111 EXPECT_TRUE(c1.Matches(AudioCodec(97, "a", 0, 0, 0)));
112 EXPECT_FALSE(c1.Matches(AudioCodec(95, "A", 0, 0, 0)));
113 EXPECT_FALSE(c1.Matches(AudioCodec(96, "", 44100, 20000, 2)));
114 EXPECT_FALSE(c1.Matches(AudioCodec(96, "A", 55100, 30000, 1)));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000115
116 // Test a codec with a dynamic payload type, and auto bitrate.
deadbeef67cf2c12016-04-13 10:07:16 -0700117 AudioCodec c2(97, "A", 16000, 0, 1);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000118 // Use default bitrate.
deadbeef67cf2c12016-04-13 10:07:16 -0700119 EXPECT_TRUE(c2.Matches(AudioCodec(97, "A", 16000, 0, 1)));
120 EXPECT_TRUE(c2.Matches(AudioCodec(97, "A", 16000, 0, 0)));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000121 // Use explicit bitrate.
deadbeef67cf2c12016-04-13 10:07:16 -0700122 EXPECT_TRUE(c2.Matches(AudioCodec(97, "A", 16000, 32000, 1)));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000123 // Backward compatibility with clients that might send "-1" (for default).
deadbeef67cf2c12016-04-13 10:07:16 -0700124 EXPECT_TRUE(c2.Matches(AudioCodec(97, "A", 16000, -1, 1)));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000125
126 // Stereo doesn't match channels = 0.
deadbeef67cf2c12016-04-13 10:07:16 -0700127 AudioCodec c3(96, "A", 44100, 20000, 2);
128 EXPECT_TRUE(c3.Matches(AudioCodec(96, "A", 44100, 20000, 2)));
129 EXPECT_FALSE(c3.Matches(AudioCodec(96, "A", 44100, 20000, 1)));
130 EXPECT_FALSE(c3.Matches(AudioCodec(96, "A", 44100, 20000, 0)));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000131}
132
magjed68979ab2016-10-06 02:15:49 -0700133TEST(CodecTest, TestVideoCodecOperators) {
perkj26752742016-10-24 01:21:16 -0700134 VideoCodec c0(96, "V");
135 VideoCodec c1(95, "V");
136 VideoCodec c2(96, "x");
137
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000138 EXPECT_TRUE(c0 != c1);
139 EXPECT_TRUE(c0 != c2);
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000140
141 VideoCodec c7;
perkj26752742016-10-24 01:21:16 -0700142 VideoCodec c8(0, "");
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000143 VideoCodec c9 = c0;
144 EXPECT_TRUE(c8 == c7);
145 EXPECT_TRUE(c9 != c7);
146 EXPECT_TRUE(c9 == c0);
147
148 VideoCodec c10(c0);
149 VideoCodec c11(c0);
150 VideoCodec c12(c0);
151 VideoCodec c13(c0);
152 c10.params["x"] = "abc";
153 c11.params["x"] = "def";
154 c12.params["y"] = "abc";
155 c13.params["x"] = "abc";
156 EXPECT_TRUE(c10 != c0);
157 EXPECT_TRUE(c11 != c0);
158 EXPECT_TRUE(c11 != c10);
159 EXPECT_TRUE(c12 != c0);
160 EXPECT_TRUE(c12 != c10);
161 EXPECT_TRUE(c12 != c11);
162 EXPECT_TRUE(c13 == c10);
163}
164
magjed68979ab2016-10-06 02:15:49 -0700165TEST(CodecTest, TestVideoCodecMatches) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000166 // Test a codec with a static payload type.
perkj26752742016-10-24 01:21:16 -0700167 VideoCodec c0(95, "V");
168 EXPECT_TRUE(c0.Matches(VideoCodec(95, "")));
169 EXPECT_FALSE(c0.Matches(VideoCodec(96, "")));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000170
171 // Test a codec with a dynamic payload type.
perkj26752742016-10-24 01:21:16 -0700172 VideoCodec c1(96, "V");
173 EXPECT_TRUE(c1.Matches(VideoCodec(96, "V")));
174 EXPECT_TRUE(c1.Matches(VideoCodec(97, "V")));
175 EXPECT_TRUE(c1.Matches(VideoCodec(96, "v")));
176 EXPECT_TRUE(c1.Matches(VideoCodec(97, "v")));
177 EXPECT_FALSE(c1.Matches(VideoCodec(96, "")));
178 EXPECT_FALSE(c1.Matches(VideoCodec(95, "V")));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000179}
180
magjed68979ab2016-10-06 02:15:49 -0700181TEST(CodecTest, TestVideoCodecMatchesH264Baseline) {
perkj26752742016-10-24 01:21:16 -0700182 const VideoCodec no_params(96, cricket::kH264CodecName);
magjed68979ab2016-10-06 02:15:49 -0700183
perkj26752742016-10-24 01:21:16 -0700184 VideoCodec baseline(96, cricket::kH264CodecName);
magjed68979ab2016-10-06 02:15:49 -0700185 baseline.SetParam(cricket::kH264FmtpProfileLevelId,
186 cricket::kH264FmtpDefaultProfileLevelId);
187
188 EXPECT_TRUE(baseline.Matches(baseline));
189 EXPECT_TRUE(baseline.Matches(no_params));
190 EXPECT_TRUE(no_params.Matches(baseline));
191 EXPECT_TRUE(no_params.Matches(no_params));
192}
193
194TEST(CodecTest, TestVideoCodecMatchesH264Profiles) {
perkj26752742016-10-24 01:21:16 -0700195 VideoCodec baseline(96, cricket::kH264CodecName);
magjed68979ab2016-10-06 02:15:49 -0700196 baseline.SetParam(cricket::kH264FmtpProfileLevelId,
197 cricket::kH264FmtpDefaultProfileLevelId);
198 baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1");
199
perkj26752742016-10-24 01:21:16 -0700200 VideoCodec constrained_baseline(96, cricket::kH264CodecName);
magjed68979ab2016-10-06 02:15:49 -0700201 constrained_baseline.SetParam(cricket::kH264FmtpProfileLevelId,
202 cricket::kH264ProfileLevelConstrainedBaseline);
203 constrained_baseline.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "1");
204
205 EXPECT_TRUE(baseline.Matches(baseline));
206 EXPECT_FALSE(baseline.Matches(constrained_baseline));
207 EXPECT_FALSE(constrained_baseline.Matches(baseline));
208 EXPECT_TRUE(constrained_baseline.Matches(constrained_baseline));
209}
210
211TEST(CodecTest, TestVideoCodecMatchesH264LevelAsymmetry) {
212 // Constrained Baseline Profile Level 1.0.
perkj26752742016-10-24 01:21:16 -0700213 VideoCodec cbp_1_0(96, cricket::kH264CodecName);
magjed68979ab2016-10-06 02:15:49 -0700214 cbp_1_0.SetParam(cricket::kH264FmtpProfileLevelId,
215 "42e00a");
216
217 VideoCodec cbp_1_0_asymmetry_allowed = cbp_1_0;
218 cbp_1_0_asymmetry_allowed.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed,
219 "1");
220
221 // Constrained Baseline Profile Level 3.1.
perkj26752742016-10-24 01:21:16 -0700222 VideoCodec cbp_3_1(96, cricket::kH264CodecName);
magjed68979ab2016-10-06 02:15:49 -0700223 cbp_3_1.SetParam(cricket::kH264FmtpProfileLevelId, "42e01f");
224
225 VideoCodec cbp_3_1_asymmetry_allowed = cbp_3_1;
226 cbp_3_1_asymmetry_allowed.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed,
227 "1");
228
229 // It's ok to differ in level-asymmetry-allowed param as long as the level is
230 // the same.
231 EXPECT_TRUE(cbp_1_0.Matches(cbp_1_0_asymmetry_allowed));
232 EXPECT_TRUE(cbp_3_1.Matches(cbp_3_1_asymmetry_allowed));
233
234 // Both codecs need to accept level asymmetry if levels differ.
235 EXPECT_FALSE(cbp_1_0.Matches(cbp_3_1_asymmetry_allowed));
236 EXPECT_FALSE(cbp_1_0_asymmetry_allowed.Matches(cbp_3_1));
237 EXPECT_TRUE(cbp_1_0_asymmetry_allowed.Matches(cbp_3_1_asymmetry_allowed));
238
239 // Test explicitly disabling level asymmetry. It should have the same behavior
240 // as missing the param.
241 cbp_1_0.SetParam(cricket::kH264FmtpLevelAsymmetryAllowed, "0");
242 EXPECT_TRUE(cbp_1_0.Matches(cbp_1_0_asymmetry_allowed));
243 EXPECT_FALSE(cbp_1_0.Matches(cbp_3_1_asymmetry_allowed));
244}
245
246TEST(CodecTest, TestDataCodecMatches) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000247 // Test a codec with a static payload type.
deadbeef67cf2c12016-04-13 10:07:16 -0700248 DataCodec c0(95, "D");
249 EXPECT_TRUE(c0.Matches(DataCodec(95, "")));
250 EXPECT_FALSE(c0.Matches(DataCodec(96, "")));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000251
252 // Test a codec with a dynamic payload type.
deadbeef67cf2c12016-04-13 10:07:16 -0700253 DataCodec c1(96, "D");
254 EXPECT_TRUE(c1.Matches(DataCodec(96, "D")));
255 EXPECT_TRUE(c1.Matches(DataCodec(97, "D")));
256 EXPECT_TRUE(c1.Matches(DataCodec(96, "d")));
257 EXPECT_TRUE(c1.Matches(DataCodec(97, "d")));
258 EXPECT_FALSE(c1.Matches(DataCodec(96, "")));
259 EXPECT_FALSE(c1.Matches(DataCodec(95, "D")));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000260}
261
magjed68979ab2016-10-06 02:15:49 -0700262TEST(CodecTest, TestSetParamGetParamAndRemoveParam) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000263 AudioCodec codec;
264 codec.SetParam("a", "1");
265 codec.SetParam("b", "x");
266
267 int int_value = 0;
268 EXPECT_TRUE(codec.GetParam("a", &int_value));
269 EXPECT_EQ(1, int_value);
270 EXPECT_FALSE(codec.GetParam("b", &int_value));
271 EXPECT_FALSE(codec.GetParam("c", &int_value));
272
273 std::string str_value;
274 EXPECT_TRUE(codec.GetParam("a", &str_value));
275 EXPECT_EQ("1", str_value);
276 EXPECT_TRUE(codec.GetParam("b", &str_value));
277 EXPECT_EQ("x", str_value);
278 EXPECT_FALSE(codec.GetParam("c", &str_value));
buildbot@webrtc.orgfbd13282014-06-19 19:50:55 +0000279 EXPECT_TRUE(codec.RemoveParam("a"));
280 EXPECT_FALSE(codec.RemoveParam("c"));
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000281}
282
magjed68979ab2016-10-06 02:15:49 -0700283TEST(CodecTest, TestIntersectFeedbackParams) {
henrike@webrtc.org28e20752013-07-10 00:45:36 +0000284 const FeedbackParam a1("a", "1");
285 const FeedbackParam b2("b", "2");
286 const FeedbackParam b3("b", "3");
287 const FeedbackParam c3("c", "3");
288 Codec c1;
289 c1.AddFeedbackParam(a1); // Only match with c2.
290 c1.AddFeedbackParam(b2); // Same param different values.
291 c1.AddFeedbackParam(c3); // Not in c2.
292 Codec c2;
293 c2.AddFeedbackParam(a1);
294 c2.AddFeedbackParam(b3);
295
296 c1.IntersectFeedbackParams(c2);
297 EXPECT_TRUE(c1.HasFeedbackParam(a1));
298 EXPECT_FALSE(c1.HasFeedbackParam(b2));
299 EXPECT_FALSE(c1.HasFeedbackParam(c3));
300}
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000301
magjed68979ab2016-10-06 02:15:49 -0700302TEST(CodecTest, TestGetCodecType) {
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000303 // Codec type comparison should be case insenstive on names.
perkj26752742016-10-24 01:21:16 -0700304 const VideoCodec codec(96, "V");
305 const VideoCodec rtx_codec(96, "rTx");
306 const VideoCodec ulpfec_codec(96, "ulpFeC");
307 const VideoCodec red_codec(96, "ReD");
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000308 EXPECT_EQ(VideoCodec::CODEC_VIDEO, codec.GetCodecType());
309 EXPECT_EQ(VideoCodec::CODEC_RTX, rtx_codec.GetCodecType());
310 EXPECT_EQ(VideoCodec::CODEC_ULPFEC, ulpfec_codec.GetCodecType());
311 EXPECT_EQ(VideoCodec::CODEC_RED, red_codec.GetCodecType());
312}
313
magjed68979ab2016-10-06 02:15:49 -0700314TEST(CodecTest, TestCreateRtxCodec) {
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000315 VideoCodec rtx_codec = VideoCodec::CreateRtxCodec(96, 120);
316 EXPECT_EQ(96, rtx_codec.id);
317 EXPECT_EQ(VideoCodec::CODEC_RTX, rtx_codec.GetCodecType());
318 int associated_payload_type;
319 ASSERT_TRUE(rtx_codec.GetParam(kCodecParamAssociatedPayloadType,
320 &associated_payload_type));
321 EXPECT_EQ(120, associated_payload_type);
322}
323
magjed68979ab2016-10-06 02:15:49 -0700324TEST(CodecTest, TestValidateCodecFormat) {
perkj26752742016-10-24 01:21:16 -0700325 const VideoCodec codec(96, "V");
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000326 ASSERT_TRUE(codec.ValidateCodecFormat());
327
328 // Accept 0-127 as payload types.
329 VideoCodec low_payload_type = codec;
330 low_payload_type.id = 0;
331 VideoCodec high_payload_type = codec;
332 high_payload_type.id = 127;
333 ASSERT_TRUE(low_payload_type.ValidateCodecFormat());
334 EXPECT_TRUE(high_payload_type.ValidateCodecFormat());
335
336 // Reject negative payloads.
337 VideoCodec negative_payload_type = codec;
338 negative_payload_type.id = -1;
339 EXPECT_FALSE(negative_payload_type.ValidateCodecFormat());
340
341 // Reject too-high payloads.
342 VideoCodec too_high_payload_type = codec;
343 too_high_payload_type.id = 128;
344 EXPECT_FALSE(too_high_payload_type.ValidateCodecFormat());
345
pbos@webrtc.orgb5a22b12014-05-13 11:07:01 +0000346 // Reject codecs with min bitrate > max bitrate.
347 VideoCodec incorrect_bitrates = codec;
348 incorrect_bitrates.params[kCodecParamMinBitrate] = "100";
349 incorrect_bitrates.params[kCodecParamMaxBitrate] = "80";
350 EXPECT_FALSE(incorrect_bitrates.ValidateCodecFormat());
351
352 // Accept min bitrate == max bitrate.
353 VideoCodec equal_bitrates = codec;
354 equal_bitrates.params[kCodecParamMinBitrate] = "100";
355 equal_bitrates.params[kCodecParamMaxBitrate] = "100";
356 EXPECT_TRUE(equal_bitrates.ValidateCodecFormat());
357
358 // Accept min bitrate < max bitrate.
359 VideoCodec different_bitrates = codec;
360 different_bitrates.params[kCodecParamMinBitrate] = "99";
361 different_bitrates.params[kCodecParamMaxBitrate] = "100";
362 EXPECT_TRUE(different_bitrates.ValidateCodecFormat());
363}
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -0700364
magjed68979ab2016-10-06 02:15:49 -0700365TEST(CodecTest, TestToCodecParameters) {
perkj26752742016-10-24 01:21:16 -0700366 const VideoCodec v(96, "V");
Taylor Brandstetterdb0cd9e2016-05-16 11:40:30 -0700367 webrtc::RtpCodecParameters codec_params_1 = v.ToCodecParameters();
368 EXPECT_EQ(96, codec_params_1.payload_type);
369 EXPECT_EQ("V", codec_params_1.mime_type);
370 EXPECT_EQ(cricket::kVideoCodecClockrate, codec_params_1.clock_rate);
371 EXPECT_EQ(1, codec_params_1.channels);
372
373 const AudioCodec a(97, "A", 44100, 20000, 2);
374 webrtc::RtpCodecParameters codec_params_2 = a.ToCodecParameters();
375 EXPECT_EQ(97, codec_params_2.payload_type);
376 EXPECT_EQ("A", codec_params_2.mime_type);
377 EXPECT_EQ(44100, codec_params_2.clock_rate);
378 EXPECT_EQ(2, codec_params_2.channels);
379}