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

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 2558463002: Reland of H.264 packetization mode 0 (try 3) (Closed)
Patch Set: Lengthened timeout Created 4 years 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/video/BUILD.gn ('k') | webrtc/video/payload_router.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) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include <algorithm> 10 #include <algorithm>
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 } 307 }
308 308
309 class CodecObserver : public test::EndToEndTest, 309 class CodecObserver : public test::EndToEndTest,
310 public rtc::VideoSinkInterface<VideoFrame> { 310 public rtc::VideoSinkInterface<VideoFrame> {
311 public: 311 public:
312 CodecObserver(int no_frames_to_wait_for, 312 CodecObserver(int no_frames_to_wait_for,
313 VideoRotation rotation_to_test, 313 VideoRotation rotation_to_test,
314 const std::string& payload_name, 314 const std::string& payload_name,
315 webrtc::VideoEncoder* encoder, 315 webrtc::VideoEncoder* encoder,
316 webrtc::VideoDecoder* decoder) 316 webrtc::VideoDecoder* decoder)
317 : EndToEndTest(2 * webrtc::EndToEndTest::kDefaultTimeoutMs), 317 : EndToEndTest(4 * webrtc::EndToEndTest::kDefaultTimeoutMs),
318 // TODO(hta): This timeout (120 seconds) is excessive.
319 // https://bugs.webrtc.org/6830
318 no_frames_to_wait_for_(no_frames_to_wait_for), 320 no_frames_to_wait_for_(no_frames_to_wait_for),
319 expected_rotation_(rotation_to_test), 321 expected_rotation_(rotation_to_test),
320 payload_name_(payload_name), 322 payload_name_(payload_name),
321 encoder_(encoder), 323 encoder_(encoder),
322 decoder_(decoder), 324 decoder_(decoder),
323 frame_counter_(0) {} 325 frame_counter_(0) {}
324 326
325 void PerformTest() override { 327 void PerformTest() override {
326 EXPECT_TRUE(Wait()) 328 EXPECT_TRUE(Wait())
327 << "Timed out while waiting for enough frames to be decoded."; 329 << "Timed out while waiting for enough frames to be decoded.";
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 H264Decoder::Create()); 399 H264Decoder::Create());
398 RunBaseTest(&test); 400 RunBaseTest(&test);
399 } 401 }
400 402
401 TEST_P(EndToEndTest, SendsAndReceivesH264VideoRotation90) { 403 TEST_P(EndToEndTest, SendsAndReceivesH264VideoRotation90) {
402 CodecObserver test(5, kVideoRotation_90, "H264", 404 CodecObserver test(5, kVideoRotation_90, "H264",
403 H264Encoder::Create(cricket::VideoCodec("H264")), 405 H264Encoder::Create(cricket::VideoCodec("H264")),
404 H264Decoder::Create()); 406 H264Decoder::Create());
405 RunBaseTest(&test); 407 RunBaseTest(&test);
406 } 408 }
409
410 TEST_P(EndToEndTest, SendsAndReceivesH264PacketizationMode0) {
411 cricket::VideoCodec codec = cricket::VideoCodec("H264");
412 codec.SetParam(cricket::kH264FmtpPacketizationMode, "0");
413 CodecObserver test(500, kVideoRotation_0, "H264", H264Encoder::Create(codec),
414 H264Decoder::Create());
415 RunBaseTest(&test);
416 }
417
418 TEST_P(EndToEndTest, SendsAndReceivesH264PacketizationMode1) {
419 cricket::VideoCodec codec = cricket::VideoCodec("H264");
420 codec.SetParam(cricket::kH264FmtpPacketizationMode, "1");
421 CodecObserver test(500, kVideoRotation_0, "H264", H264Encoder::Create(codec),
422 H264Decoder::Create());
423 RunBaseTest(&test);
424 }
425
407 #endif // defined(WEBRTC_USE_H264) 426 #endif // defined(WEBRTC_USE_H264)
408 427
409 TEST_P(EndToEndTest, ReceiverUsesLocalSsrc) { 428 TEST_P(EndToEndTest, ReceiverUsesLocalSsrc) {
410 class SyncRtcpObserver : public test::EndToEndTest { 429 class SyncRtcpObserver : public test::EndToEndTest {
411 public: 430 public:
412 SyncRtcpObserver() : EndToEndTest(kDefaultTimeoutMs) {} 431 SyncRtcpObserver() : EndToEndTest(kDefaultTimeoutMs) {}
413 432
414 Action OnReceiveRtcp(const uint8_t* packet, size_t length) override { 433 Action OnReceiveRtcp(const uint8_t* packet, size_t length) override {
415 test::RtcpPacketParser parser; 434 test::RtcpPacketParser parser;
416 EXPECT_TRUE(parser.Parse(packet, length)); 435 EXPECT_TRUE(parser.Parse(packet, length));
(...skipping 3627 matching lines...) Expand 10 before | Expand all | Expand 10 after
4044 std::unique_ptr<VideoEncoder> encoder_; 4063 std::unique_ptr<VideoEncoder> encoder_;
4045 std::unique_ptr<VideoDecoder> decoder_; 4064 std::unique_ptr<VideoDecoder> decoder_;
4046 rtc::CriticalSection crit_; 4065 rtc::CriticalSection crit_;
4047 int recorded_frames_ GUARDED_BY(crit_); 4066 int recorded_frames_ GUARDED_BY(crit_);
4048 } test(this); 4067 } test(this);
4049 4068
4050 RunBaseTest(&test); 4069 RunBaseTest(&test);
4051 } 4070 }
4052 4071
4053 } // namespace webrtc 4072 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/BUILD.gn ('k') | webrtc/video/payload_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698