diff --git a/webrtc/modules/include/module_common_types.h b/webrtc/modules/include/module_common_types.h index 80c7b24732..2bdaeba683 100644 --- a/webrtc/modules/include/module_common_types.h +++ b/webrtc/modules/include/module_common_types.h @@ -58,7 +58,7 @@ struct RTPVideoHeader { PlayoutDelay playout_delay; - bool isFirstPacket; // first packet in frame + bool is_first_packet_in_frame; uint8_t simulcastIdx; // Index if the simulcast encoder creating // this frame, 0 if not using simulcast. RtpVideoCodecTypes codec; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc index 15a1d8b152..99f5d6ca54 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264.cc @@ -393,7 +393,7 @@ bool RtpDepacketizerH264::ProcessStapAOrSingleNalu( parsed_payload->type.Video.width = 0; parsed_payload->type.Video.height = 0; parsed_payload->type.Video.codec = kRtpVideoH264; - parsed_payload->type.Video.isFirstPacket = true; + parsed_payload->type.Video.is_first_packet_in_frame = true; RTPVideoHeaderH264* h264_header = &parsed_payload->type.Video.codecHeader.H264; @@ -614,7 +614,7 @@ bool RtpDepacketizerH264::ParseFuaNalu( parsed_payload->type.Video.width = 0; parsed_payload->type.Video.height = 0; parsed_payload->type.Video.codec = kRtpVideoH264; - parsed_payload->type.Video.isFirstPacket = first_fragment; + parsed_payload->type.Video.is_first_packet_in_frame = first_fragment; RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264; h264->packetization_type = kH264FuA; h264->nalu_type = original_nal_type; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc index ccaef1a9f4..f22f108262 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_format_h264_unittest.cc @@ -565,7 +565,7 @@ TEST_F(RtpDepacketizerH264Test, TestSingleNalu) { ExpectPacket(&payload, packet, sizeof(packet)); EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_TRUE(payload.type.Video.isFirstPacket); + EXPECT_TRUE(payload.type.Video.is_first_packet_in_frame); EXPECT_EQ(kH264SingleNalu, payload.type.Video.codecHeader.H264.packetization_type); EXPECT_EQ(kIdr, payload.type.Video.codecHeader.H264.nalu_type); @@ -581,7 +581,7 @@ TEST_F(RtpDepacketizerH264Test, TestSingleNaluSpsWithResolution) { ExpectPacket(&payload, packet, sizeof(packet)); EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_TRUE(payload.type.Video.isFirstPacket); + EXPECT_TRUE(payload.type.Video.is_first_packet_in_frame); EXPECT_EQ(kH264SingleNalu, payload.type.Video.codecHeader.H264.packetization_type); EXPECT_EQ(1280u, payload.type.Video.width); @@ -611,7 +611,7 @@ TEST_F(RtpDepacketizerH264Test, TestStapAKey) { ExpectPacket(&payload, packet, sizeof(packet)); EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_TRUE(payload.type.Video.isFirstPacket); + EXPECT_TRUE(payload.type.Video.is_first_packet_in_frame); const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264; EXPECT_EQ(kH264StapA, h264.packetization_type); // NALU type for aggregated packets is the type of the first packet only. @@ -642,7 +642,7 @@ TEST_F(RtpDepacketizerH264Test, TestStapANaluSpsWithResolution) { ExpectPacket(&payload, packet, sizeof(packet)); EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_TRUE(payload.type.Video.isFirstPacket); + EXPECT_TRUE(payload.type.Video.is_first_packet_in_frame); EXPECT_EQ(kH264StapA, payload.type.Video.codecHeader.H264.packetization_type); EXPECT_EQ(1280u, payload.type.Video.width); EXPECT_EQ(720u, payload.type.Video.height); @@ -769,7 +769,7 @@ TEST_F(RtpDepacketizerH264Test, TestStapADelta) { ExpectPacket(&payload, packet, sizeof(packet)); EXPECT_EQ(kVideoFrameDelta, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_TRUE(payload.type.Video.isFirstPacket); + EXPECT_TRUE(payload.type.Video.is_first_packet_in_frame); EXPECT_EQ(kH264StapA, payload.type.Video.codecHeader.H264.packetization_type); // NALU type for aggregated packets is the type of the first packet only. EXPECT_EQ(kSlice, payload.type.Video.codecHeader.H264.nalu_type); @@ -808,7 +808,7 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) { ExpectPacket(&payload, kExpected1, sizeof(kExpected1)); EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_TRUE(payload.type.Video.isFirstPacket); + EXPECT_TRUE(payload.type.Video.is_first_packet_in_frame); const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264; EXPECT_EQ(kH264FuA, h264.packetization_type); EXPECT_EQ(kIdr, h264.nalu_type); @@ -824,7 +824,7 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) { ExpectPacket(&payload, kExpected2, sizeof(kExpected2)); EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_FALSE(payload.type.Video.isFirstPacket); + EXPECT_FALSE(payload.type.Video.is_first_packet_in_frame); { const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264; EXPECT_EQ(kH264FuA, h264.packetization_type); @@ -838,7 +838,7 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) { ExpectPacket(&payload, kExpected3, sizeof(kExpected3)); EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); - EXPECT_FALSE(payload.type.Video.isFirstPacket); + EXPECT_FALSE(payload.type.Video.is_first_packet_in_frame); { const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264; EXPECT_EQ(kH264FuA, h264.packetization_type); diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.cc index a2ce664680..2d847c17a6 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_format_video_generic.cc @@ -105,7 +105,7 @@ bool RtpDepacketizerGeneric::Parse(ParsedPayload* parsed_payload, ((generic_header & RtpFormatVideoGeneric::kKeyFrameBit) != 0) ? kVideoFrameKey : kVideoFrameDelta; - parsed_payload->type.Video.isFirstPacket = + parsed_payload->type.Video.is_first_packet_in_frame = (generic_header & RtpFormatVideoGeneric::kFirstPacketBit) != 0; parsed_payload->type.Video.codec = kRtpVideoGeneric; parsed_payload->type.Video.width = 0; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc index e8e7f2997a..a038d47179 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp8.cc @@ -682,7 +682,7 @@ bool RtpDepacketizerVp8::Parse(ParsedPayload* parsed_payload, parsed_payload->type.Video.width = 0; parsed_payload->type.Video.height = 0; - parsed_payload->type.Video.isFirstPacket = + parsed_payload->type.Video.is_first_packet_in_frame = beginning_of_partition && (partition_id == 0); parsed_payload->type.Video.simulcastIdx = 0; parsed_payload->type.Video.codec = kRtpVideoVp8; diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp9.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp9.cc index b77d6a3b72..4c8f7954f4 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp9.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp9.cc @@ -728,7 +728,7 @@ bool RtpDepacketizerVp9::Parse(ParsedPayload* parsed_payload, parsed_payload->type.Video.height = vp9->height[0]; } } - parsed_payload->type.Video.isFirstPacket = + parsed_payload->type.Video.is_first_packet_in_frame = b_bit && (!l_bit || !vp9->inter_layer_predicted); uint64_t rem_bits = parser.RemainingBitCount(); diff --git a/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc index 3f1ead87b5..c53a2ca5a2 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_format_vp9_unittest.cc @@ -689,7 +689,7 @@ TEST_F(RtpDepacketizerVp9Test, ParseFirstPacketInKeyFrame) { RtpDepacketizer::ParsedPayload parsed; ASSERT_TRUE(depacketizer_->Parse(&parsed, packet, sizeof(packet))); EXPECT_EQ(kVideoFrameKey, parsed.frame_type); - EXPECT_TRUE(parsed.type.Video.isFirstPacket); + EXPECT_TRUE(parsed.type.Video.is_first_packet_in_frame); } TEST_F(RtpDepacketizerVp9Test, ParseLastPacketInDeltaFrame) { @@ -699,7 +699,7 @@ TEST_F(RtpDepacketizerVp9Test, ParseLastPacketInDeltaFrame) { RtpDepacketizer::ParsedPayload parsed; ASSERT_TRUE(depacketizer_->Parse(&parsed, packet, sizeof(packet))); EXPECT_EQ(kVideoFrameDelta, parsed.frame_type); - EXPECT_FALSE(parsed.type.Video.isFirstPacket); + EXPECT_FALSE(parsed.type.Video.is_first_packet_in_frame); } TEST_F(RtpDepacketizerVp9Test, ParseResolution) { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc b/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc index 4f79ea9e56..d6c5e5c29b 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_receiver_video.cc @@ -82,7 +82,7 @@ int32_t RTPReceiverVideo::ParseRtpPacket(WebRtcRTPHeader* rtp_header, return -1; } - rtp_header->type.Video.isFirstPacket = is_first_packet; + rtp_header->type.Video.is_first_packet_in_frame = is_first_packet; RtpDepacketizer::ParsedPayload parsed_payload; if (!depacketizer->Parse(&parsed_payload, payload, payload_data_length)) return -1; diff --git a/webrtc/modules/video_coding/decoding_state_unittest.cc b/webrtc/modules/video_coding/decoding_state_unittest.cc index c147354a6f..1edd1e3839 100644 --- a/webrtc/modules/video_coding/decoding_state_unittest.cc +++ b/webrtc/modules/video_coding/decoding_state_unittest.cc @@ -32,7 +32,7 @@ TEST(TestDecodingState, FrameContinuity) { VCMFrameBuffer frame; VCMFrameBuffer frame_key; VCMPacket packet; - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.timestamp = 1; packet.seqNum = 0xffff; packet.frameType = kVideoFrameDelta; @@ -52,7 +52,7 @@ TEST(TestDecodingState, FrameContinuity) { frame.Reset(); packet.frameType = kVideoFrameDelta; // Use pictureId - packet.isFirstPacket = false; + packet.is_first_packet_in_frame = false; packet.video_header.codecHeader.VP8.pictureId = 0x0002; EXPECT_LE(0, frame.InsertPacket(packet, 0, kNoErrors, frame_data)); EXPECT_FALSE(dec_state.ContinuousFrame(&frame)); @@ -260,7 +260,7 @@ TEST(TestDecodingState, MultiLayerBehavior) { // A key frame is always a base layer. frame.Reset(); packet.frameType = kVideoFrameKey; - packet.isFirstPacket = 1; + packet.is_first_packet_in_frame = 1; packet.timestamp = 5; packet.seqNum = 5; packet.video_header.codecHeader.VP8.tl0PicIdx = 2; @@ -284,7 +284,7 @@ TEST(TestDecodingState, MultiLayerBehavior) { EXPECT_TRUE(dec_state.full_sync()); frame.Reset(); packet.frameType = kVideoFrameDelta; - packet.isFirstPacket = 1; + packet.is_first_packet_in_frame = 1; packet.timestamp = 8; packet.seqNum = 8; packet.video_header.codecHeader.VP8.tl0PicIdx = 4; @@ -299,7 +299,7 @@ TEST(TestDecodingState, MultiLayerBehavior) { // Insert a non-ref frame - should update sync value. frame.Reset(); packet.frameType = kVideoFrameDelta; - packet.isFirstPacket = 1; + packet.is_first_packet_in_frame = 1; packet.timestamp = 9; packet.seqNum = 9; packet.video_header.codecHeader.VP8.tl0PicIdx = 4; @@ -319,7 +319,7 @@ TEST(TestDecodingState, MultiLayerBehavior) { frame.Reset(); dec_state.Reset(); packet.frameType = kVideoFrameDelta; - packet.isFirstPacket = 1; + packet.is_first_packet_in_frame = 1; packet.markerBit = 1; packet.timestamp = 0; packet.seqNum = 0; @@ -333,7 +333,7 @@ TEST(TestDecodingState, MultiLayerBehavior) { // Layer 2 - 2 packets (insert one, lose one). frame.Reset(); packet.frameType = kVideoFrameDelta; - packet.isFirstPacket = 1; + packet.is_first_packet_in_frame = 1; packet.markerBit = 0; packet.timestamp = 1; packet.seqNum = 1; @@ -346,7 +346,7 @@ TEST(TestDecodingState, MultiLayerBehavior) { // Layer 1 frame.Reset(); packet.frameType = kVideoFrameDelta; - packet.isFirstPacket = 1; + packet.is_first_packet_in_frame = 1; packet.markerBit = 1; packet.timestamp = 2; packet.seqNum = 3; @@ -450,7 +450,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeKeyFrame) { VCMDecodingState dec_state; VCMFrameBuffer frame; VCMPacket packet; - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.timestamp = 1; packet.seqNum = 0xffff; uint8_t data[] = "I need a data pointer for this test!"; @@ -493,7 +493,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeOutOfOrderFrames) { VCMDecodingState dec_state; VCMFrameBuffer frame; VCMPacket packet; - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.timestamp = 1; packet.seqNum = 0xffff; uint8_t data[] = "I need a data pointer for this test!"; @@ -548,7 +548,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeGeneral) { VCMDecodingState dec_state; VCMFrameBuffer frame; VCMPacket packet; - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.timestamp = 1; packet.seqNum = 0xffff; uint8_t data[] = "I need a data pointer for this test!"; diff --git a/webrtc/modules/video_coding/frame_buffer.cc b/webrtc/modules/video_coding/frame_buffer.cc index bb8ec93713..e3b46de80d 100644 --- a/webrtc/modules/video_coding/frame_buffer.cc +++ b/webrtc/modules/video_coding/frame_buffer.cc @@ -161,7 +161,7 @@ VCMFrameBufferEnum VCMFrameBuffer::InsertPacket( _rotation_set = true; } - if (packet.isFirstPacket) { + if (packet.is_first_packet_in_frame) { playout_delay_ = packet.video_header.playout_delay; } diff --git a/webrtc/modules/video_coding/h264_sps_pps_tracker.cc b/webrtc/modules/video_coding/h264_sps_pps_tracker.cc index 7bcc2b7c5e..3f11eb5f5b 100644 --- a/webrtc/modules/video_coding/h264_sps_pps_tracker.cc +++ b/webrtc/modules/video_coding/h264_sps_pps_tracker.cc @@ -67,7 +67,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream( // If this is the first packet of an IDR, make sure we have the required // SPS/PPS and also calculate how much extra space we need in the buffer // to prepend the SPS/PPS to the bitstream with start codes. - if (video_header.isFirstPacket) { + if (video_header.is_first_packet_in_frame) { if (nalu.pps_id == -1) { LOG(LS_WARNING) << "No PPS id in IDR nalu."; return kRequestKeyframe; @@ -108,7 +108,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream( if (codec_header.packetization_type == kH264StapA) { const uint8_t* nalu_ptr = data + 1; while (nalu_ptr < data + data_size) { - RTC_DCHECK(video_header.isFirstPacket); + RTC_DCHECK(video_header.is_first_packet_in_frame); required_size += sizeof(start_code_h264); // The first two bytes describe the length of a segment. @@ -119,7 +119,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream( nalu_ptr += segment_length; } } else { - if (video_header.isFirstPacket) + if (video_header.is_first_packet_in_frame) required_size += sizeof(start_code_h264); required_size += data_size; } @@ -167,7 +167,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream( nalu_ptr += segment_length; } } else { - if (video_header.isFirstPacket) { + if (video_header.is_first_packet_in_frame) { memcpy(insert_at, start_code_h264, sizeof(start_code_h264)); insert_at += sizeof(start_code_h264); } diff --git a/webrtc/modules/video_coding/h264_sps_pps_tracker_unittest.cc b/webrtc/modules/video_coding/h264_sps_pps_tracker_unittest.cc index 340f4bd28a..83330b934e 100644 --- a/webrtc/modules/video_coding/h264_sps_pps_tracker_unittest.cc +++ b/webrtc/modules/video_coding/h264_sps_pps_tracker_unittest.cc @@ -29,7 +29,7 @@ class TestH264SpsPpsTracker : public ::testing::Test { VCMPacket packet; packet.codec = kVideoCodecH264; packet.video_header.codecHeader.H264.nalus_length = 0; - packet.video_header.isFirstPacket = false; + packet.video_header.is_first_packet_in_frame = false; packet.video_header.codecHeader.H264.packetization_type = kH264SingleNalu; return packet; @@ -96,7 +96,7 @@ TEST_F(TestH264SpsPpsTracker, FuAFirstPacket) { uint8_t data[] = {1, 2, 3}; VCMPacket packet = GetDefaultPacket(); packet.video_header.codecHeader.H264.packetization_type = kH264FuA; - packet.video_header.isFirstPacket = true; + packet.video_header.is_first_packet_in_frame = true; packet.dataPtr = data; packet.sizeBytes = sizeof(data); @@ -112,7 +112,7 @@ TEST_F(TestH264SpsPpsTracker, StapAIncorrectSegmentLength) { uint8_t data[] = {0, 0, 2, 0}; VCMPacket packet = GetDefaultPacket(); packet.video_header.codecHeader.H264.packetization_type = kH264StapA; - packet.video_header.isFirstPacket = true; + packet.video_header.is_first_packet_in_frame = true; packet.dataPtr = data; packet.sizeBytes = sizeof(data); @@ -122,7 +122,7 @@ TEST_F(TestH264SpsPpsTracker, StapAIncorrectSegmentLength) { TEST_F(TestH264SpsPpsTracker, NoNalusFirstPacket) { uint8_t data[] = {1, 2, 3}; VCMPacket packet = GetDefaultPacket(); - packet.video_header.isFirstPacket = true; + packet.video_header.is_first_packet_in_frame = true; packet.dataPtr = data; packet.sizeBytes = sizeof(data); @@ -151,7 +151,7 @@ TEST_F(TestH264SpsPpsTracker, IdrNoSpsPpsInserted) { TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsPpsInserted) { std::vector data = {1, 2, 3}; VCMPacket packet = GetDefaultPacket(); - packet.video_header.isFirstPacket = true; + packet.video_header.is_first_packet_in_frame = true; AddIdr(&packet, 0); packet.dataPtr = data.data(); @@ -164,7 +164,7 @@ TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsPpsInserted) { TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoPpsInserted) { std::vector data = {1, 2, 3}; VCMPacket packet = GetDefaultPacket(); - packet.video_header.isFirstPacket = true; + packet.video_header.is_first_packet_in_frame = true; AddSps(&packet, 0, &data); AddIdr(&packet, 0); @@ -178,7 +178,7 @@ TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoPpsInserted) { TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsInserted) { std::vector data = {1, 2, 3}; VCMPacket packet = GetDefaultPacket(); - packet.video_header.isFirstPacket = true; + packet.video_header.is_first_packet_in_frame = true; AddPps(&packet, 0, 0, &data); AddIdr(&packet, 0); @@ -204,7 +204,7 @@ TEST_F(TestH264SpsPpsTracker, SpsPpsPacketThenIdrFirstPacket) { // Insert first packet of the IDR VCMPacket idr_packet = GetDefaultPacket(); - idr_packet.video_header.isFirstPacket = true; + idr_packet.video_header.is_first_packet_in_frame = true; AddIdr(&idr_packet, 1); data.insert(data.end(), {1, 2, 3}); idr_packet.dataPtr = data.data(); @@ -227,7 +227,7 @@ TEST_F(TestH264SpsPpsTracker, SpsPpsIdrInStapA) { std::vector data; VCMPacket packet = GetDefaultPacket(); packet.video_header.codecHeader.H264.packetization_type = kH264StapA; - packet.video_header.isFirstPacket = true; // Always true for StapA + packet.video_header.is_first_packet_in_frame = true; // Always true for StapA data.insert(data.end(), {0}); // First byte is ignored data.insert(data.end(), {0, 2}); // Length of segment diff --git a/webrtc/modules/video_coding/jitter_buffer_unittest.cc b/webrtc/modules/video_coding/jitter_buffer_unittest.cc index 425a4e9745..99d4ee6919 100644 --- a/webrtc/modules/video_coding/jitter_buffer_unittest.cc +++ b/webrtc/modules/video_coding/jitter_buffer_unittest.cc @@ -40,7 +40,7 @@ class Vp9SsMapTest : public ::testing::Test { Vp9SsMapTest() : packet_() {} virtual void SetUp() { - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.dataPtr = data_; packet_.sizeBytes = 1400; packet_.seqNum = 1234; @@ -478,7 +478,7 @@ TEST_F(TestBasicJitterBuffer, SinglePacketFrame) { // Always start with a complete key frame when not allowing errors. jitter_buffer_->SetDecodeErrorMode(kNoErrors); packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->timestamp += 123 * 90; @@ -497,7 +497,7 @@ TEST_F(TestBasicJitterBuffer, VerifyHistogramStats) { // Always start with a complete key frame when not allowing errors. jitter_buffer_->SetDecodeErrorMode(kNoErrors); packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->timestamp += 123 * 90; @@ -532,7 +532,7 @@ TEST_F(TestBasicJitterBuffer, VerifyHistogramStats) { TEST_F(TestBasicJitterBuffer, DualPacketFrame) { packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; bool retransmitted = false; @@ -543,7 +543,7 @@ TEST_F(TestBasicJitterBuffer, DualPacketFrame) { EXPECT_TRUE(frame_out == NULL); ++seq_num_; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -559,7 +559,7 @@ TEST_F(TestBasicJitterBuffer, DualPacketFrame) { TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) { packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; bool retransmitted = false; @@ -575,7 +575,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) { int loop = 0; do { seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum = seq_num_; @@ -586,7 +586,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) { // Insert last packet. ++seq_num_; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -603,7 +603,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) { TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) { // Always start with a complete key frame. packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; bool retransmitted = false; @@ -627,7 +627,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) { // Frame should not be complete. EXPECT_TRUE(frame_out == NULL); - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; // Insert 98 frames. int loop = 0; do { @@ -642,7 +642,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) { // Insert the last packet. ++seq_num_; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -660,7 +660,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) { // Insert the "first" packet last. seq_num_ += 100; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -677,7 +677,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) { int loop = 0; do { seq_num_--; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum = seq_num_; @@ -688,7 +688,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) { // Insert the last packet. seq_num_--; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; @@ -705,7 +705,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) { TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) { packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; bool retransmitted = false; @@ -717,7 +717,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) { EXPECT_TRUE(frame_out == NULL); seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -731,7 +731,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) { seq_num_ -= 3; timestamp_ -= 33 * 90; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -745,7 +745,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) { EXPECT_TRUE(frame_out == NULL); seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -765,7 +765,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) { TEST_F(TestBasicJitterBuffer, TestReorderingWithPadding) { packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; // Send in an initial good packet/frame (Frame A) to start things off. @@ -827,7 +827,7 @@ TEST_F(TestBasicJitterBuffer, TestReorderingWithPadding) { TEST_F(TestBasicJitterBuffer, DuplicatePackets) { packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -853,7 +853,7 @@ TEST_F(TestBasicJitterBuffer, DuplicatePackets) { seq_num_++; packet_->seqNum = seq_num_; packet_->markerBit = true; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; EXPECT_EQ(kCompleteSession, jitter_buffer_->InsertPacket(*packet_, &retransmitted)); @@ -870,7 +870,7 @@ TEST_F(TestBasicJitterBuffer, DuplicatePackets) { TEST_F(TestBasicJitterBuffer, DuplicatePreviousDeltaFramePacket) { packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -933,7 +933,7 @@ TEST_F(TestBasicJitterBuffer, TestSkipForwardVp9) { bool re = false; packet_->codec = kVideoCodecVP9; packet_->video_header.codec = kRtpVideoVp9; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->video_header.codecHeader.VP9.flexible_mode = false; packet_->video_header.codecHeader.VP9.spatial_idx = 0; @@ -986,7 +986,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_3TlLayers) { bool re = false; packet_->codec = kVideoCodecVP9; packet_->video_header.codec = kRtpVideoVp9; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->video_header.codecHeader.VP9.flexible_mode = false; packet_->video_header.codecHeader.VP9.spatial_idx = 0; @@ -1067,7 +1067,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) { packet_->video_header.codecHeader.VP9.end_of_frame = true; packet_->video_header.codecHeader.VP9.tl0_pic_idx = 200; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = 65486; packet_->timestamp = 6000; @@ -1078,7 +1078,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) { packet_->video_header.codecHeader.VP9.temporal_up_switch = true; EXPECT_EQ(kIncomplete, jitter_buffer_->InsertPacket(*packet_, &re)); - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = 65487; packet_->frameType = kVideoFrameDelta; @@ -1088,7 +1088,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) { packet_->video_header.codecHeader.VP9.temporal_up_switch = true; EXPECT_EQ(kCompleteSession, jitter_buffer_->InsertPacket(*packet_, &re)); - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = 65485; packet_->timestamp = 3000; @@ -1100,7 +1100,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) { EXPECT_EQ(kIncomplete, jitter_buffer_->InsertPacket(*packet_, &re)); // Insert first frame with SS data. - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = 65484; packet_->frameType = kVideoFrameKey; @@ -1133,7 +1133,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) { TEST_F(TestBasicJitterBuffer, H264InsertStartCode) { packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1149,7 +1149,7 @@ TEST_F(TestBasicJitterBuffer, H264InsertStartCode) { EXPECT_TRUE(frame_out == NULL); seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -1167,7 +1167,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) { packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->codec = kVideoCodecH264; packet_->video_header.codec = kRtpVideoH264; @@ -1187,7 +1187,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) { ++seq_num_; packet_->seqNum = seq_num_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->codec = kVideoCodecH264; packet_->video_header.codec = kRtpVideoH264; @@ -1206,7 +1206,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) { ++seq_num_; packet_->seqNum = seq_num_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->codec = kVideoCodecH264; packet_->video_header.codec = kRtpVideoH264; @@ -1228,7 +1228,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) { ++seq_num_; packet_->seqNum = seq_num_; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->codec = kVideoCodecH264; packet_->video_header.codec = kRtpVideoH264; @@ -1251,7 +1251,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) { // Always start with a key frame. Use 10 packets to test Decodable State // boundaries. packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1263,7 +1263,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) { EXPECT_EQ(jitter_buffer_->NextCompleteFrame(0), nullptr); EXPECT_FALSE(jitter_buffer_->NextMaybeIncompleteTimestamp(×tamp)); - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; for (int i = 1; i < 9; ++i) { packet_->seqNum++; EXPECT_EQ(kIncomplete, @@ -1286,7 +1286,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) { // An incomplete frame can only be decoded once a subsequent frame has begun // to arrive. Insert packet in distant frame for this purpose. packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum += 100; packet_->timestamp += 33 * 90 * 8; @@ -1305,7 +1305,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) { EXPECT_EQ(jitter_buffer_->NextCompleteFrame(0), nullptr); EXPECT_TRUE(jitter_buffer_->NextMaybeIncompleteTimestamp(×tamp)); - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; for (int i = 1; i < 8; ++i) { packet_->seqNum++; EXPECT_EQ(kDecodableSession, @@ -1336,7 +1336,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsIncompleteKey) { jitter_buffer_->SetDecodeErrorMode(kSelectiveErrors); // Always start with a key frame. packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1352,7 +1352,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsIncompleteKey) { // An incomplete frame can only be decoded once a subsequent frame has begun // to arrive. Insert packet in distant frame for this purpose. packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum += 100; packet_->timestamp += 33 * 90 * 8; @@ -1364,7 +1364,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsIncompleteKey) { // Insert second frame - an incomplete key frame. packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->seqNum -= 99; packet_->timestamp -= 33 * 90 * 7; @@ -1375,7 +1375,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsIncompleteKey) { // Insert a few more packets. Make sure we're waiting for the key frame to be // complete. - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; for (int i = 1; i < 5; ++i) { packet_->seqNum++; EXPECT_EQ(kIncomplete, @@ -1400,7 +1400,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsMissingFirstPacket) { jitter_buffer_->SetDecodeErrorMode(kSelectiveErrors); // Always start with a key frame. packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1416,7 +1416,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsMissingFirstPacket) { // An incomplete frame can only be decoded once a subsequent frame has begun // to arrive. Insert packet in distant frame for this purpose. packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum += 100; packet_->timestamp += 33 * 90 * 8; @@ -1445,7 +1445,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsMissingFirstPacket) { } // Add first packet. Frame should now be decodable, but incomplete. - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->seqNum -= 6; EXPECT_EQ(kDecodableSession, jitter_buffer_->InsertPacket(*packet_, &retransmitted)); @@ -1462,7 +1462,7 @@ TEST_F(TestBasicJitterBuffer, DiscontinuousStreamWhenDecodingWithErrors) { // Will use one packet per frame. jitter_buffer_->SetDecodeErrorMode(kWithErrors); packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1481,7 +1481,7 @@ TEST_F(TestBasicJitterBuffer, DiscontinuousStreamWhenDecodingWithErrors) { timestamp_ += 2 * 33 * 90; seq_num_ += 2; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1491,7 +1491,7 @@ TEST_F(TestBasicJitterBuffer, DiscontinuousStreamWhenDecodingWithErrors) { timestamp_ += 33 * 90; seq_num_ += 2; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1514,7 +1514,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) { seq_num_ = 0xffff - 4; seq_num_++; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1528,7 +1528,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) { seq_num_++; timestamp_ += 33 * 90; packet_->frameType = frametype; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1543,7 +1543,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) { EXPECT_TRUE(frame_out == NULL); seq_num_ += 2; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->completeNALU = kNaluEnd; @@ -1553,7 +1553,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) { // Insert an empty (non-media) packet. seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->completeNALU = kNaluEnd; @@ -1606,7 +1606,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) { TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) { seq_num_ = 0xfff0; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1622,7 +1622,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) { int loop = 0; do { seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum = seq_num_; @@ -1637,7 +1637,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) { } while (loop < 98); seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -1656,7 +1656,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseWithNegSeqNumWrap) { // Insert "first" packet last seqnum. seq_num_ = 10; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -1672,7 +1672,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseWithNegSeqNumWrap) { int loop = 0; do { seq_num_--; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum = seq_num_; @@ -1688,7 +1688,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseWithNegSeqNumWrap) { // Insert last packet. seq_num_--; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; @@ -1709,7 +1709,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrame) { seq_num_ = 2; timestamp_ = 3000; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->timestamp = timestamp_; packet_->seqNum = seq_num_; @@ -1727,7 +1727,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrame) { seq_num_--; timestamp_ = 2000; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1744,7 +1744,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrameWithSeqNumWrap) { seq_num_ = 2; timestamp_ = 3000; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1765,7 +1765,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrameWithSeqNumWrap) { seq_num_--; timestamp_ = 0xffffff00; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1782,7 +1782,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) { timestamp_ = 0xffffff00; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1795,7 +1795,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) { EXPECT_TRUE(frame_out == NULL); seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -1809,7 +1809,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) { seq_num_++; timestamp_ += 33 * 90; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1821,7 +1821,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) { EXPECT_TRUE(frame_out == NULL); seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -1842,7 +1842,7 @@ TEST_F(TestBasicJitterBuffer, 2FrameWithTimestampWrap) { timestamp_ = 0xffffff00; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->timestamp = timestamp_; @@ -1855,7 +1855,7 @@ TEST_F(TestBasicJitterBuffer, 2FrameWithTimestampWrap) { seq_num_++; timestamp_ = 2700; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1885,7 +1885,7 @@ TEST_F(TestBasicJitterBuffer, Insert2FramesReOrderedWithTimestampWrap) { seq_num_ = 2; timestamp_ = 2700; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1898,7 +1898,7 @@ TEST_F(TestBasicJitterBuffer, Insert2FramesReOrderedWithTimestampWrap) { seq_num_--; timestamp_ = 0xffffff00; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1926,7 +1926,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrameWithMoreThanMaxNumberOfPackets) { // Insert kMaxPacketsInJitterBuffer into frame. do { seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum = seq_num_; @@ -1945,7 +1945,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrameWithMoreThanMaxNumberOfPackets) { // Max number of packets inserted. // Insert one more packet. seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = true; packet_->seqNum = seq_num_; @@ -1976,7 +1976,7 @@ TEST_F(TestBasicJitterBuffer, ExceedNumOfFrameWithSeqNumWrap) { do { timestamp_ += 33 * 90; seq_num_++; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -1998,7 +1998,7 @@ TEST_F(TestBasicJitterBuffer, ExceedNumOfFrameWithSeqNumWrap) { // Insert one more frame. timestamp_ += 33 * 90; seq_num_++; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -2024,7 +2024,7 @@ TEST_F(TestBasicJitterBuffer, EmptyLastFrame) { for (int i = 0; i < maxSize + 10; i++) { timestamp_ += 33 * 90; seq_num_++; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; @@ -2049,7 +2049,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->completeNALU = kNaluStart; packet_->markerBit = false; bool retransmitted = false; @@ -2060,7 +2060,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { seq_num_ += 2; // Skip one packet. packet_->seqNum = seq_num_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->completeNALU = kNaluIncomplete; packet_->markerBit = false; @@ -2070,7 +2070,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { seq_num_++; packet_->seqNum = seq_num_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->completeNALU = kNaluEnd; packet_->markerBit = false; @@ -2091,7 +2091,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = 1; packet_->timestamp = timestamp_ + 33 * 90 * 10; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->completeNALU = kNaluStart; packet_->markerBit = false; @@ -2114,7 +2114,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->completeNALU = kNaluEnd; packet_->markerBit = false; EXPECT_EQ(kDecodableSession, @@ -2124,7 +2124,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->completeNALU = kNaluStart; packet_->markerBit = false; @@ -2136,7 +2136,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->completeNALU = kNaluComplete; packet_->markerBit = false; EXPECT_EQ(kDecodableSession, @@ -2146,7 +2146,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->completeNALU = kNaluStart; packet_->markerBit = false; EXPECT_EQ(kDecodableSession, @@ -2158,7 +2158,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->completeNALU = kNaluEnd; packet_->markerBit = true; EXPECT_EQ(kDecodableSession, @@ -2179,7 +2179,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { emptypacket.seqNum = seq_num_; emptypacket.timestamp = timestamp_; emptypacket.frameType = kVideoFrameKey; - emptypacket.isFirstPacket = true; + emptypacket.is_first_packet_in_frame = true; emptypacket.completeNALU = kNaluComplete; emptypacket.markerBit = true; EXPECT_EQ(kCompleteSession, @@ -2200,7 +2200,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { packet_->seqNum = seq_num_; packet_->timestamp = timestamp_; packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->completeNALU = kNaluComplete; packet_->markerBit = false; @@ -2211,7 +2211,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) { emptypacket.seqNum = seq_num_; emptypacket.timestamp = timestamp_; emptypacket.frameType = kVideoFrameKey; - emptypacket.isFirstPacket = true; + emptypacket.is_first_packet_in_frame = true; emptypacket.completeNALU = kNaluComplete; emptypacket.markerBit = true; EXPECT_EQ(kCompleteSession, @@ -2230,7 +2230,7 @@ TEST_F(TestBasicJitterBuffer, NextFrameWhenIncomplete) { jitter_buffer_->SetDecodeErrorMode(kWithErrors); // Start with a complete key frame - insert and decode. packet_->frameType = kVideoFrameKey; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; packet_->markerBit = true; bool retransmitted = false; @@ -2243,7 +2243,7 @@ TEST_F(TestBasicJitterBuffer, NextFrameWhenIncomplete) { packet_->seqNum += 2; packet_->timestamp += 33 * 90; packet_->frameType = kVideoFrameDelta; - packet_->isFirstPacket = false; + packet_->is_first_packet_in_frame = false; packet_->markerBit = false; EXPECT_EQ(kDecodableSession, @@ -2254,7 +2254,7 @@ TEST_F(TestBasicJitterBuffer, NextFrameWhenIncomplete) { packet_->seqNum += 2; packet_->timestamp += 33 * 90; - packet_->isFirstPacket = true; + packet_->is_first_packet_in_frame = true; EXPECT_EQ(kDecodableSession, jitter_buffer_->InsertPacket(*packet_, &retransmitted)); diff --git a/webrtc/modules/video_coding/nack_module.cc b/webrtc/modules/video_coding/nack_module.cc index 43244321ea..d74f089526 100644 --- a/webrtc/modules/video_coding/nack_module.cc +++ b/webrtc/modules/video_coding/nack_module.cc @@ -66,7 +66,8 @@ int NackModule::OnReceivedPacket(const VCMPacket& packet) { // now set it to true, which will cause the reordering // statistics to never be updated. bool is_retransmitted = true; - bool is_keyframe = packet.isFirstPacket && packet.frameType == kVideoFrameKey; + bool is_keyframe = + packet.is_first_packet_in_frame && packet.frameType == kVideoFrameKey; if (!initialized_) { newest_seq_num_ = seq_num; diff --git a/webrtc/modules/video_coding/nack_module_unittest.cc b/webrtc/modules/video_coding/nack_module_unittest.cc index fb7d0955de..bb581fe002 100644 --- a/webrtc/modules/video_coding/nack_module_unittest.cc +++ b/webrtc/modules/video_coding/nack_module_unittest.cc @@ -72,7 +72,7 @@ TEST_F(TestNackModule, WrappingSeqNumClearToKeyframe) { sent_nacks_.clear(); packet.frameType = kVideoFrameKey; - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.seqNum = 2; nack_module_.OnReceivedPacket(packet); EXPECT_EQ(0u, sent_nacks_.size()); @@ -239,11 +239,11 @@ TEST_F(TestNackModule, TooLargeNackListWithKeyFrame) { packet.seqNum = 0; nack_module_.OnReceivedPacket(packet); packet.seqNum = 1; - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.frameType = kVideoFrameKey; nack_module_.OnReceivedPacket(packet); packet.seqNum = 1001; - packet.isFirstPacket = false; + packet.is_first_packet_in_frame = false; packet.frameType = kVideoFrameKey; nack_module_.OnReceivedPacket(packet); EXPECT_EQ(999u, sent_nacks_.size()); diff --git a/webrtc/modules/video_coding/packet.cc b/webrtc/modules/video_coding/packet.cc index 643a10a346..4d5ba7c5cf 100644 --- a/webrtc/modules/video_coding/packet.cc +++ b/webrtc/modules/video_coding/packet.cc @@ -27,7 +27,7 @@ VCMPacket::VCMPacket() timesNacked(-1), frameType(kEmptyFrame), codec(kVideoCodecUnknown), - isFirstPacket(false), + is_first_packet_in_frame(false), completeNALU(kNaluUnset), insertStartCode(false), width(0), @@ -49,7 +49,7 @@ VCMPacket::VCMPacket(const uint8_t* ptr, timesNacked(-1), frameType(rtpHeader.frameType), codec(kVideoCodecUnknown), - isFirstPacket(rtpHeader.type.Video.isFirstPacket), + is_first_packet_in_frame(rtpHeader.type.Video.is_first_packet_in_frame), completeNALU(kNaluComplete), insertStartCode(false), width(rtpHeader.type.Video.width), @@ -61,7 +61,7 @@ VCMPacket::VCMPacket(const uint8_t* ptr, video_header.rotation = rtpHeader.type.Video.rotation; } // Playout decisions are made entirely based on first packet in a frame. - if (isFirstPacket) { + if (is_first_packet_in_frame) { video_header.playout_delay = rtpHeader.type.Video.playout_delay; } else { video_header.playout_delay = {-1, -1}; @@ -79,7 +79,7 @@ void VCMPacket::Reset() { timesNacked = -1; frameType = kEmptyFrame; codec = kVideoCodecUnknown; - isFirstPacket = false; + is_first_packet_in_frame = false; completeNALU = kNaluUnset; insertStartCode = false; width = 0; @@ -93,9 +93,9 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) { // Handle all packets within a frame as depending on the previous packet // TODO(holmer): This should be changed to make fragments independent // when the VP8 RTP receiver supports fragments. - if (isFirstPacket && markerBit) + if (is_first_packet_in_frame && markerBit) completeNALU = kNaluComplete; - else if (isFirstPacket) + else if (is_first_packet_in_frame) completeNALU = kNaluStart; else if (markerBit) completeNALU = kNaluEnd; @@ -105,9 +105,9 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) { codec = kVideoCodecVP8; return; case kRtpVideoVp9: - if (isFirstPacket && markerBit) + if (is_first_packet_in_frame && markerBit) completeNALU = kNaluComplete; - else if (isFirstPacket) + else if (is_first_packet_in_frame) completeNALU = kNaluStart; else if (markerBit) completeNALU = kNaluEnd; @@ -117,13 +117,13 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) { codec = kVideoCodecVP9; return; case kRtpVideoH264: - isFirstPacket = videoHeader.isFirstPacket; - if (isFirstPacket) + is_first_packet_in_frame = videoHeader.is_first_packet_in_frame; + if (is_first_packet_in_frame) insertStartCode = true; - if (isFirstPacket && markerBit) { + if (is_first_packet_in_frame && markerBit) { completeNALU = kNaluComplete; - } else if (isFirstPacket) { + } else if (is_first_packet_in_frame) { completeNALU = kNaluStart; } else if (markerBit) { completeNALU = kNaluEnd; diff --git a/webrtc/modules/video_coding/packet.h b/webrtc/modules/video_coding/packet.h index 16f568504e..fa3f4790dc 100644 --- a/webrtc/modules/video_coding/packet.h +++ b/webrtc/modules/video_coding/packet.h @@ -39,7 +39,7 @@ class VCMPacket { FrameType frameType; VideoCodecType codec; - bool isFirstPacket; // Is this first packet in a frame. + bool is_first_packet_in_frame; // Is this first packet in a frame. VCMNaluCompleteness completeNALU; // Default is kNaluIncomplete. bool insertStartCode; // True if a start code should be inserted before this // packet. diff --git a/webrtc/modules/video_coding/packet_buffer.cc b/webrtc/modules/video_coding/packet_buffer.cc index 03aeb5a4a9..bbf488cc0e 100644 --- a/webrtc/modules/video_coding/packet_buffer.cc +++ b/webrtc/modules/video_coding/packet_buffer.cc @@ -103,7 +103,7 @@ bool PacketBuffer::InsertPacket(VCMPacket* packet) { if (AheadOf(seq_num, last_seq_num_)) last_seq_num_ = seq_num; - sequence_buffer_[index].frame_begin = packet->isFirstPacket; + sequence_buffer_[index].frame_begin = packet->is_first_packet_in_frame; sequence_buffer_[index].frame_end = packet->markerBit; sequence_buffer_[index].seq_num = packet->seqNum; sequence_buffer_[index].continuous = false; diff --git a/webrtc/modules/video_coding/session_info.cc b/webrtc/modules/video_coding/session_info.cc index 39c1c0b5b6..bb2b983b20 100644 --- a/webrtc/modules/video_coding/session_info.cc +++ b/webrtc/modules/video_coding/session_info.cc @@ -455,7 +455,7 @@ int VCMSessionInfo::InsertPacket(const VCMPacket& packet, if (packet.codec == kVideoCodecH264) { frame_type_ = packet.frameType; - if (packet.isFirstPacket && + if (packet.is_first_packet_in_frame && (first_packet_seq_num_ == -1 || IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum))) { first_packet_seq_num_ = packet.seqNum; @@ -471,7 +471,7 @@ int VCMSessionInfo::InsertPacket(const VCMPacket& packet, // Placing check here, as to properly account for duplicate packets. // Check if this is first packet (only valid for some codecs) // Should only be set for one packet per session. - if (packet.isFirstPacket && first_packet_seq_num_ == -1) { + if (packet.is_first_packet_in_frame && first_packet_seq_num_ == -1) { // The first packet in a frame signals the frame type. frame_type_ = packet.frameType; // Store the sequence number for the first packet. diff --git a/webrtc/modules/video_coding/session_info_unittest.cc b/webrtc/modules/video_coding/session_info_unittest.cc index 2cefc06581..6705a78282 100644 --- a/webrtc/modules/video_coding/session_info_unittest.cc +++ b/webrtc/modules/video_coding/session_info_unittest.cc @@ -114,7 +114,7 @@ class TestNackList : public TestSessionInfo { }; TEST_F(TestSessionInfo, TestSimpleAPIs) { - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.seqNum = 0xFFFE; packet_.sizeBytes = packet_buffer_size(); packet_.frameType = kVideoFrameKey; @@ -125,7 +125,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) { EXPECT_FALSE(session_.HaveLastPacket()); EXPECT_EQ(kVideoFrameKey, session_.FrameType()); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = true; packet_.seqNum += 1; EXPECT_EQ(packet_buffer_size(), @@ -137,7 +137,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) { // Insert empty packet which will be the new high sequence number. // To make things more difficult we will make sure to have a wrap here. - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = true; packet_.seqNum = 2; packet_.sizeBytes = 0; @@ -149,14 +149,14 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) { TEST_F(TestSessionInfo, NormalOperation) { packet_.seqNum = 0xFFFF; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = false; FillPacket(0); EXPECT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; for (int i = 1; i < 9; ++i) { packet_.seqNum += 1; FillPacket(i); @@ -181,7 +181,7 @@ TEST_F(TestSessionInfo, NormalOperation) { TEST_F(TestSessionInfo, ErrorsEqualDecodableState) { packet_.seqNum = 0xFFFF; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(3); EXPECT_EQ(packet_buffer_size(), @@ -192,7 +192,7 @@ TEST_F(TestSessionInfo, ErrorsEqualDecodableState) { TEST_F(TestSessionInfo, SelectiveDecodableState) { packet_.seqNum = 0xFFFF; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); frame_data.rolling_average_packets_per_frame = 11; @@ -204,13 +204,13 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) { packet_.seqNum -= 1; FillPacket(0); - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; EXPECT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket( packet_, frame_buffer_, kSelectiveErrors, frame_data))); EXPECT_TRUE(session_.decodable()); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.seqNum += 1; for (int i = 2; i < 8; ++i) { packet_.seqNum += 1; @@ -231,7 +231,7 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) { TEST_F(TestSessionInfo, OutOfBoundsPackets1PacketFrame) { packet_.seqNum = 0x0001; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = true; FillPacket(1); EXPECT_EQ(packet_buffer_size(), @@ -239,13 +239,13 @@ TEST_F(TestSessionInfo, OutOfBoundsPackets1PacketFrame) { kNoErrors, frame_data))); packet_.seqNum = 0x0004; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = true; FillPacket(1); EXPECT_EQ( -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); packet_.seqNum = 0x0000; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); EXPECT_EQ( @@ -254,14 +254,14 @@ TEST_F(TestSessionInfo, OutOfBoundsPackets1PacketFrame) { TEST_F(TestSessionInfo, SetMarkerBitOnce) { packet_.seqNum = 0x0005; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = true; FillPacket(1); EXPECT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); ++packet_.seqNum; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = true; FillPacket(1); EXPECT_EQ( @@ -271,7 +271,7 @@ TEST_F(TestSessionInfo, SetMarkerBitOnce) { TEST_F(TestSessionInfo, OutOfBoundsPacketsBase) { // Allow packets in the range 5-6. packet_.seqNum = 0x0005; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = false; FillPacket(1); EXPECT_EQ(packet_buffer_size(), @@ -279,20 +279,20 @@ TEST_F(TestSessionInfo, OutOfBoundsPacketsBase) { kNoErrors, frame_data))); // Insert an older packet with a first packet set. packet_.seqNum = 0x0004; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = true; FillPacket(1); EXPECT_EQ( -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); packet_.seqNum = 0x0006; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = true; FillPacket(1); EXPECT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); packet_.seqNum = 0x0008; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = true; FillPacket(1); EXPECT_EQ( @@ -301,7 +301,7 @@ TEST_F(TestSessionInfo, OutOfBoundsPacketsBase) { TEST_F(TestSessionInfo, OutOfBoundsPacketsWrap) { packet_.seqNum = 0xFFFE; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = false; FillPacket(1); EXPECT_EQ(packet_buffer_size(), @@ -309,27 +309,27 @@ TEST_F(TestSessionInfo, OutOfBoundsPacketsWrap) { kNoErrors, frame_data))); packet_.seqNum = 0x0004; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = true; FillPacket(1); EXPECT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); packet_.seqNum = 0x0002; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); ASSERT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); packet_.seqNum = 0xFFF0; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); EXPECT_EQ( -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); packet_.seqNum = 0x0006; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); EXPECT_EQ( @@ -340,7 +340,7 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) { // Insert out of bound regular packets, and then the first and last packet. // Verify that correct bounds are maintained. packet_.seqNum = 0x0003; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); EXPECT_EQ(packet_buffer_size(), @@ -348,27 +348,27 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) { kNoErrors, frame_data))); // Insert an older packet with a first packet set. packet_.seqNum = 0x0005; - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.markerBit = false; FillPacket(1); EXPECT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); packet_.seqNum = 0x0004; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); EXPECT_EQ( -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); packet_.seqNum = 0x0010; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); EXPECT_EQ(packet_buffer_size(), static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); packet_.seqNum = 0x0008; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = true; FillPacket(1); EXPECT_EQ(packet_buffer_size(), @@ -376,7 +376,7 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) { kNoErrors, frame_data))); packet_.seqNum = 0x0009; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.markerBit = false; FillPacket(1); EXPECT_EQ( @@ -384,7 +384,7 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) { } TEST_F(TestNalUnits, OnlyReceivedEmptyPacket) { - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluComplete; packet_.frameType = kEmptyFrame; packet_.sizeBytes = 0; @@ -398,7 +398,7 @@ TEST_F(TestNalUnits, OnlyReceivedEmptyPacket) { } TEST_F(TestNalUnits, OneIsolatedNaluLoss) { - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.completeNALU = kNaluComplete; packet_.seqNum = 0; packet_.markerBit = false; @@ -407,7 +407,7 @@ TEST_F(TestNalUnits, OneIsolatedNaluLoss) { static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluComplete; packet_.seqNum += 2; packet_.markerBit = true; @@ -425,7 +425,7 @@ TEST_F(TestNalUnits, OneIsolatedNaluLoss) { } TEST_F(TestNalUnits, LossInMiddleOfNalu) { - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.completeNALU = kNaluComplete; packet_.seqNum = 0; packet_.markerBit = false; @@ -434,7 +434,7 @@ TEST_F(TestNalUnits, LossInMiddleOfNalu) { static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluEnd; packet_.seqNum += 2; packet_.markerBit = true; @@ -450,7 +450,7 @@ TEST_F(TestNalUnits, LossInMiddleOfNalu) { } TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) { - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.completeNALU = kNaluComplete; packet_.seqNum = 0; packet_.markerBit = false; @@ -459,7 +459,7 @@ TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) { static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluIncomplete; packet_.seqNum += 2; packet_.markerBit = false; @@ -476,7 +476,7 @@ TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) { TEST_F(TestNalUnits, ReorderWrapNoLoss) { packet_.seqNum = 0xFFFF; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluIncomplete; packet_.seqNum += 1; packet_.markerBit = false; @@ -485,7 +485,7 @@ TEST_F(TestNalUnits, ReorderWrapNoLoss) { static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); - packet_.isFirstPacket = true; + packet_.is_first_packet_in_frame = true; packet_.completeNALU = kNaluComplete; packet_.seqNum -= 1; packet_.markerBit = false; @@ -494,7 +494,7 @@ TEST_F(TestNalUnits, ReorderWrapNoLoss) { static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluEnd; packet_.seqNum += 2; packet_.markerBit = true; @@ -511,7 +511,7 @@ TEST_F(TestNalUnits, ReorderWrapNoLoss) { TEST_F(TestNalUnits, WrapLosses) { packet_.seqNum = 0xFFFF; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluIncomplete; packet_.markerBit = false; FillPacket(1); @@ -519,7 +519,7 @@ TEST_F(TestNalUnits, WrapLosses) { static_cast(session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data))); - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluEnd; packet_.seqNum += 2; packet_.markerBit = true; @@ -535,7 +535,7 @@ TEST_F(TestNalUnits, WrapLosses) { TEST_F(TestNalUnits, ReorderWrapLosses) { packet_.seqNum = 0xFFFF; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluEnd; packet_.seqNum += 2; packet_.markerBit = true; @@ -545,7 +545,7 @@ TEST_F(TestNalUnits, ReorderWrapLosses) { kNoErrors, frame_data))); packet_.seqNum -= 2; - packet_.isFirstPacket = false; + packet_.is_first_packet_in_frame = false; packet_.completeNALU = kNaluIncomplete; packet_.markerBit = false; FillPacket(1); diff --git a/webrtc/modules/video_coding/test/stream_generator.cc b/webrtc/modules/video_coding/test/stream_generator.cc index a33ec9a432..73362c732d 100644 --- a/webrtc/modules/video_coding/test/stream_generator.cc +++ b/webrtc/modules/video_coding/test/stream_generator.cc @@ -62,11 +62,11 @@ VCMPacket StreamGenerator::GeneratePacket(uint16_t sequence_number, packet.seqNum = sequence_number; packet.timestamp = timestamp; packet.frameType = type; - packet.isFirstPacket = first_packet; + packet.is_first_packet_in_frame = first_packet; packet.markerBit = marker_bit; packet.sizeBytes = size; packet.dataPtr = packet_buffer_; - if (packet.isFirstPacket) + if (packet.is_first_packet_in_frame) packet.completeNALU = kNaluStart; else if (packet.markerBit) packet.completeNALU = kNaluEnd; diff --git a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc index f407ba2094..55a05720c3 100644 --- a/webrtc/modules/video_coding/video_coding_robustness_unittest.cc +++ b/webrtc/modules/video_coding/video_coding_robustness_unittest.cc @@ -66,7 +66,7 @@ class VCMRobustnessTest : public ::testing::Test { rtp_info.header.payloadType = video_codec_.plType; rtp_info.type.Video.codec = kRtpVideoVp8; rtp_info.type.Video.codecHeader.VP8.InitRTPVideoHeaderVP8(); - rtp_info.type.Video.isFirstPacket = first; + rtp_info.type.Video.is_first_packet_in_frame = first; ASSERT_EQ(VCM_OK, vcm_->IncomingPacket(payload, kPayloadLen, rtp_info)); } diff --git a/webrtc/modules/video_coding/video_packet_buffer_unittest.cc b/webrtc/modules/video_coding/video_packet_buffer_unittest.cc index 1e2ef3ec2a..57f3ef84e7 100644 --- a/webrtc/modules/video_coding/video_packet_buffer_unittest.cc +++ b/webrtc/modules/video_coding/video_packet_buffer_unittest.cc @@ -59,7 +59,7 @@ class TestPacketBuffer : public ::testing::Test, packet.codec = kVideoCodecGeneric; packet.seqNum = seq_num; packet.frameType = keyframe ? kVideoFrameKey : kVideoFrameDelta; - packet.isFirstPacket = first == kFirst; + packet.is_first_packet_in_frame = first == kFirst; packet.markerBit = last == kLast; packet.sizeBytes = data_size; packet.dataPtr = data; @@ -138,14 +138,14 @@ TEST_F(TestPacketBuffer, NackCount) { packet.codec = kVideoCodecGeneric; packet.seqNum = seq_num; packet.frameType = kVideoFrameKey; - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.markerBit = false; packet.timesNacked = 0; packet_buffer_->InsertPacket(&packet); packet.seqNum++; - packet.isFirstPacket = false; + packet.is_first_packet_in_frame = false; packet.timesNacked = 1; packet_buffer_->InsertPacket(&packet); @@ -363,7 +363,7 @@ TEST_F(TestPacketBuffer, GetBitstreamH264BufferPadding) { packet.video_header.codecHeader.H264.packetization_type = kH264SingleNalu; packet.dataPtr = data; packet.sizeBytes = sizeof(data_data); - packet.isFirstPacket = true; + packet.is_first_packet_in_frame = true; packet.markerBit = true; packet_buffer_->InsertPacket(&packet); diff --git a/webrtc/modules/video_coding/video_receiver_unittest.cc b/webrtc/modules/video_coding/video_receiver_unittest.cc index f7241ca408..9cac45b86b 100644 --- a/webrtc/modules/video_coding/video_receiver_unittest.cc +++ b/webrtc/modules/video_coding/video_receiver_unittest.cc @@ -123,14 +123,14 @@ TEST_F(TestVideoReceiver, PaddingOnlyFramesWithLosses) { header.type.Video.codec = kRtpVideoVp8; // Insert one video frame to get one frame decoded. header.frameType = kVideoFrameKey; - header.type.Video.isFirstPacket = true; + header.type.Video.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.isFirstPacket = false; + header.type.Video.is_first_packet_in_frame = false; header.header.markerBit = false; // Insert padding frames. for (int i = 0; i < 10; ++i) { @@ -166,7 +166,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) { WebRtcRTPHeader header; memset(&header, 0, sizeof(header)); header.frameType = kEmptyFrame; - header.type.Video.isFirstPacket = false; + header.type.Video.is_first_packet_in_frame = false; header.header.markerBit = false; header.header.paddingLength = kPaddingSize; header.header.payloadType = kUnusedPayloadType; @@ -182,7 +182,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) { header.frameType = kVideoFrameKey; else header.frameType = kVideoFrameDelta; - header.type.Video.isFirstPacket = true; + header.type.Video.is_first_packet_in_frame = true; header.header.markerBit = true; InsertAndVerifyDecodableFrame(payload, kFrameSize, &header); clock_.AdvanceTimeMilliseconds(33); @@ -191,7 +191,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) { // Insert 2 padding only frames. header.frameType = kEmptyFrame; - header.type.Video.isFirstPacket = false; + header.type.Video.is_first_packet_in_frame = false; header.header.markerBit = false; for (int j = 0; j < 2; ++j) { // InsertAndVerifyPaddingFrame(payload, &header); diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc index e0f9962c6e..766b938b67 100644 --- a/webrtc/video/video_send_stream_tests.cc +++ b/webrtc/video/video_send_stream_tests.cc @@ -2956,7 +2956,7 @@ class Vp9HeaderObserver : public test::SendTest { bool new_frame = packets_sent_ == 0 || IsNewerTimestamp(header.timestamp, last_header_.timestamp); - EXPECT_EQ(new_frame, video.isFirstPacket); + EXPECT_EQ(new_frame, video.is_first_packet_in_frame); if (!new_frame) { EXPECT_FALSE(last_header_.markerBit); EXPECT_EQ(last_header_.timestamp, header.timestamp);