Add ParsedPayload::video_header() accessor.

Preparation CL to remove RTPTypeHeader.

Bug: none
Change-Id: I695acf20082b94744a2f6c7692f1b2128932cd79
Reviewed-on: https://webrtc-review.googlesource.com/86132
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23835}
This commit is contained in:
philipel
2018-07-02 14:41:58 +02:00
committed by Commit Bot
parent d92288f5ba
commit cb96ad8f0e
17 changed files with 206 additions and 196 deletions

View File

@ -242,7 +242,7 @@ class TestBasicJitterBuffer : public ::testing::TestWithParam<std::string>,
rtpHeader.header.timestamp = timestamp_;
rtpHeader.header.markerBit = true;
rtpHeader.frameType = kVideoFrameDelta;
rtpHeader.type.Video.codec = kVideoCodecUnknown;
rtpHeader.video_header().codec = kVideoCodecUnknown;
packet_.reset(new VCMPacket(data_, size_, rtpHeader));
}
@ -800,7 +800,7 @@ TEST_F(TestBasicJitterBuffer, TestReorderingWithPadding) {
rtpHeader.header.sequenceNumber = seq_num_ + 2;
rtpHeader.header.timestamp = timestamp_ + (33 * 90);
rtpHeader.header.markerBit = false;
rtpHeader.type.Video.codec = kVideoCodecUnknown;
rtpHeader.video_header().codec = kVideoCodecUnknown;
VCMPacket empty_packet(data_, 0, rtpHeader);
EXPECT_EQ(kOldPacket,
jitter_buffer_->InsertPacket(empty_packet, &retransmitted));
@ -2164,7 +2164,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
timestamp_ += 33 * 90;
WebRtcRTPHeader rtpHeader;
memset(&rtpHeader, 0, sizeof(rtpHeader));
rtpHeader.type.Video.codec = kVideoCodecUnknown;
rtpHeader.video_header().codec = kVideoCodecUnknown;
VCMPacket emptypacket(data_, 0, rtpHeader);
emptypacket.seqNum = seq_num_;
emptypacket.timestamp = timestamp_;

View File

@ -50,20 +50,21 @@ VCMPacket::VCMPacket(const uint8_t* ptr,
timesNacked(-1),
frameType(rtpHeader.frameType),
codec(kVideoCodecUnknown),
is_first_packet_in_frame(rtpHeader.type.Video.is_first_packet_in_frame),
is_first_packet_in_frame(
rtpHeader.video_header().is_first_packet_in_frame),
completeNALU(kNaluComplete),
insertStartCode(false),
width(rtpHeader.type.Video.width),
height(rtpHeader.type.Video.height),
video_header(rtpHeader.type.Video) {
CopyCodecSpecifics(rtpHeader.type.Video);
width(rtpHeader.video_header().width),
height(rtpHeader.video_header().height),
video_header(rtpHeader.video_header()) {
CopyCodecSpecifics(rtpHeader.video_header());
if (markerBit) {
video_header.rotation = rtpHeader.type.Video.rotation;
video_header.rotation = rtpHeader.video_header().rotation;
}
// Playout decisions are made entirely based on first packet in a frame.
if (is_first_packet_in_frame) {
video_header.playout_delay = rtpHeader.type.Video.playout_delay;
video_header.playout_delay = rtpHeader.video_header().playout_delay;
} else {
video_header.playout_delay = {-1, -1};
}

View File

@ -106,7 +106,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyFrames) {
header.header.payloadType = kUnusedPayloadType;
header.header.ssrc = 1;
header.header.headerLength = 12;
header.type.Video.codec = kVideoCodecVP8;
header.video_header().codec = kVideoCodecVP8;
for (int i = 0; i < 10; ++i) {
EXPECT_CALL(packet_request_callback_, ResendPackets(_, _)).Times(0);
InsertAndVerifyPaddingFrame(payload, &header);
@ -130,17 +130,17 @@ TEST_F(TestVideoReceiver, PaddingOnlyFramesWithLosses) {
header.header.payloadType = kUnusedPayloadType;
header.header.ssrc = 1;
header.header.headerLength = 12;
header.type.Video.codec = kVideoCodecVP8;
header.video_header().codec = kVideoCodecVP8;
// Insert one video frame to get one frame decoded.
header.frameType = kVideoFrameKey;
header.type.Video.is_first_packet_in_frame = true;
header.video_header().is_first_packet_in_frame = true;
header.header.markerBit = true;
InsertAndVerifyDecodableFrame(payload, kFrameSize, &header);
clock_.AdvanceTimeMilliseconds(33);
header.header.timestamp += 3000;
header.frameType = kEmptyFrame;
header.type.Video.is_first_packet_in_frame = false;
header.video_header().is_first_packet_in_frame = false;
header.header.markerBit = false;
// Insert padding frames.
for (int i = 0; i < 10; ++i) {
@ -176,15 +176,15 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) {
WebRtcRTPHeader header;
memset(&header, 0, sizeof(header));
header.frameType = kEmptyFrame;
header.type.Video.is_first_packet_in_frame = false;
header.video_header().is_first_packet_in_frame = false;
header.header.markerBit = false;
header.header.paddingLength = kPaddingSize;
header.header.payloadType = kUnusedPayloadType;
header.header.ssrc = 1;
header.header.headerLength = 12;
header.type.Video.codec = kVideoCodecVP8;
header.type.Video.codecHeader.VP8.pictureId = -1;
header.type.Video.codecHeader.VP8.tl0PicIdx = -1;
header.video_header().codec = kVideoCodecVP8;
header.video_header().codecHeader.VP8.pictureId = -1;
header.video_header().codecHeader.VP8.tl0PicIdx = -1;
for (int i = 0; i < 3; ++i) {
// Insert 2 video frames.
for (int j = 0; j < 2; ++j) {
@ -192,7 +192,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) {
header.frameType = kVideoFrameKey;
else
header.frameType = kVideoFrameDelta;
header.type.Video.is_first_packet_in_frame = true;
header.video_header().is_first_packet_in_frame = true;
header.header.markerBit = true;
InsertAndVerifyDecodableFrame(payload, kFrameSize, &header);
clock_.AdvanceTimeMilliseconds(33);
@ -201,7 +201,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) {
// Insert 2 padding only frames.
header.frameType = kEmptyFrame;
header.type.Video.is_first_packet_in_frame = false;
header.video_header().is_first_packet_in_frame = false;
header.header.markerBit = false;
for (int j = 0; j < 2; ++j) {
// InsertAndVerifyPaddingFrame(payload, &header);