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}
diff --git a/modules/video_coding/jitter_buffer_unittest.cc b/modules/video_coding/jitter_buffer_unittest.cc
index 71c17ea..45b2c2d 100644
--- a/modules/video_coding/jitter_buffer_unittest.cc
+++ b/modules/video_coding/jitter_buffer_unittest.cc
@@ -242,7 +242,7 @@
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 @@
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 @@
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_;
diff --git a/modules/video_coding/packet.cc b/modules/video_coding/packet.cc
index 7db566a..e4e1ca4 100644
--- a/modules/video_coding/packet.cc
+++ b/modules/video_coding/packet.cc
@@ -50,20 +50,21 @@
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};
}
diff --git a/modules/video_coding/video_receiver_unittest.cc b/modules/video_coding/video_receiver_unittest.cc
index 2855f7a..a95b150 100644
--- a/modules/video_coding/video_receiver_unittest.cc
+++ b/modules/video_coding/video_receiver_unittest.cc
@@ -106,7 +106,7 @@
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 @@
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 @@
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 @@
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 @@
// 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);