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

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

Issue 2947133002: Fix timing frames and FEC conflict (Closed)
Patch Set: Fix typo Created 3 years, 6 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/modules/rtp_rtcp/source/rtp_sender_video.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 * 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> // max 10 #include <algorithm> // max
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 289
290 void PerformTest() override { 290 void PerformTest() override {
291 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; 291 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet.";
292 } 292 }
293 } test; 293 } test;
294 294
295 RunBaseTest(&test); 295 RunBaseTest(&test);
296 } 296 }
297 297
298 TEST_F(VideoSendStreamTest, SupportsVideoContentType) { 298 TEST_F(VideoSendStreamTest, SupportsVideoContentType) {
299 class VideoRotationObserver : public test::SendTest { 299 class VideoContentTypeObserver : public test::SendTest {
300 public: 300 public:
301 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { 301 VideoContentTypeObserver() : SendTest(kDefaultTimeoutMs) {
302 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( 302 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
303 kRtpExtensionVideoContentType, test::kVideoContentTypeExtensionId)); 303 kRtpExtensionVideoContentType, test::kVideoContentTypeExtensionId));
304 } 304 }
305 305
306 Action OnSendRtp(const uint8_t* packet, size_t length) override { 306 Action OnSendRtp(const uint8_t* packet, size_t length) override {
307 RTPHeader header; 307 RTPHeader header;
308 EXPECT_TRUE(parser_->Parse(packet, length, &header)); 308 EXPECT_TRUE(parser_->Parse(packet, length, &header));
309 // Only the last packet of the frame must have extension. 309 // Only the last packet of the frame must have extension.
310 if (!header.markerBit) 310 if (!header.markerBit)
311 return SEND_PACKET; 311 return SEND_PACKET;
(...skipping 19 matching lines...) Expand all
331 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet."; 331 EXPECT_TRUE(Wait()) << "Timed out while waiting for single RTP packet.";
332 } 332 }
333 } test; 333 } test;
334 334
335 test::ScopedFieldTrials override_field_trials( 335 test::ScopedFieldTrials override_field_trials(
336 "WebRTC-VideoContentTypeExtension/Enabled/"); 336 "WebRTC-VideoContentTypeExtension/Enabled/");
337 RunBaseTest(&test); 337 RunBaseTest(&test);
338 } 338 }
339 339
340 TEST_F(VideoSendStreamTest, SupportsVideoTimingFrames) { 340 TEST_F(VideoSendStreamTest, SupportsVideoTimingFrames) {
341 class VideoRotationObserver : public test::SendTest { 341 class VideoTimingObserver : public test::SendTest {
342 public: 342 public:
343 VideoRotationObserver() : SendTest(kDefaultTimeoutMs) { 343 VideoTimingObserver() : SendTest(kDefaultTimeoutMs) {
344 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( 344 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension(
345 kRtpExtensionVideoTiming, test::kVideoTimingExtensionId)); 345 kRtpExtensionVideoTiming, test::kVideoTimingExtensionId));
346 } 346 }
347 347
348 Action OnSendRtp(const uint8_t* packet, size_t length) override { 348 Action OnSendRtp(const uint8_t* packet, size_t length) override {
349 RTPHeader header; 349 RTPHeader header;
350 EXPECT_TRUE(parser_->Parse(packet, length, &header)); 350 EXPECT_TRUE(parser_->Parse(packet, length, &header));
351 if (header.extension.has_video_timing) { 351 // Only the last packet of the frame must have extension.
352 observation_complete_.Set(); 352 if (!header.markerBit)
353 } 353 return SEND_PACKET;
354 EXPECT_TRUE(header.extension.has_video_timing);
355 observation_complete_.Set();
354 return SEND_PACKET; 356 return SEND_PACKET;
355 } 357 }
356 358
357 void ModifyVideoConfigs( 359 void ModifyVideoConfigs(
358 VideoSendStream::Config* send_config, 360 VideoSendStream::Config* send_config,
359 std::vector<VideoReceiveStream::Config>* receive_configs, 361 std::vector<VideoReceiveStream::Config>* receive_configs,
360 VideoEncoderConfig* encoder_config) override { 362 VideoEncoderConfig* encoder_config) override {
361 send_config->rtp.extensions.clear(); 363 send_config->rtp.extensions.clear();
362 send_config->rtp.extensions.push_back(RtpExtension( 364 send_config->rtp.extensions.push_back(RtpExtension(
363 RtpExtension::kVideoTimingUri, test::kVideoTimingExtensionId)); 365 RtpExtension::kVideoTimingUri, test::kVideoTimingExtensionId));
(...skipping 3004 matching lines...) Expand 10 before | Expand all | Expand 10 after
3368 rtc::CriticalSection crit_; 3370 rtc::CriticalSection crit_;
3369 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_); 3371 uint32_t max_bitrate_bps_ GUARDED_BY(&crit_);
3370 bool first_packet_sent_ GUARDED_BY(&crit_); 3372 bool first_packet_sent_ GUARDED_BY(&crit_);
3371 rtc::Event bitrate_changed_event_; 3373 rtc::Event bitrate_changed_event_;
3372 } test; 3374 } test;
3373 3375
3374 RunBaseTest(&test); 3376 RunBaseTest(&test);
3375 } 3377 }
3376 3378
3377 } // namespace webrtc 3379 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_sender_video.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698