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

Side by Side Diff: talk/media/webrtc/webrtcvideoengine2_unittest.cc

Issue 1665803003: Remove dead code from WebRtcVideoEngine2. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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 | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | no next file » | 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 * libjingle 2 * libjingle
3 * Copyright 2004 Google Inc. 3 * Copyright 2004 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // initialized when the constructor is called. 158 // initialized when the constructor is called.
159 rtc::scoped_ptr<webrtc::Call> call_; 159 rtc::scoped_ptr<webrtc::Call> call_;
160 WebRtcVoiceEngine voice_engine_; 160 WebRtcVoiceEngine voice_engine_;
161 WebRtcVideoEngine2 engine_; 161 WebRtcVideoEngine2 engine_;
162 VideoCodec default_codec_; 162 VideoCodec default_codec_;
163 VideoCodec default_red_codec_; 163 VideoCodec default_red_codec_;
164 VideoCodec default_ulpfec_codec_; 164 VideoCodec default_ulpfec_codec_;
165 std::map<int, int> default_apt_rtx_types_; 165 std::map<int, int> default_apt_rtx_types_;
166 }; 166 };
167 167
168 TEST_F(WebRtcVideoEngine2Test, FindCodec) {
169 const std::vector<cricket::VideoCodec>& c = engine_.codecs();
170 EXPECT_EQ(cricket::DefaultVideoCodecList().size(), c.size());
171
172 cricket::VideoCodec vp8(104, "VP8", 320, 200, 30, 0);
173 EXPECT_TRUE(engine_.FindCodec(vp8));
174
175 cricket::VideoCodec vp8_ci(104, "vp8", 320, 200, 30, 0);
176 EXPECT_TRUE(engine_.FindCodec(vp8));
177
178 cricket::VideoCodec vp8_diff_fr_diff_pref(104, "VP8", 320, 200, 50, 50);
179 EXPECT_TRUE(engine_.FindCodec(vp8_diff_fr_diff_pref));
180
181 cricket::VideoCodec vp8_diff_id(95, "VP8", 320, 200, 30, 0);
182 EXPECT_FALSE(engine_.FindCodec(vp8_diff_id));
183 vp8_diff_id.id = 97;
184 EXPECT_TRUE(engine_.FindCodec(vp8_diff_id));
185
186 // FindCodec ignores the codec size.
187 // Test that FindCodec can accept uncommon codec size.
188 cricket::VideoCodec vp8_diff_res(104, "VP8", 320, 111, 30, 0);
189 EXPECT_TRUE(engine_.FindCodec(vp8_diff_res));
190
191 // PeerConnection doesn't negotiate the resolution at this point.
192 // Test that FindCodec can handle the case when width/height is 0.
193 cricket::VideoCodec vp8_zero_res(104, "VP8", 0, 0, 30, 0);
194 EXPECT_TRUE(engine_.FindCodec(vp8_zero_res));
195
196 cricket::VideoCodec red(101, "RED", 0, 0, 30, 0);
197 EXPECT_TRUE(engine_.FindCodec(red));
198
199 cricket::VideoCodec red_ci(101, "red", 0, 0, 30, 0);
200 EXPECT_TRUE(engine_.FindCodec(red));
201
202 cricket::VideoCodec fec(102, "ULPFEC", 0, 0, 30, 0);
203 EXPECT_TRUE(engine_.FindCodec(fec));
204
205 cricket::VideoCodec fec_ci(102, "ulpfec", 0, 0, 30, 0);
206 EXPECT_TRUE(engine_.FindCodec(fec));
207
208 cricket::VideoCodec rtx(96, "rtx", 0, 0, 30, 0);
209 EXPECT_TRUE(engine_.FindCodec(rtx));
210 }
211
212 TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) { 168 TEST_F(WebRtcVideoEngine2Test, DefaultRtxCodecHasAssociatedPayloadTypeSet) {
213 std::vector<VideoCodec> engine_codecs = engine_.codecs(); 169 std::vector<VideoCodec> engine_codecs = engine_.codecs();
214 for (size_t i = 0; i < engine_codecs.size(); ++i) { 170 for (size_t i = 0; i < engine_codecs.size(); ++i) {
215 if (engine_codecs[i].name != kRtxCodecName) 171 if (engine_codecs[i].name != kRtxCodecName)
216 continue; 172 continue;
217 int associated_payload_type; 173 int associated_payload_type;
218 EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType, 174 EXPECT_TRUE(engine_codecs[i].GetParam(kCodecParamAssociatedPayloadType,
219 &associated_payload_type)); 175 &associated_payload_type));
220 EXPECT_EQ(default_codec_.id, associated_payload_type); 176 EXPECT_EQ(default_codec_.id, associated_payload_type);
221 return; 177 return;
(...skipping 2872 matching lines...) Expand 10 before | Expand all | Expand 10 after
3094 // Test that we normalize send codec format size in simulcast. 3050 // Test that we normalize send codec format size in simulcast.
3095 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) { 3051 TEST_F(WebRtcVideoChannel2SimulcastTest, SetSendCodecsWithOddSizeInSimulcast) {
3096 cricket::VideoCodec codec(kVp8Codec270p); 3052 cricket::VideoCodec codec(kVp8Codec270p);
3097 codec.width += 1; 3053 codec.width += 1;
3098 codec.height += 1; 3054 codec.height += 1;
3099 VerifySimulcastSettings(codec, 2, 2); 3055 VerifySimulcastSettings(codec, 2, 2);
3100 } 3056 }
3101 } // namespace cricket 3057 } // namespace cricket
3102 3058
3103 #endif // HAVE_WEBRTC_VIDEO 3059 #endif // HAVE_WEBRTC_VIDEO
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvideoengine2.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698