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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc

Issue 2946413002: Report timing frames info in GetStats. (Closed)
Patch Set: rebase Created 3 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 TEST_P(RtpSenderTestWithoutPacer, WritesTimestampToTimingExtension) { 466 TEST_P(RtpSenderTestWithoutPacer, WritesTimestampToTimingExtension) {
467 rtp_sender_->SetStorePacketsStatus(true, 10); 467 rtp_sender_->SetStorePacketsStatus(true, 10);
468 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( 468 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(
469 kRtpExtensionVideoTiming, kVideoTimingExtensionId)); 469 kRtpExtensionVideoTiming, kVideoTimingExtensionId));
470 int64_t capture_time_ms = fake_clock_.TimeInMilliseconds(); 470 int64_t capture_time_ms = fake_clock_.TimeInMilliseconds();
471 auto packet = rtp_sender_->AllocatePacket(); 471 auto packet = rtp_sender_->AllocatePacket();
472 packet->SetPayloadType(kPayload); 472 packet->SetPayloadType(kPayload);
473 packet->SetMarker(true); 473 packet->SetMarker(true);
474 packet->SetTimestamp(kTimestamp); 474 packet->SetTimestamp(kTimestamp);
475 packet->set_capture_time_ms(capture_time_ms); 475 packet->set_capture_time_ms(capture_time_ms);
476 const VideoTiming kVideoTiming = {0u, 0u, 0u, 0u, 0u, 0u, true}; 476 const VideoSendTiming kVideoTiming = {0u, 0u, 0u, 0u, 0u, 0u, true};
477 packet->SetExtension<VideoTimingExtension>(kVideoTiming); 477 packet->SetExtension<VideoTimingExtension>(kVideoTiming);
478 EXPECT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get())); 478 EXPECT_TRUE(rtp_sender_->AssignSequenceNumber(packet.get()));
479 size_t packet_size = packet->size(); 479 size_t packet_size = packet->size();
480 webrtc::RTPHeader rtp_header; 480 webrtc::RTPHeader rtp_header;
481 481
482 packet->GetHeader(&rtp_header); 482 packet->GetHeader(&rtp_header);
483 483
484 const int kStoredTimeInMs = 100; 484 const int kStoredTimeInMs = 100;
485 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs); 485 fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs);
486 486
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after
1571 1571
1572 RTPVideoHeader hdr = {0}; 1572 RTPVideoHeader hdr = {0};
1573 hdr.video_timing.is_timing_frame = true; 1573 hdr.video_timing.is_timing_frame = true;
1574 hdr.video_timing.encode_start_delta_ms = kEncodeStartDeltaMs; 1574 hdr.video_timing.encode_start_delta_ms = kEncodeStartDeltaMs;
1575 hdr.video_timing.encode_finish_delta_ms = kEncodeFinishDeltaMs; 1575 hdr.video_timing.encode_finish_delta_ms = kEncodeFinishDeltaMs;
1576 1576
1577 fake_clock_.AdvanceTimeMilliseconds(kPacketizationTimeMs); 1577 fake_clock_.AdvanceTimeMilliseconds(kPacketizationTimeMs);
1578 rtp_sender_video_->SendVideo(kRtpVideoGeneric, kVideoFrameKey, kPayload, 1578 rtp_sender_video_->SendVideo(kRtpVideoGeneric, kVideoFrameKey, kPayload,
1579 kTimestamp, kCaptureTimestamp, kFrame, 1579 kTimestamp, kCaptureTimestamp, kFrame,
1580 sizeof(kFrame), nullptr, &hdr); 1580 sizeof(kFrame), nullptr, &hdr);
1581 VideoTiming timing; 1581 VideoSendTiming timing;
1582 EXPECT_TRUE(transport_.last_sent_packet().GetExtension<VideoTimingExtension>( 1582 EXPECT_TRUE(transport_.last_sent_packet().GetExtension<VideoTimingExtension>(
1583 &timing)); 1583 &timing));
1584 EXPECT_EQ(kPacketizationTimeMs, timing.packetization_finish_delta_ms); 1584 EXPECT_EQ(kPacketizationTimeMs, timing.packetization_finish_delta_ms);
1585 EXPECT_EQ(kEncodeStartDeltaMs, timing.encode_start_delta_ms); 1585 EXPECT_EQ(kEncodeStartDeltaMs, timing.encode_start_delta_ms);
1586 EXPECT_EQ(kEncodeFinishDeltaMs, timing.encode_finish_delta_ms); 1586 EXPECT_EQ(kEncodeFinishDeltaMs, timing.encode_finish_delta_ms);
1587 } 1587 }
1588 1588
1589 TEST_P(RtpSenderVideoTest, DeltaFrameHasCVOWhenChanged) { 1589 TEST_P(RtpSenderVideoTest, DeltaFrameHasCVOWhenChanged) {
1590 uint8_t kFrame[kMaxPacketLength]; 1590 uint8_t kFrame[kMaxPacketLength];
1591 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension( 1591 EXPECT_EQ(0, rtp_sender_->RegisterRtpHeaderExtension(
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
1717 INSTANTIATE_TEST_CASE_P(WithAndWithoutOverhead, 1717 INSTANTIATE_TEST_CASE_P(WithAndWithoutOverhead,
1718 RtpSenderTestWithoutPacer, 1718 RtpSenderTestWithoutPacer,
1719 ::testing::Bool()); 1719 ::testing::Bool());
1720 INSTANTIATE_TEST_CASE_P(WithAndWithoutOverhead, 1720 INSTANTIATE_TEST_CASE_P(WithAndWithoutOverhead,
1721 RtpSenderVideoTest, 1721 RtpSenderVideoTest,
1722 ::testing::Bool()); 1722 ::testing::Bool());
1723 INSTANTIATE_TEST_CASE_P(WithAndWithoutOverhead, 1723 INSTANTIATE_TEST_CASE_P(WithAndWithoutOverhead,
1724 RtpSenderAudioTest, 1724 RtpSenderAudioTest,
1725 ::testing::Bool()); 1725 ::testing::Bool());
1726 } // namespace webrtc 1726 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_packet_to_send.h ('k') | webrtc/modules/video_coding/frame_buffer2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698