Move frame_type member from RtpDepacketizer::ParsedPayload to RTPVideoHeader

The latter is also a member of the former. This cleanup is also
a preparation for dropping WebRtcRTPHeader::frameType (or deleting
WebRtcRTPHeader right away), now that it's a video-specific member.


Tbr: kwiberg@webrtc.org # Comment change in modules/include/
Bug: None
Change-Id: I5c1f3f981f0d750713fc9b9b145278150fe32b5d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133024
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27740}
diff --git a/modules/video_coding/jitter_buffer_unittest.cc b/modules/video_coding/jitter_buffer_unittest.cc
index 221701b..53eba63 100644
--- a/modules/video_coding/jitter_buffer_unittest.cc
+++ b/modules/video_coding/jitter_buffer_unittest.cc
@@ -65,8 +65,8 @@
     rtp_header.markerBit = true;
     video_header.codec = kVideoCodecGeneric;
     video_header.is_first_packet_in_frame = true;
+    video_header.frame_type = VideoFrameType::kVideoFrameDelta;
     packet_.reset(new VCMPacket(data_, size_, rtp_header, video_header,
-                                VideoFrameType::kVideoFrameDelta,
                                 /*ntp_time_ms=*/0));
   }
 
@@ -241,7 +241,7 @@
 
 TEST_F(TestBasicJitterBuffer, SinglePacketFrame) {
   // Always start with a complete key frame when not allowing errors.
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->timestamp += 123 * 90;
@@ -257,7 +257,7 @@
 }
 
 TEST_F(TestBasicJitterBuffer, DualPacketFrame) {
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
 
@@ -284,7 +284,7 @@
 }
 
 TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) {
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
 
@@ -328,7 +328,7 @@
 
 TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) {
   // Always start with a complete key frame.
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
 
@@ -342,7 +342,7 @@
   ++seq_num_;
   packet_->seqNum = seq_num_;
   packet_->markerBit = false;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->timestamp += 33 * 90;
 
   EXPECT_EQ(kIncomplete,
@@ -385,7 +385,7 @@
 TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) {
   // Insert the "first" packet last.
   seq_num_ += 100;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = false;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -430,7 +430,7 @@
 }
 
 TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) {
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
 
@@ -456,7 +456,7 @@
 
   seq_num_ -= 3;
   timestamp_ -= 33 * 90;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->seqNum = seq_num_;
@@ -491,7 +491,7 @@
 
 TEST_F(TestBasicJitterBuffer, TestReorderingWithPadding) {
   jitter_buffer_->SetNackSettings(kMaxNumberOfFrames, kMaxNumberOfFrames, 0);
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
 
@@ -505,7 +505,7 @@
 
   // Now send in a complete delta frame (Frame C), but with a sequence number
   // gap. No pic index either, so no temporal scalability cheating :)
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   // Leave a gap of 2 sequence numbers and two frames.
   packet_->seqNum = seq_num_ + 3;
   packet_->timestamp = timestamp_ + (66 * 90);
@@ -540,8 +540,9 @@
   rtp_header.timestamp = timestamp_ + (33 * 90);
   rtp_header.markerBit = false;
   video_header.codec = kVideoCodecGeneric;
+  video_header.frame_type = VideoFrameType::kEmptyFrame;
   VCMPacket empty_packet(data_, 0, rtp_header, video_header,
-                         VideoFrameType::kEmptyFrame, /*ntp_time_ms=*/0);
+                         /*ntp_time_ms=*/0);
   EXPECT_EQ(kOldPacket,
             jitter_buffer_->InsertPacket(empty_packet, &retransmitted));
   empty_packet.seqNum += 1;
@@ -555,7 +556,7 @@
 }
 
 TEST_F(TestBasicJitterBuffer, DuplicatePackets) {
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->seqNum = seq_num_;
@@ -598,7 +599,7 @@
 }
 
 TEST_F(TestBasicJitterBuffer, DuplicatePreviousDeltaFramePacket) {
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -621,7 +622,7 @@
   for (uint16_t i = 1; i <= 3; ++i) {
     packet_->seqNum = seq_num_ + i;
     packet_->timestamp = timestamp_ + (i * 33) * 90;
-    packet_->frameType = VideoFrameType::kVideoFrameDelta;
+    packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
     EXPECT_EQ(kCompleteSession,
               jitter_buffer_->InsertPacket(*packet_, &retransmitted));
     EXPECT_EQ(i + 1, jitter_buffer_->num_packets());
@@ -674,7 +675,7 @@
 
   packet_->seqNum = 65485;
   packet_->timestamp = 1000;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   vp9_header.picture_id = 5;
   vp9_header.tl0_pic_idx = 200;
   vp9_header.temporal_idx = 0;
@@ -686,7 +687,7 @@
   // Insert next temporal layer 0.
   packet_->seqNum = 65489;
   packet_->timestamp = 13000;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   vp9_header.picture_id = 9;
   vp9_header.tl0_pic_idx = 201;
   vp9_header.temporal_idx = 0;
@@ -729,7 +730,7 @@
 
   packet_->seqNum = 65486;
   packet_->timestamp = 6000;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   vp9_header.picture_id = 6;
   vp9_header.temporal_idx = 2;
   vp9_header.temporal_up_switch = true;
@@ -737,7 +738,7 @@
 
   packet_->seqNum = 65487;
   packet_->timestamp = 9000;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   vp9_header.picture_id = 7;
   vp9_header.temporal_idx = 1;
   vp9_header.temporal_up_switch = true;
@@ -746,7 +747,7 @@
   // Insert first frame with SS data.
   packet_->seqNum = 65485;
   packet_->timestamp = 3000;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.width = 352;
   packet_->video_header.height = 288;
   vp9_header.picture_id = 5;
@@ -806,7 +807,7 @@
   packet_->markerBit = false;
   packet_->seqNum = 65486;
   packet_->timestamp = 6000;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   vp9_header.spatial_idx = 0;
   vp9_header.picture_id = 6;
   vp9_header.temporal_idx = 1;
@@ -816,7 +817,7 @@
   packet_->video_header.is_first_packet_in_frame = false;
   packet_->markerBit = true;
   packet_->seqNum = 65487;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   vp9_header.spatial_idx = 1;
   vp9_header.picture_id = 6;
   vp9_header.temporal_idx = 1;
@@ -827,7 +828,7 @@
   packet_->markerBit = true;
   packet_->seqNum = 65485;
   packet_->timestamp = 3000;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   vp9_header.spatial_idx = 1;
   vp9_header.picture_id = 5;
   vp9_header.temporal_idx = 0;
@@ -838,7 +839,7 @@
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->seqNum = 65484;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.width = 352;
   packet_->video_header.height = 288;
   vp9_header.spatial_idx = 0;
@@ -867,7 +868,7 @@
 }
 
 TEST_F(TestBasicJitterBuffer, H264InsertStartCode) {
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->seqNum = seq_num_;
@@ -901,7 +902,7 @@
   auto& h264_header =
       packet_->video_header.video_type_header.emplace<RTPVideoHeaderH264>();
   packet_->timestamp = timestamp_;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->video_header.codec = kVideoCodecH264;
@@ -920,7 +921,7 @@
   packet_->timestamp = timestamp_;
   ++seq_num_;
   packet_->seqNum = seq_num_;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->video_header.codec = kVideoCodecH264;
@@ -938,7 +939,7 @@
 
   ++seq_num_;
   packet_->seqNum = seq_num_;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = false;
   packet_->markerBit = true;
   packet_->video_header.codec = kVideoCodecH264;
@@ -959,7 +960,7 @@
   packet_->timestamp = timestamp_;
   ++seq_num_;
   packet_->seqNum = seq_num_;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->video_header.codec = kVideoCodecH264;
@@ -978,7 +979,7 @@
 
 TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) {
   seq_num_ = 0xfff0;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->seqNum = seq_num_;
@@ -1028,7 +1029,7 @@
 TEST_F(TestBasicJitterBuffer, PacketReorderingReverseWithNegSeqNumWrap) {
   // Insert "first" packet last seqnum.
   seq_num_ = 10;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = false;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -1081,7 +1082,7 @@
   //  t = 3000     t = 2000
   seq_num_ = 2;
   timestamp_ = 3000;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->timestamp = timestamp_;
@@ -1099,7 +1100,7 @@
 
   seq_num_--;
   timestamp_ = 2000;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -1116,7 +1117,7 @@
 
   seq_num_ = 2;
   timestamp_ = 3000;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -1137,7 +1138,7 @@
 
   seq_num_--;
   timestamp_ = 0xffffff00;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -1154,7 +1155,7 @@
   //  t = 0xffffff00        t = 33*90
 
   timestamp_ = 0xffffff00;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->seqNum = seq_num_;
@@ -1181,7 +1182,7 @@
 
   seq_num_++;
   timestamp_ += 33 * 90;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = false;
   packet_->seqNum = seq_num_;
@@ -1214,7 +1215,7 @@
   // t = 0xffffff00    t = 2700
 
   timestamp_ = 0xffffff00;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->timestamp = timestamp_;
@@ -1227,7 +1228,7 @@
   // Insert next frame.
   seq_num_++;
   timestamp_ = 2700;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -1257,7 +1258,7 @@
 
   seq_num_ = 2;
   timestamp_ = 2700;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -1270,7 +1271,7 @@
   // Insert second frame
   seq_num_--;
   timestamp_ = 0xffffff00;
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   packet_->seqNum = seq_num_;
@@ -1355,7 +1356,7 @@
 
     if (loop == 50) {
       first_key_frame_timestamp = packet_->timestamp;
-      packet_->frameType = VideoFrameType::kVideoFrameKey;
+      packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
     }
 
     // Insert frame.
@@ -1399,7 +1400,7 @@
     packet_->markerBit = false;
     packet_->seqNum = seq_num_;
     packet_->timestamp = timestamp_;
-    packet_->frameType = VideoFrameType::kEmptyFrame;
+    packet_->video_header.frame_type = VideoFrameType::kEmptyFrame;
 
     EXPECT_EQ(kNoError, jitter_buffer_->InsertPacket(*packet_, &retransmitted));
   }
@@ -1411,7 +1412,7 @@
   // timestamp.
   // Start with a complete key frame - insert and decode.
   jitter_buffer_->SetNackSettings(kMaxNumberOfFrames, kMaxNumberOfFrames, 0);
-  packet_->frameType = VideoFrameType::kVideoFrameKey;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameKey;
   packet_->video_header.is_first_packet_in_frame = true;
   packet_->markerBit = true;
   bool retransmitted = false;
@@ -1424,7 +1425,7 @@
 
   packet_->seqNum += 2;
   packet_->timestamp += 33 * 90;
-  packet_->frameType = VideoFrameType::kVideoFrameDelta;
+  packet_->video_header.frame_type = VideoFrameType::kVideoFrameDelta;
   packet_->video_header.is_first_packet_in_frame = false;
   packet_->markerBit = false;