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

Side by Side Diff: webrtc/common_video/h264/profile_level_id_unittest.cc

Issue 2483173002: Negotiate H264 profiles in SDP (Closed)
Patch Set: Extract IsSameH264Profile and don't check payload type in FindMatchingCodec Created 4 years, 1 month 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/common_video/h264/profile_level_id.cc ('k') | webrtc/media/base/codec.h » ('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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 TEST(H264ProfileLevelId, TestParseSdpProfileLevelIdInvalid) { 145 TEST(H264ProfileLevelId, TestParseSdpProfileLevelIdInvalid) {
146 CodecParameterMap params; 146 CodecParameterMap params;
147 params["profile-level-id"] = "foobar"; 147 params["profile-level-id"] = "foobar";
148 EXPECT_FALSE(ParseSdpProfileLevelId(params)); 148 EXPECT_FALSE(ParseSdpProfileLevelId(params));
149 } 149 }
150 150
151 TEST(H264ProfileLevelId, TestGenerateProfileLevelIdForAnswerEmpty) { 151 TEST(H264ProfileLevelId, TestGenerateProfileLevelIdForAnswerEmpty) {
152 CodecParameterMap answer_params; 152 CodecParameterMap answer_params;
153 GenerateProfileLevelIdForAnswer(CodecParameterMap(), CodecParameterMap(), 153 GenerateProfileLevelIdForAnswer(CodecParameterMap(), CodecParameterMap(),
154 &answer_params); 154 &answer_params);
155 EXPECT_EQ("42e01f", answer_params["profile-level-id"]); 155 EXPECT_TRUE(answer_params.empty());
156 } 156 }
157 157
158 TEST(H264ProfileLevelId, 158 TEST(H264ProfileLevelId,
159 TestGenerateProfileLevelIdForAnswerLevelSymmetryCapped) { 159 TestGenerateProfileLevelIdForAnswerLevelSymmetryCapped) {
160 CodecParameterMap low_level; 160 CodecParameterMap low_level;
161 low_level["profile-level-id"] = "42e015"; 161 low_level["profile-level-id"] = "42e015";
162 CodecParameterMap high_level; 162 CodecParameterMap high_level;
163 high_level["profile-level-id"] = "42e01f"; 163 high_level["profile-level-id"] = "42e01f";
164 164
165 // Level asymmetry is not allowed; test that answer level is the lower of the 165 // Level asymmetry is not allowed; test that answer level is the lower of the
(...skipping 21 matching lines...) Expand all
187 remote_params["level-asymmetry-allowed"] = "1"; 187 remote_params["level-asymmetry-allowed"] = "1";
188 CodecParameterMap answer_params; 188 CodecParameterMap answer_params;
189 GenerateProfileLevelIdForAnswer(local_params, remote_params, &answer_params); 189 GenerateProfileLevelIdForAnswer(local_params, remote_params, &answer_params);
190 // When level asymmetry is allowed, we can answer a higher level than what was 190 // When level asymmetry is allowed, we can answer a higher level than what was
191 // offered. 191 // offered.
192 EXPECT_EQ("42e01f", answer_params["profile-level-id"]); 192 EXPECT_EQ("42e01f", answer_params["profile-level-id"]);
193 } 193 }
194 194
195 } // namespace H264 195 } // namespace H264
196 } // namespace webrtc 196 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_video/h264/profile_level_id.cc ('k') | webrtc/media/base/codec.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698