Rename RTPVideoHeader.isFirstPacket to .is_first_packet_in_frame.

Name should represent the actual meaning.

BUG=None

Review-Url: https://codereview.webrtc.org/2574943003
Cr-Commit-Position: refs/heads/master@{#15684}
This commit is contained in:
johan
2016-12-19 08:32:24 -08:00
committed by Commit bot
parent 1865a15b9a
commit efde908380
25 changed files with 209 additions and 208 deletions

View File

@ -58,7 +58,7 @@ struct RTPVideoHeader {
PlayoutDelay playout_delay; PlayoutDelay playout_delay;
bool isFirstPacket; // first packet in frame bool is_first_packet_in_frame;
uint8_t simulcastIdx; // Index if the simulcast encoder creating uint8_t simulcastIdx; // Index if the simulcast encoder creating
// this frame, 0 if not using simulcast. // this frame, 0 if not using simulcast.
RtpVideoCodecTypes codec; RtpVideoCodecTypes codec;

View File

@ -393,7 +393,7 @@ bool RtpDepacketizerH264::ProcessStapAOrSingleNalu(
parsed_payload->type.Video.width = 0; parsed_payload->type.Video.width = 0;
parsed_payload->type.Video.height = 0; parsed_payload->type.Video.height = 0;
parsed_payload->type.Video.codec = kRtpVideoH264; 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 = RTPVideoHeaderH264* h264_header =
&parsed_payload->type.Video.codecHeader.H264; &parsed_payload->type.Video.codecHeader.H264;
@ -614,7 +614,7 @@ bool RtpDepacketizerH264::ParseFuaNalu(
parsed_payload->type.Video.width = 0; parsed_payload->type.Video.width = 0;
parsed_payload->type.Video.height = 0; parsed_payload->type.Video.height = 0;
parsed_payload->type.Video.codec = kRtpVideoH264; 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; RTPVideoHeaderH264* h264 = &parsed_payload->type.Video.codecHeader.H264;
h264->packetization_type = kH264FuA; h264->packetization_type = kH264FuA;
h264->nalu_type = original_nal_type; h264->nalu_type = original_nal_type;

View File

@ -565,7 +565,7 @@ TEST_F(RtpDepacketizerH264Test, TestSingleNalu) {
ExpectPacket(&payload, packet, sizeof(packet)); ExpectPacket(&payload, packet, sizeof(packet));
EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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, EXPECT_EQ(kH264SingleNalu,
payload.type.Video.codecHeader.H264.packetization_type); payload.type.Video.codecHeader.H264.packetization_type);
EXPECT_EQ(kIdr, payload.type.Video.codecHeader.H264.nalu_type); EXPECT_EQ(kIdr, payload.type.Video.codecHeader.H264.nalu_type);
@ -581,7 +581,7 @@ TEST_F(RtpDepacketizerH264Test, TestSingleNaluSpsWithResolution) {
ExpectPacket(&payload, packet, sizeof(packet)); ExpectPacket(&payload, packet, sizeof(packet));
EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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, EXPECT_EQ(kH264SingleNalu,
payload.type.Video.codecHeader.H264.packetization_type); payload.type.Video.codecHeader.H264.packetization_type);
EXPECT_EQ(1280u, payload.type.Video.width); EXPECT_EQ(1280u, payload.type.Video.width);
@ -611,7 +611,7 @@ TEST_F(RtpDepacketizerH264Test, TestStapAKey) {
ExpectPacket(&payload, packet, sizeof(packet)); ExpectPacket(&payload, packet, sizeof(packet));
EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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; const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
EXPECT_EQ(kH264StapA, h264.packetization_type); EXPECT_EQ(kH264StapA, h264.packetization_type);
// NALU type for aggregated packets is the type of the first packet only. // 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)); ExpectPacket(&payload, packet, sizeof(packet));
EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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(kH264StapA, payload.type.Video.codecHeader.H264.packetization_type);
EXPECT_EQ(1280u, payload.type.Video.width); EXPECT_EQ(1280u, payload.type.Video.width);
EXPECT_EQ(720u, payload.type.Video.height); EXPECT_EQ(720u, payload.type.Video.height);
@ -769,7 +769,7 @@ TEST_F(RtpDepacketizerH264Test, TestStapADelta) {
ExpectPacket(&payload, packet, sizeof(packet)); ExpectPacket(&payload, packet, sizeof(packet));
EXPECT_EQ(kVideoFrameDelta, payload.frame_type); EXPECT_EQ(kVideoFrameDelta, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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(kH264StapA, payload.type.Video.codecHeader.H264.packetization_type);
// NALU type for aggregated packets is the type of the first packet only. // NALU type for aggregated packets is the type of the first packet only.
EXPECT_EQ(kSlice, payload.type.Video.codecHeader.H264.nalu_type); EXPECT_EQ(kSlice, payload.type.Video.codecHeader.H264.nalu_type);
@ -808,7 +808,7 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) {
ExpectPacket(&payload, kExpected1, sizeof(kExpected1)); ExpectPacket(&payload, kExpected1, sizeof(kExpected1));
EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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; const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
EXPECT_EQ(kH264FuA, h264.packetization_type); EXPECT_EQ(kH264FuA, h264.packetization_type);
EXPECT_EQ(kIdr, h264.nalu_type); EXPECT_EQ(kIdr, h264.nalu_type);
@ -824,7 +824,7 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) {
ExpectPacket(&payload, kExpected2, sizeof(kExpected2)); ExpectPacket(&payload, kExpected2, sizeof(kExpected2));
EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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; const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
EXPECT_EQ(kH264FuA, h264.packetization_type); EXPECT_EQ(kH264FuA, h264.packetization_type);
@ -838,7 +838,7 @@ TEST_F(RtpDepacketizerH264Test, TestFuA) {
ExpectPacket(&payload, kExpected3, sizeof(kExpected3)); ExpectPacket(&payload, kExpected3, sizeof(kExpected3));
EXPECT_EQ(kVideoFrameKey, payload.frame_type); EXPECT_EQ(kVideoFrameKey, payload.frame_type);
EXPECT_EQ(kRtpVideoH264, payload.type.Video.codec); 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; const RTPVideoHeaderH264& h264 = payload.type.Video.codecHeader.H264;
EXPECT_EQ(kH264FuA, h264.packetization_type); EXPECT_EQ(kH264FuA, h264.packetization_type);

View File

@ -105,7 +105,7 @@ bool RtpDepacketizerGeneric::Parse(ParsedPayload* parsed_payload,
((generic_header & RtpFormatVideoGeneric::kKeyFrameBit) != 0) ((generic_header & RtpFormatVideoGeneric::kKeyFrameBit) != 0)
? kVideoFrameKey ? kVideoFrameKey
: kVideoFrameDelta; : kVideoFrameDelta;
parsed_payload->type.Video.isFirstPacket = parsed_payload->type.Video.is_first_packet_in_frame =
(generic_header & RtpFormatVideoGeneric::kFirstPacketBit) != 0; (generic_header & RtpFormatVideoGeneric::kFirstPacketBit) != 0;
parsed_payload->type.Video.codec = kRtpVideoGeneric; parsed_payload->type.Video.codec = kRtpVideoGeneric;
parsed_payload->type.Video.width = 0; parsed_payload->type.Video.width = 0;

View File

@ -682,7 +682,7 @@ bool RtpDepacketizerVp8::Parse(ParsedPayload* parsed_payload,
parsed_payload->type.Video.width = 0; parsed_payload->type.Video.width = 0;
parsed_payload->type.Video.height = 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); beginning_of_partition && (partition_id == 0);
parsed_payload->type.Video.simulcastIdx = 0; parsed_payload->type.Video.simulcastIdx = 0;
parsed_payload->type.Video.codec = kRtpVideoVp8; parsed_payload->type.Video.codec = kRtpVideoVp8;

View File

@ -728,7 +728,7 @@ bool RtpDepacketizerVp9::Parse(ParsedPayload* parsed_payload,
parsed_payload->type.Video.height = vp9->height[0]; 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); b_bit && (!l_bit || !vp9->inter_layer_predicted);
uint64_t rem_bits = parser.RemainingBitCount(); uint64_t rem_bits = parser.RemainingBitCount();

View File

@ -689,7 +689,7 @@ TEST_F(RtpDepacketizerVp9Test, ParseFirstPacketInKeyFrame) {
RtpDepacketizer::ParsedPayload parsed; RtpDepacketizer::ParsedPayload parsed;
ASSERT_TRUE(depacketizer_->Parse(&parsed, packet, sizeof(packet))); ASSERT_TRUE(depacketizer_->Parse(&parsed, packet, sizeof(packet)));
EXPECT_EQ(kVideoFrameKey, parsed.frame_type); 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) { TEST_F(RtpDepacketizerVp9Test, ParseLastPacketInDeltaFrame) {
@ -699,7 +699,7 @@ TEST_F(RtpDepacketizerVp9Test, ParseLastPacketInDeltaFrame) {
RtpDepacketizer::ParsedPayload parsed; RtpDepacketizer::ParsedPayload parsed;
ASSERT_TRUE(depacketizer_->Parse(&parsed, packet, sizeof(packet))); ASSERT_TRUE(depacketizer_->Parse(&parsed, packet, sizeof(packet)));
EXPECT_EQ(kVideoFrameDelta, parsed.frame_type); 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) { TEST_F(RtpDepacketizerVp9Test, ParseResolution) {

View File

@ -82,7 +82,7 @@ int32_t RTPReceiverVideo::ParseRtpPacket(WebRtcRTPHeader* rtp_header,
return -1; 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; RtpDepacketizer::ParsedPayload parsed_payload;
if (!depacketizer->Parse(&parsed_payload, payload, payload_data_length)) if (!depacketizer->Parse(&parsed_payload, payload, payload_data_length))
return -1; return -1;

View File

@ -32,7 +32,7 @@ TEST(TestDecodingState, FrameContinuity) {
VCMFrameBuffer frame; VCMFrameBuffer frame;
VCMFrameBuffer frame_key; VCMFrameBuffer frame_key;
VCMPacket packet; VCMPacket packet;
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.timestamp = 1; packet.timestamp = 1;
packet.seqNum = 0xffff; packet.seqNum = 0xffff;
packet.frameType = kVideoFrameDelta; packet.frameType = kVideoFrameDelta;
@ -52,7 +52,7 @@ TEST(TestDecodingState, FrameContinuity) {
frame.Reset(); frame.Reset();
packet.frameType = kVideoFrameDelta; packet.frameType = kVideoFrameDelta;
// Use pictureId // Use pictureId
packet.isFirstPacket = false; packet.is_first_packet_in_frame = false;
packet.video_header.codecHeader.VP8.pictureId = 0x0002; packet.video_header.codecHeader.VP8.pictureId = 0x0002;
EXPECT_LE(0, frame.InsertPacket(packet, 0, kNoErrors, frame_data)); EXPECT_LE(0, frame.InsertPacket(packet, 0, kNoErrors, frame_data));
EXPECT_FALSE(dec_state.ContinuousFrame(&frame)); EXPECT_FALSE(dec_state.ContinuousFrame(&frame));
@ -260,7 +260,7 @@ TEST(TestDecodingState, MultiLayerBehavior) {
// A key frame is always a base layer. // A key frame is always a base layer.
frame.Reset(); frame.Reset();
packet.frameType = kVideoFrameKey; packet.frameType = kVideoFrameKey;
packet.isFirstPacket = 1; packet.is_first_packet_in_frame = 1;
packet.timestamp = 5; packet.timestamp = 5;
packet.seqNum = 5; packet.seqNum = 5;
packet.video_header.codecHeader.VP8.tl0PicIdx = 2; packet.video_header.codecHeader.VP8.tl0PicIdx = 2;
@ -284,7 +284,7 @@ TEST(TestDecodingState, MultiLayerBehavior) {
EXPECT_TRUE(dec_state.full_sync()); EXPECT_TRUE(dec_state.full_sync());
frame.Reset(); frame.Reset();
packet.frameType = kVideoFrameDelta; packet.frameType = kVideoFrameDelta;
packet.isFirstPacket = 1; packet.is_first_packet_in_frame = 1;
packet.timestamp = 8; packet.timestamp = 8;
packet.seqNum = 8; packet.seqNum = 8;
packet.video_header.codecHeader.VP8.tl0PicIdx = 4; packet.video_header.codecHeader.VP8.tl0PicIdx = 4;
@ -299,7 +299,7 @@ TEST(TestDecodingState, MultiLayerBehavior) {
// Insert a non-ref frame - should update sync value. // Insert a non-ref frame - should update sync value.
frame.Reset(); frame.Reset();
packet.frameType = kVideoFrameDelta; packet.frameType = kVideoFrameDelta;
packet.isFirstPacket = 1; packet.is_first_packet_in_frame = 1;
packet.timestamp = 9; packet.timestamp = 9;
packet.seqNum = 9; packet.seqNum = 9;
packet.video_header.codecHeader.VP8.tl0PicIdx = 4; packet.video_header.codecHeader.VP8.tl0PicIdx = 4;
@ -319,7 +319,7 @@ TEST(TestDecodingState, MultiLayerBehavior) {
frame.Reset(); frame.Reset();
dec_state.Reset(); dec_state.Reset();
packet.frameType = kVideoFrameDelta; packet.frameType = kVideoFrameDelta;
packet.isFirstPacket = 1; packet.is_first_packet_in_frame = 1;
packet.markerBit = 1; packet.markerBit = 1;
packet.timestamp = 0; packet.timestamp = 0;
packet.seqNum = 0; packet.seqNum = 0;
@ -333,7 +333,7 @@ TEST(TestDecodingState, MultiLayerBehavior) {
// Layer 2 - 2 packets (insert one, lose one). // Layer 2 - 2 packets (insert one, lose one).
frame.Reset(); frame.Reset();
packet.frameType = kVideoFrameDelta; packet.frameType = kVideoFrameDelta;
packet.isFirstPacket = 1; packet.is_first_packet_in_frame = 1;
packet.markerBit = 0; packet.markerBit = 0;
packet.timestamp = 1; packet.timestamp = 1;
packet.seqNum = 1; packet.seqNum = 1;
@ -346,7 +346,7 @@ TEST(TestDecodingState, MultiLayerBehavior) {
// Layer 1 // Layer 1
frame.Reset(); frame.Reset();
packet.frameType = kVideoFrameDelta; packet.frameType = kVideoFrameDelta;
packet.isFirstPacket = 1; packet.is_first_packet_in_frame = 1;
packet.markerBit = 1; packet.markerBit = 1;
packet.timestamp = 2; packet.timestamp = 2;
packet.seqNum = 3; packet.seqNum = 3;
@ -450,7 +450,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeKeyFrame) {
VCMDecodingState dec_state; VCMDecodingState dec_state;
VCMFrameBuffer frame; VCMFrameBuffer frame;
VCMPacket packet; VCMPacket packet;
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.timestamp = 1; packet.timestamp = 1;
packet.seqNum = 0xffff; packet.seqNum = 0xffff;
uint8_t data[] = "I need a data pointer for this test!"; uint8_t data[] = "I need a data pointer for this test!";
@ -493,7 +493,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeOutOfOrderFrames) {
VCMDecodingState dec_state; VCMDecodingState dec_state;
VCMFrameBuffer frame; VCMFrameBuffer frame;
VCMPacket packet; VCMPacket packet;
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.timestamp = 1; packet.timestamp = 1;
packet.seqNum = 0xffff; packet.seqNum = 0xffff;
uint8_t data[] = "I need a data pointer for this test!"; uint8_t data[] = "I need a data pointer for this test!";
@ -548,7 +548,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeGeneral) {
VCMDecodingState dec_state; VCMDecodingState dec_state;
VCMFrameBuffer frame; VCMFrameBuffer frame;
VCMPacket packet; VCMPacket packet;
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.timestamp = 1; packet.timestamp = 1;
packet.seqNum = 0xffff; packet.seqNum = 0xffff;
uint8_t data[] = "I need a data pointer for this test!"; uint8_t data[] = "I need a data pointer for this test!";

View File

@ -161,7 +161,7 @@ VCMFrameBufferEnum VCMFrameBuffer::InsertPacket(
_rotation_set = true; _rotation_set = true;
} }
if (packet.isFirstPacket) { if (packet.is_first_packet_in_frame) {
playout_delay_ = packet.video_header.playout_delay; playout_delay_ = packet.video_header.playout_delay;
} }

View File

@ -67,7 +67,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream(
// If this is the first packet of an IDR, make sure we have the required // 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 // 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. // 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) { if (nalu.pps_id == -1) {
LOG(LS_WARNING) << "No PPS id in IDR nalu."; LOG(LS_WARNING) << "No PPS id in IDR nalu.";
return kRequestKeyframe; return kRequestKeyframe;
@ -108,7 +108,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream(
if (codec_header.packetization_type == kH264StapA) { if (codec_header.packetization_type == kH264StapA) {
const uint8_t* nalu_ptr = data + 1; const uint8_t* nalu_ptr = data + 1;
while (nalu_ptr < data + data_size) { 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); required_size += sizeof(start_code_h264);
// The first two bytes describe the length of a segment. // The first two bytes describe the length of a segment.
@ -119,7 +119,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream(
nalu_ptr += segment_length; nalu_ptr += segment_length;
} }
} else { } else {
if (video_header.isFirstPacket) if (video_header.is_first_packet_in_frame)
required_size += sizeof(start_code_h264); required_size += sizeof(start_code_h264);
required_size += data_size; required_size += data_size;
} }
@ -167,7 +167,7 @@ H264SpsPpsTracker::PacketAction H264SpsPpsTracker::CopyAndFixBitstream(
nalu_ptr += segment_length; nalu_ptr += segment_length;
} }
} else { } else {
if (video_header.isFirstPacket) { if (video_header.is_first_packet_in_frame) {
memcpy(insert_at, start_code_h264, sizeof(start_code_h264)); memcpy(insert_at, start_code_h264, sizeof(start_code_h264));
insert_at += sizeof(start_code_h264); insert_at += sizeof(start_code_h264);
} }

View File

@ -29,7 +29,7 @@ class TestH264SpsPpsTracker : public ::testing::Test {
VCMPacket packet; VCMPacket packet;
packet.codec = kVideoCodecH264; packet.codec = kVideoCodecH264;
packet.video_header.codecHeader.H264.nalus_length = 0; 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; packet.video_header.codecHeader.H264.packetization_type = kH264SingleNalu;
return packet; return packet;
@ -96,7 +96,7 @@ TEST_F(TestH264SpsPpsTracker, FuAFirstPacket) {
uint8_t data[] = {1, 2, 3}; uint8_t data[] = {1, 2, 3};
VCMPacket packet = GetDefaultPacket(); VCMPacket packet = GetDefaultPacket();
packet.video_header.codecHeader.H264.packetization_type = kH264FuA; 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.dataPtr = data;
packet.sizeBytes = sizeof(data); packet.sizeBytes = sizeof(data);
@ -112,7 +112,7 @@ TEST_F(TestH264SpsPpsTracker, StapAIncorrectSegmentLength) {
uint8_t data[] = {0, 0, 2, 0}; uint8_t data[] = {0, 0, 2, 0};
VCMPacket packet = GetDefaultPacket(); VCMPacket packet = GetDefaultPacket();
packet.video_header.codecHeader.H264.packetization_type = kH264StapA; 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.dataPtr = data;
packet.sizeBytes = sizeof(data); packet.sizeBytes = sizeof(data);
@ -122,7 +122,7 @@ TEST_F(TestH264SpsPpsTracker, StapAIncorrectSegmentLength) {
TEST_F(TestH264SpsPpsTracker, NoNalusFirstPacket) { TEST_F(TestH264SpsPpsTracker, NoNalusFirstPacket) {
uint8_t data[] = {1, 2, 3}; uint8_t data[] = {1, 2, 3};
VCMPacket packet = GetDefaultPacket(); VCMPacket packet = GetDefaultPacket();
packet.video_header.isFirstPacket = true; packet.video_header.is_first_packet_in_frame = true;
packet.dataPtr = data; packet.dataPtr = data;
packet.sizeBytes = sizeof(data); packet.sizeBytes = sizeof(data);
@ -151,7 +151,7 @@ TEST_F(TestH264SpsPpsTracker, IdrNoSpsPpsInserted) {
TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsPpsInserted) { TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsPpsInserted) {
std::vector<uint8_t> data = {1, 2, 3}; std::vector<uint8_t> data = {1, 2, 3};
VCMPacket packet = GetDefaultPacket(); VCMPacket packet = GetDefaultPacket();
packet.video_header.isFirstPacket = true; packet.video_header.is_first_packet_in_frame = true;
AddIdr(&packet, 0); AddIdr(&packet, 0);
packet.dataPtr = data.data(); packet.dataPtr = data.data();
@ -164,7 +164,7 @@ TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsPpsInserted) {
TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoPpsInserted) { TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoPpsInserted) {
std::vector<uint8_t> data = {1, 2, 3}; std::vector<uint8_t> data = {1, 2, 3};
VCMPacket packet = GetDefaultPacket(); VCMPacket packet = GetDefaultPacket();
packet.video_header.isFirstPacket = true; packet.video_header.is_first_packet_in_frame = true;
AddSps(&packet, 0, &data); AddSps(&packet, 0, &data);
AddIdr(&packet, 0); AddIdr(&packet, 0);
@ -178,7 +178,7 @@ TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoPpsInserted) {
TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsInserted) { TEST_F(TestH264SpsPpsTracker, IdrFirstPacketNoSpsInserted) {
std::vector<uint8_t> data = {1, 2, 3}; std::vector<uint8_t> data = {1, 2, 3};
VCMPacket packet = GetDefaultPacket(); VCMPacket packet = GetDefaultPacket();
packet.video_header.isFirstPacket = true; packet.video_header.is_first_packet_in_frame = true;
AddPps(&packet, 0, 0, &data); AddPps(&packet, 0, 0, &data);
AddIdr(&packet, 0); AddIdr(&packet, 0);
@ -204,7 +204,7 @@ TEST_F(TestH264SpsPpsTracker, SpsPpsPacketThenIdrFirstPacket) {
// Insert first packet of the IDR // Insert first packet of the IDR
VCMPacket idr_packet = GetDefaultPacket(); VCMPacket idr_packet = GetDefaultPacket();
idr_packet.video_header.isFirstPacket = true; idr_packet.video_header.is_first_packet_in_frame = true;
AddIdr(&idr_packet, 1); AddIdr(&idr_packet, 1);
data.insert(data.end(), {1, 2, 3}); data.insert(data.end(), {1, 2, 3});
idr_packet.dataPtr = data.data(); idr_packet.dataPtr = data.data();
@ -227,7 +227,7 @@ TEST_F(TestH264SpsPpsTracker, SpsPpsIdrInStapA) {
std::vector<uint8_t> data; std::vector<uint8_t> data;
VCMPacket packet = GetDefaultPacket(); VCMPacket packet = GetDefaultPacket();
packet.video_header.codecHeader.H264.packetization_type = kH264StapA; 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}); // First byte is ignored
data.insert(data.end(), {0, 2}); // Length of segment data.insert(data.end(), {0, 2}); // Length of segment

View File

@ -40,7 +40,7 @@ class Vp9SsMapTest : public ::testing::Test {
Vp9SsMapTest() : packet_() {} Vp9SsMapTest() : packet_() {}
virtual void SetUp() { virtual void SetUp() {
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.dataPtr = data_; packet_.dataPtr = data_;
packet_.sizeBytes = 1400; packet_.sizeBytes = 1400;
packet_.seqNum = 1234; packet_.seqNum = 1234;
@ -478,7 +478,7 @@ TEST_F(TestBasicJitterBuffer, SinglePacketFrame) {
// Always start with a complete key frame when not allowing errors. // Always start with a complete key frame when not allowing errors.
jitter_buffer_->SetDecodeErrorMode(kNoErrors); jitter_buffer_->SetDecodeErrorMode(kNoErrors);
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->timestamp += 123 * 90; packet_->timestamp += 123 * 90;
@ -497,7 +497,7 @@ TEST_F(TestBasicJitterBuffer, VerifyHistogramStats) {
// Always start with a complete key frame when not allowing errors. // Always start with a complete key frame when not allowing errors.
jitter_buffer_->SetDecodeErrorMode(kNoErrors); jitter_buffer_->SetDecodeErrorMode(kNoErrors);
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->timestamp += 123 * 90; packet_->timestamp += 123 * 90;
@ -532,7 +532,7 @@ TEST_F(TestBasicJitterBuffer, VerifyHistogramStats) {
TEST_F(TestBasicJitterBuffer, DualPacketFrame) { TEST_F(TestBasicJitterBuffer, DualPacketFrame) {
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
bool retransmitted = false; bool retransmitted = false;
@ -543,7 +543,7 @@ TEST_F(TestBasicJitterBuffer, DualPacketFrame) {
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
++seq_num_; ++seq_num_;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -559,7 +559,7 @@ TEST_F(TestBasicJitterBuffer, DualPacketFrame) {
TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) { TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) {
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
bool retransmitted = false; bool retransmitted = false;
@ -575,7 +575,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) {
int loop = 0; int loop = 0;
do { do {
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -586,7 +586,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) {
// Insert last packet. // Insert last packet.
++seq_num_; ++seq_num_;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -603,7 +603,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketKeyFrame) {
TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) { TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) {
// Always start with a complete key frame. // Always start with a complete key frame.
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
bool retransmitted = false; bool retransmitted = false;
@ -627,7 +627,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) {
// Frame should not be complete. // Frame should not be complete.
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
// Insert 98 frames. // Insert 98 frames.
int loop = 0; int loop = 0;
do { do {
@ -642,7 +642,7 @@ TEST_F(TestBasicJitterBuffer, 100PacketDeltaFrame) {
// Insert the last packet. // Insert the last packet.
++seq_num_; ++seq_num_;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -660,7 +660,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) {
// Insert the "first" packet last. // Insert the "first" packet last.
seq_num_ += 100; seq_num_ += 100;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -677,7 +677,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) {
int loop = 0; int loop = 0;
do { do {
seq_num_--; seq_num_--;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -688,7 +688,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) {
// Insert the last packet. // Insert the last packet.
seq_num_--; seq_num_--;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -705,7 +705,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseOrder) {
TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) { TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) {
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
bool retransmitted = false; bool retransmitted = false;
@ -717,7 +717,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) {
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -731,7 +731,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) {
seq_num_ -= 3; seq_num_ -= 3;
timestamp_ -= 33 * 90; timestamp_ -= 33 * 90;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -745,7 +745,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) {
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -765,7 +765,7 @@ TEST_F(TestBasicJitterBuffer, FrameReordering2Frames2PacketsEach) {
TEST_F(TestBasicJitterBuffer, TestReorderingWithPadding) { TEST_F(TestBasicJitterBuffer, TestReorderingWithPadding) {
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
// Send in an initial good packet/frame (Frame A) to start things off. // 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) { TEST_F(TestBasicJitterBuffer, DuplicatePackets) {
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -853,7 +853,7 @@ TEST_F(TestBasicJitterBuffer, DuplicatePackets) {
seq_num_++; seq_num_++;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->markerBit = true; packet_->markerBit = true;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
EXPECT_EQ(kCompleteSession, EXPECT_EQ(kCompleteSession,
jitter_buffer_->InsertPacket(*packet_, &retransmitted)); jitter_buffer_->InsertPacket(*packet_, &retransmitted));
@ -870,7 +870,7 @@ TEST_F(TestBasicJitterBuffer, DuplicatePackets) {
TEST_F(TestBasicJitterBuffer, DuplicatePreviousDeltaFramePacket) { TEST_F(TestBasicJitterBuffer, DuplicatePreviousDeltaFramePacket) {
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -933,7 +933,7 @@ TEST_F(TestBasicJitterBuffer, TestSkipForwardVp9) {
bool re = false; bool re = false;
packet_->codec = kVideoCodecVP9; packet_->codec = kVideoCodecVP9;
packet_->video_header.codec = kRtpVideoVp9; packet_->video_header.codec = kRtpVideoVp9;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->video_header.codecHeader.VP9.flexible_mode = false; packet_->video_header.codecHeader.VP9.flexible_mode = false;
packet_->video_header.codecHeader.VP9.spatial_idx = 0; packet_->video_header.codecHeader.VP9.spatial_idx = 0;
@ -986,7 +986,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_3TlLayers) {
bool re = false; bool re = false;
packet_->codec = kVideoCodecVP9; packet_->codec = kVideoCodecVP9;
packet_->video_header.codec = kRtpVideoVp9; packet_->video_header.codec = kRtpVideoVp9;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->video_header.codecHeader.VP9.flexible_mode = false; packet_->video_header.codecHeader.VP9.flexible_mode = false;
packet_->video_header.codecHeader.VP9.spatial_idx = 0; 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.end_of_frame = true;
packet_->video_header.codecHeader.VP9.tl0_pic_idx = 200; packet_->video_header.codecHeader.VP9.tl0_pic_idx = 200;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = 65486; packet_->seqNum = 65486;
packet_->timestamp = 6000; packet_->timestamp = 6000;
@ -1078,7 +1078,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) {
packet_->video_header.codecHeader.VP9.temporal_up_switch = true; packet_->video_header.codecHeader.VP9.temporal_up_switch = true;
EXPECT_EQ(kIncomplete, jitter_buffer_->InsertPacket(*packet_, &re)); EXPECT_EQ(kIncomplete, jitter_buffer_->InsertPacket(*packet_, &re));
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = 65487; packet_->seqNum = 65487;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
@ -1088,7 +1088,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) {
packet_->video_header.codecHeader.VP9.temporal_up_switch = true; packet_->video_header.codecHeader.VP9.temporal_up_switch = true;
EXPECT_EQ(kCompleteSession, jitter_buffer_->InsertPacket(*packet_, &re)); EXPECT_EQ(kCompleteSession, jitter_buffer_->InsertPacket(*packet_, &re));
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = 65485; packet_->seqNum = 65485;
packet_->timestamp = 3000; packet_->timestamp = 3000;
@ -1100,7 +1100,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) {
EXPECT_EQ(kIncomplete, jitter_buffer_->InsertPacket(*packet_, &re)); EXPECT_EQ(kIncomplete, jitter_buffer_->InsertPacket(*packet_, &re));
// Insert first frame with SS data. // Insert first frame with SS data.
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = 65484; packet_->seqNum = 65484;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
@ -1133,7 +1133,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) {
TEST_F(TestBasicJitterBuffer, H264InsertStartCode) { TEST_F(TestBasicJitterBuffer, H264InsertStartCode) {
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1149,7 +1149,7 @@ TEST_F(TestBasicJitterBuffer, H264InsertStartCode) {
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1167,7 +1167,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->codec = kVideoCodecH264; packet_->codec = kVideoCodecH264;
packet_->video_header.codec = kRtpVideoH264; packet_->video_header.codec = kRtpVideoH264;
@ -1187,7 +1187,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
++seq_num_; ++seq_num_;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->codec = kVideoCodecH264; packet_->codec = kVideoCodecH264;
packet_->video_header.codec = kRtpVideoH264; packet_->video_header.codec = kRtpVideoH264;
@ -1206,7 +1206,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
++seq_num_; ++seq_num_;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->codec = kVideoCodecH264; packet_->codec = kVideoCodecH264;
packet_->video_header.codec = kRtpVideoH264; packet_->video_header.codec = kRtpVideoH264;
@ -1228,7 +1228,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
++seq_num_; ++seq_num_;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->codec = kVideoCodecH264; packet_->codec = kVideoCodecH264;
packet_->video_header.codec = kRtpVideoH264; 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 // Always start with a key frame. Use 10 packets to test Decodable State
// boundaries. // boundaries.
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1263,7 +1263,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) {
EXPECT_EQ(jitter_buffer_->NextCompleteFrame(0), nullptr); EXPECT_EQ(jitter_buffer_->NextCompleteFrame(0), nullptr);
EXPECT_FALSE(jitter_buffer_->NextMaybeIncompleteTimestamp(&timestamp)); EXPECT_FALSE(jitter_buffer_->NextMaybeIncompleteTimestamp(&timestamp));
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
for (int i = 1; i < 9; ++i) { for (int i = 1; i < 9; ++i) {
packet_->seqNum++; packet_->seqNum++;
EXPECT_EQ(kIncomplete, EXPECT_EQ(kIncomplete,
@ -1286,7 +1286,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) {
// An incomplete frame can only be decoded once a subsequent frame has begun // An incomplete frame can only be decoded once a subsequent frame has begun
// to arrive. Insert packet in distant frame for this purpose. // to arrive. Insert packet in distant frame for this purpose.
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum += 100; packet_->seqNum += 100;
packet_->timestamp += 33 * 90 * 8; packet_->timestamp += 33 * 90 * 8;
@ -1305,7 +1305,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsThresholdCheck) {
EXPECT_EQ(jitter_buffer_->NextCompleteFrame(0), nullptr); EXPECT_EQ(jitter_buffer_->NextCompleteFrame(0), nullptr);
EXPECT_TRUE(jitter_buffer_->NextMaybeIncompleteTimestamp(&timestamp)); EXPECT_TRUE(jitter_buffer_->NextMaybeIncompleteTimestamp(&timestamp));
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
for (int i = 1; i < 8; ++i) { for (int i = 1; i < 8; ++i) {
packet_->seqNum++; packet_->seqNum++;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
@ -1336,7 +1336,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsIncompleteKey) {
jitter_buffer_->SetDecodeErrorMode(kSelectiveErrors); jitter_buffer_->SetDecodeErrorMode(kSelectiveErrors);
// Always start with a key frame. // Always start with a key frame.
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1352,7 +1352,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsIncompleteKey) {
// An incomplete frame can only be decoded once a subsequent frame has begun // An incomplete frame can only be decoded once a subsequent frame has begun
// to arrive. Insert packet in distant frame for this purpose. // to arrive. Insert packet in distant frame for this purpose.
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum += 100; packet_->seqNum += 100;
packet_->timestamp += 33 * 90 * 8; packet_->timestamp += 33 * 90 * 8;
@ -1364,7 +1364,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsIncompleteKey) {
// Insert second frame - an incomplete key frame. // Insert second frame - an incomplete key frame.
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->seqNum -= 99; packet_->seqNum -= 99;
packet_->timestamp -= 33 * 90 * 7; 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 // Insert a few more packets. Make sure we're waiting for the key frame to be
// complete. // complete.
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
for (int i = 1; i < 5; ++i) { for (int i = 1; i < 5; ++i) {
packet_->seqNum++; packet_->seqNum++;
EXPECT_EQ(kIncomplete, EXPECT_EQ(kIncomplete,
@ -1400,7 +1400,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsMissingFirstPacket) {
jitter_buffer_->SetDecodeErrorMode(kSelectiveErrors); jitter_buffer_->SetDecodeErrorMode(kSelectiveErrors);
// Always start with a key frame. // Always start with a key frame.
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1416,7 +1416,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsMissingFirstPacket) {
// An incomplete frame can only be decoded once a subsequent frame has begun // An incomplete frame can only be decoded once a subsequent frame has begun
// to arrive. Insert packet in distant frame for this purpose. // to arrive. Insert packet in distant frame for this purpose.
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum += 100; packet_->seqNum += 100;
packet_->timestamp += 33 * 90 * 8; packet_->timestamp += 33 * 90 * 8;
@ -1445,7 +1445,7 @@ TEST_F(TestBasicJitterBuffer, PacketLossWithSelectiveErrorsMissingFirstPacket) {
} }
// Add first packet. Frame should now be decodable, but incomplete. // Add first packet. Frame should now be decodable, but incomplete.
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->seqNum -= 6; packet_->seqNum -= 6;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
jitter_buffer_->InsertPacket(*packet_, &retransmitted)); jitter_buffer_->InsertPacket(*packet_, &retransmitted));
@ -1462,7 +1462,7 @@ TEST_F(TestBasicJitterBuffer, DiscontinuousStreamWhenDecodingWithErrors) {
// Will use one packet per frame. // Will use one packet per frame.
jitter_buffer_->SetDecodeErrorMode(kWithErrors); jitter_buffer_->SetDecodeErrorMode(kWithErrors);
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1481,7 +1481,7 @@ TEST_F(TestBasicJitterBuffer, DiscontinuousStreamWhenDecodingWithErrors) {
timestamp_ += 2 * 33 * 90; timestamp_ += 2 * 33 * 90;
seq_num_ += 2; seq_num_ += 2;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1491,7 +1491,7 @@ TEST_F(TestBasicJitterBuffer, DiscontinuousStreamWhenDecodingWithErrors) {
timestamp_ += 33 * 90; timestamp_ += 33 * 90;
seq_num_ += 2; seq_num_ += 2;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1514,7 +1514,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) {
seq_num_ = 0xffff - 4; seq_num_ = 0xffff - 4;
seq_num_++; seq_num_++;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1528,7 +1528,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) {
seq_num_++; seq_num_++;
timestamp_ += 33 * 90; timestamp_ += 33 * 90;
packet_->frameType = frametype; packet_->frameType = frametype;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1543,7 +1543,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) {
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
seq_num_ += 2; seq_num_ += 2;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->completeNALU = kNaluEnd; packet_->completeNALU = kNaluEnd;
@ -1553,7 +1553,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) {
// Insert an empty (non-media) packet. // Insert an empty (non-media) packet.
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->completeNALU = kNaluEnd; packet_->completeNALU = kNaluEnd;
@ -1606,7 +1606,7 @@ TEST_F(TestBasicJitterBuffer, PacketLoss) {
TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) { TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) {
seq_num_ = 0xfff0; seq_num_ = 0xfff0;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1622,7 +1622,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) {
int loop = 0; int loop = 0;
do { do {
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1637,7 +1637,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrame100PacketsWithSeqNumWrap) {
} while (loop < 98); } while (loop < 98);
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1656,7 +1656,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseWithNegSeqNumWrap) {
// Insert "first" packet last seqnum. // Insert "first" packet last seqnum.
seq_num_ = 10; seq_num_ = 10;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1672,7 +1672,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseWithNegSeqNumWrap) {
int loop = 0; int loop = 0;
do { do {
seq_num_--; seq_num_--;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1688,7 +1688,7 @@ TEST_F(TestBasicJitterBuffer, PacketReorderingReverseWithNegSeqNumWrap) {
// Insert last packet. // Insert last packet.
seq_num_--; seq_num_--;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1709,7 +1709,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrame) {
seq_num_ = 2; seq_num_ = 2;
timestamp_ = 3000; timestamp_ = 3000;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1727,7 +1727,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrame) {
seq_num_--; seq_num_--;
timestamp_ = 2000; timestamp_ = 2000;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1744,7 +1744,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrameWithSeqNumWrap) {
seq_num_ = 2; seq_num_ = 2;
timestamp_ = 3000; timestamp_ = 3000;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1765,7 +1765,7 @@ TEST_F(TestBasicJitterBuffer, TestInsertOldFrameWithSeqNumWrap) {
seq_num_--; seq_num_--;
timestamp_ = 0xffffff00; timestamp_ = 0xffffff00;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1782,7 +1782,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) {
timestamp_ = 0xffffff00; timestamp_ = 0xffffff00;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1795,7 +1795,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) {
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1809,7 +1809,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) {
seq_num_++; seq_num_++;
timestamp_ += 33 * 90; timestamp_ += 33 * 90;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1821,7 +1821,7 @@ TEST_F(TestBasicJitterBuffer, TimestampWrap) {
EXPECT_TRUE(frame_out == NULL); EXPECT_TRUE(frame_out == NULL);
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1842,7 +1842,7 @@ TEST_F(TestBasicJitterBuffer, 2FrameWithTimestampWrap) {
timestamp_ = 0xffffff00; timestamp_ = 0xffffff00;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1855,7 +1855,7 @@ TEST_F(TestBasicJitterBuffer, 2FrameWithTimestampWrap) {
seq_num_++; seq_num_++;
timestamp_ = 2700; timestamp_ = 2700;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1885,7 +1885,7 @@ TEST_F(TestBasicJitterBuffer, Insert2FramesReOrderedWithTimestampWrap) {
seq_num_ = 2; seq_num_ = 2;
timestamp_ = 2700; timestamp_ = 2700;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1898,7 +1898,7 @@ TEST_F(TestBasicJitterBuffer, Insert2FramesReOrderedWithTimestampWrap) {
seq_num_--; seq_num_--;
timestamp_ = 0xffffff00; timestamp_ = 0xffffff00;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1926,7 +1926,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrameWithMoreThanMaxNumberOfPackets) {
// Insert kMaxPacketsInJitterBuffer into frame. // Insert kMaxPacketsInJitterBuffer into frame.
do { do {
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1945,7 +1945,7 @@ TEST_F(TestBasicJitterBuffer, DeltaFrameWithMoreThanMaxNumberOfPackets) {
// Max number of packets inserted. // Max number of packets inserted.
// Insert one more packet. // Insert one more packet.
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
@ -1976,7 +1976,7 @@ TEST_F(TestBasicJitterBuffer, ExceedNumOfFrameWithSeqNumWrap) {
do { do {
timestamp_ += 33 * 90; timestamp_ += 33 * 90;
seq_num_++; seq_num_++;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -1998,7 +1998,7 @@ TEST_F(TestBasicJitterBuffer, ExceedNumOfFrameWithSeqNumWrap) {
// Insert one more frame. // Insert one more frame.
timestamp_ += 33 * 90; timestamp_ += 33 * 90;
seq_num_++; seq_num_++;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -2024,7 +2024,7 @@ TEST_F(TestBasicJitterBuffer, EmptyLastFrame) {
for (int i = 0; i < maxSize + 10; i++) { for (int i = 0; i < maxSize + 10; i++) {
timestamp_ += 33 * 90; timestamp_ += 33 * 90;
seq_num_++; seq_num_++;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
@ -2049,7 +2049,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->completeNALU = kNaluStart; packet_->completeNALU = kNaluStart;
packet_->markerBit = false; packet_->markerBit = false;
bool retransmitted = false; bool retransmitted = false;
@ -2060,7 +2060,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
seq_num_ += 2; // Skip one packet. seq_num_ += 2; // Skip one packet.
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->completeNALU = kNaluIncomplete; packet_->completeNALU = kNaluIncomplete;
packet_->markerBit = false; packet_->markerBit = false;
@ -2070,7 +2070,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
seq_num_++; seq_num_++;
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->completeNALU = kNaluEnd; packet_->completeNALU = kNaluEnd;
packet_->markerBit = false; packet_->markerBit = false;
@ -2091,7 +2091,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = 1; packet_->seqNum = 1;
packet_->timestamp = timestamp_ + 33 * 90 * 10; packet_->timestamp = timestamp_ + 33 * 90 * 10;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->completeNALU = kNaluStart; packet_->completeNALU = kNaluStart;
packet_->markerBit = false; packet_->markerBit = false;
@ -2114,7 +2114,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->completeNALU = kNaluEnd; packet_->completeNALU = kNaluEnd;
packet_->markerBit = false; packet_->markerBit = false;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
@ -2124,7 +2124,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->completeNALU = kNaluStart; packet_->completeNALU = kNaluStart;
packet_->markerBit = false; packet_->markerBit = false;
@ -2136,7 +2136,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->completeNALU = kNaluComplete; packet_->completeNALU = kNaluComplete;
packet_->markerBit = false; packet_->markerBit = false;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
@ -2146,7 +2146,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->completeNALU = kNaluStart; packet_->completeNALU = kNaluStart;
packet_->markerBit = false; packet_->markerBit = false;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
@ -2158,7 +2158,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->completeNALU = kNaluEnd; packet_->completeNALU = kNaluEnd;
packet_->markerBit = true; packet_->markerBit = true;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
@ -2179,7 +2179,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
emptypacket.seqNum = seq_num_; emptypacket.seqNum = seq_num_;
emptypacket.timestamp = timestamp_; emptypacket.timestamp = timestamp_;
emptypacket.frameType = kVideoFrameKey; emptypacket.frameType = kVideoFrameKey;
emptypacket.isFirstPacket = true; emptypacket.is_first_packet_in_frame = true;
emptypacket.completeNALU = kNaluComplete; emptypacket.completeNALU = kNaluComplete;
emptypacket.markerBit = true; emptypacket.markerBit = true;
EXPECT_EQ(kCompleteSession, EXPECT_EQ(kCompleteSession,
@ -2200,7 +2200,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
packet_->seqNum = seq_num_; packet_->seqNum = seq_num_;
packet_->timestamp = timestamp_; packet_->timestamp = timestamp_;
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->completeNALU = kNaluComplete; packet_->completeNALU = kNaluComplete;
packet_->markerBit = false; packet_->markerBit = false;
@ -2211,7 +2211,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
emptypacket.seqNum = seq_num_; emptypacket.seqNum = seq_num_;
emptypacket.timestamp = timestamp_; emptypacket.timestamp = timestamp_;
emptypacket.frameType = kVideoFrameKey; emptypacket.frameType = kVideoFrameKey;
emptypacket.isFirstPacket = true; emptypacket.is_first_packet_in_frame = true;
emptypacket.completeNALU = kNaluComplete; emptypacket.completeNALU = kNaluComplete;
emptypacket.markerBit = true; emptypacket.markerBit = true;
EXPECT_EQ(kCompleteSession, EXPECT_EQ(kCompleteSession,
@ -2230,7 +2230,7 @@ TEST_F(TestBasicJitterBuffer, NextFrameWhenIncomplete) {
jitter_buffer_->SetDecodeErrorMode(kWithErrors); jitter_buffer_->SetDecodeErrorMode(kWithErrors);
// Start with a complete key frame - insert and decode. // Start with a complete key frame - insert and decode.
packet_->frameType = kVideoFrameKey; packet_->frameType = kVideoFrameKey;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
packet_->markerBit = true; packet_->markerBit = true;
bool retransmitted = false; bool retransmitted = false;
@ -2243,7 +2243,7 @@ TEST_F(TestBasicJitterBuffer, NextFrameWhenIncomplete) {
packet_->seqNum += 2; packet_->seqNum += 2;
packet_->timestamp += 33 * 90; packet_->timestamp += 33 * 90;
packet_->frameType = kVideoFrameDelta; packet_->frameType = kVideoFrameDelta;
packet_->isFirstPacket = false; packet_->is_first_packet_in_frame = false;
packet_->markerBit = false; packet_->markerBit = false;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
@ -2254,7 +2254,7 @@ TEST_F(TestBasicJitterBuffer, NextFrameWhenIncomplete) {
packet_->seqNum += 2; packet_->seqNum += 2;
packet_->timestamp += 33 * 90; packet_->timestamp += 33 * 90;
packet_->isFirstPacket = true; packet_->is_first_packet_in_frame = true;
EXPECT_EQ(kDecodableSession, EXPECT_EQ(kDecodableSession,
jitter_buffer_->InsertPacket(*packet_, &retransmitted)); jitter_buffer_->InsertPacket(*packet_, &retransmitted));

View File

@ -66,7 +66,8 @@ int NackModule::OnReceivedPacket(const VCMPacket& packet) {
// now set it to true, which will cause the reordering // now set it to true, which will cause the reordering
// statistics to never be updated. // statistics to never be updated.
bool is_retransmitted = true; 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_) { if (!initialized_) {
newest_seq_num_ = seq_num; newest_seq_num_ = seq_num;

View File

@ -72,7 +72,7 @@ TEST_F(TestNackModule, WrappingSeqNumClearToKeyframe) {
sent_nacks_.clear(); sent_nacks_.clear();
packet.frameType = kVideoFrameKey; packet.frameType = kVideoFrameKey;
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.seqNum = 2; packet.seqNum = 2;
nack_module_.OnReceivedPacket(packet); nack_module_.OnReceivedPacket(packet);
EXPECT_EQ(0u, sent_nacks_.size()); EXPECT_EQ(0u, sent_nacks_.size());
@ -239,11 +239,11 @@ TEST_F(TestNackModule, TooLargeNackListWithKeyFrame) {
packet.seqNum = 0; packet.seqNum = 0;
nack_module_.OnReceivedPacket(packet); nack_module_.OnReceivedPacket(packet);
packet.seqNum = 1; packet.seqNum = 1;
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.frameType = kVideoFrameKey; packet.frameType = kVideoFrameKey;
nack_module_.OnReceivedPacket(packet); nack_module_.OnReceivedPacket(packet);
packet.seqNum = 1001; packet.seqNum = 1001;
packet.isFirstPacket = false; packet.is_first_packet_in_frame = false;
packet.frameType = kVideoFrameKey; packet.frameType = kVideoFrameKey;
nack_module_.OnReceivedPacket(packet); nack_module_.OnReceivedPacket(packet);
EXPECT_EQ(999u, sent_nacks_.size()); EXPECT_EQ(999u, sent_nacks_.size());

View File

@ -27,7 +27,7 @@ VCMPacket::VCMPacket()
timesNacked(-1), timesNacked(-1),
frameType(kEmptyFrame), frameType(kEmptyFrame),
codec(kVideoCodecUnknown), codec(kVideoCodecUnknown),
isFirstPacket(false), is_first_packet_in_frame(false),
completeNALU(kNaluUnset), completeNALU(kNaluUnset),
insertStartCode(false), insertStartCode(false),
width(0), width(0),
@ -49,7 +49,7 @@ VCMPacket::VCMPacket(const uint8_t* ptr,
timesNacked(-1), timesNacked(-1),
frameType(rtpHeader.frameType), frameType(rtpHeader.frameType),
codec(kVideoCodecUnknown), codec(kVideoCodecUnknown),
isFirstPacket(rtpHeader.type.Video.isFirstPacket), is_first_packet_in_frame(rtpHeader.type.Video.is_first_packet_in_frame),
completeNALU(kNaluComplete), completeNALU(kNaluComplete),
insertStartCode(false), insertStartCode(false),
width(rtpHeader.type.Video.width), width(rtpHeader.type.Video.width),
@ -61,7 +61,7 @@ VCMPacket::VCMPacket(const uint8_t* ptr,
video_header.rotation = rtpHeader.type.Video.rotation; video_header.rotation = rtpHeader.type.Video.rotation;
} }
// Playout decisions are made entirely based on first packet in a frame. // 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; video_header.playout_delay = rtpHeader.type.Video.playout_delay;
} else { } else {
video_header.playout_delay = {-1, -1}; video_header.playout_delay = {-1, -1};
@ -79,7 +79,7 @@ void VCMPacket::Reset() {
timesNacked = -1; timesNacked = -1;
frameType = kEmptyFrame; frameType = kEmptyFrame;
codec = kVideoCodecUnknown; codec = kVideoCodecUnknown;
isFirstPacket = false; is_first_packet_in_frame = false;
completeNALU = kNaluUnset; completeNALU = kNaluUnset;
insertStartCode = false; insertStartCode = false;
width = 0; width = 0;
@ -93,9 +93,9 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
// Handle all packets within a frame as depending on the previous packet // Handle all packets within a frame as depending on the previous packet
// TODO(holmer): This should be changed to make fragments independent // TODO(holmer): This should be changed to make fragments independent
// when the VP8 RTP receiver supports fragments. // when the VP8 RTP receiver supports fragments.
if (isFirstPacket && markerBit) if (is_first_packet_in_frame && markerBit)
completeNALU = kNaluComplete; completeNALU = kNaluComplete;
else if (isFirstPacket) else if (is_first_packet_in_frame)
completeNALU = kNaluStart; completeNALU = kNaluStart;
else if (markerBit) else if (markerBit)
completeNALU = kNaluEnd; completeNALU = kNaluEnd;
@ -105,9 +105,9 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
codec = kVideoCodecVP8; codec = kVideoCodecVP8;
return; return;
case kRtpVideoVp9: case kRtpVideoVp9:
if (isFirstPacket && markerBit) if (is_first_packet_in_frame && markerBit)
completeNALU = kNaluComplete; completeNALU = kNaluComplete;
else if (isFirstPacket) else if (is_first_packet_in_frame)
completeNALU = kNaluStart; completeNALU = kNaluStart;
else if (markerBit) else if (markerBit)
completeNALU = kNaluEnd; completeNALU = kNaluEnd;
@ -117,13 +117,13 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
codec = kVideoCodecVP9; codec = kVideoCodecVP9;
return; return;
case kRtpVideoH264: case kRtpVideoH264:
isFirstPacket = videoHeader.isFirstPacket; is_first_packet_in_frame = videoHeader.is_first_packet_in_frame;
if (isFirstPacket) if (is_first_packet_in_frame)
insertStartCode = true; insertStartCode = true;
if (isFirstPacket && markerBit) { if (is_first_packet_in_frame && markerBit) {
completeNALU = kNaluComplete; completeNALU = kNaluComplete;
} else if (isFirstPacket) { } else if (is_first_packet_in_frame) {
completeNALU = kNaluStart; completeNALU = kNaluStart;
} else if (markerBit) { } else if (markerBit) {
completeNALU = kNaluEnd; completeNALU = kNaluEnd;

View File

@ -39,7 +39,7 @@ class VCMPacket {
FrameType frameType; FrameType frameType;
VideoCodecType codec; 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. VCMNaluCompleteness completeNALU; // Default is kNaluIncomplete.
bool insertStartCode; // True if a start code should be inserted before this bool insertStartCode; // True if a start code should be inserted before this
// packet. // packet.

View File

@ -103,7 +103,7 @@ bool PacketBuffer::InsertPacket(VCMPacket* packet) {
if (AheadOf(seq_num, last_seq_num_)) if (AheadOf(seq_num, last_seq_num_))
last_seq_num_ = 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].frame_end = packet->markerBit;
sequence_buffer_[index].seq_num = packet->seqNum; sequence_buffer_[index].seq_num = packet->seqNum;
sequence_buffer_[index].continuous = false; sequence_buffer_[index].continuous = false;

View File

@ -455,7 +455,7 @@ int VCMSessionInfo::InsertPacket(const VCMPacket& packet,
if (packet.codec == kVideoCodecH264) { if (packet.codec == kVideoCodecH264) {
frame_type_ = packet.frameType; frame_type_ = packet.frameType;
if (packet.isFirstPacket && if (packet.is_first_packet_in_frame &&
(first_packet_seq_num_ == -1 || (first_packet_seq_num_ == -1 ||
IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum))) { IsNewerSequenceNumber(first_packet_seq_num_, packet.seqNum))) {
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. // Placing check here, as to properly account for duplicate packets.
// Check if this is first packet (only valid for some codecs) // Check if this is first packet (only valid for some codecs)
// Should only be set for one packet per session. // 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. // The first packet in a frame signals the frame type.
frame_type_ = packet.frameType; frame_type_ = packet.frameType;
// Store the sequence number for the first packet. // Store the sequence number for the first packet.

View File

@ -114,7 +114,7 @@ class TestNackList : public TestSessionInfo {
}; };
TEST_F(TestSessionInfo, TestSimpleAPIs) { TEST_F(TestSessionInfo, TestSimpleAPIs) {
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.seqNum = 0xFFFE; packet_.seqNum = 0xFFFE;
packet_.sizeBytes = packet_buffer_size(); packet_.sizeBytes = packet_buffer_size();
packet_.frameType = kVideoFrameKey; packet_.frameType = kVideoFrameKey;
@ -125,7 +125,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) {
EXPECT_FALSE(session_.HaveLastPacket()); EXPECT_FALSE(session_.HaveLastPacket());
EXPECT_EQ(kVideoFrameKey, session_.FrameType()); EXPECT_EQ(kVideoFrameKey, session_.FrameType());
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = true; packet_.markerBit = true;
packet_.seqNum += 1; packet_.seqNum += 1;
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
@ -137,7 +137,7 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) {
// Insert empty packet which will be the new high sequence number. // 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. // 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_.markerBit = true;
packet_.seqNum = 2; packet_.seqNum = 2;
packet_.sizeBytes = 0; packet_.sizeBytes = 0;
@ -149,14 +149,14 @@ TEST_F(TestSessionInfo, TestSimpleAPIs) {
TEST_F(TestSessionInfo, NormalOperation) { TEST_F(TestSessionInfo, NormalOperation) {
packet_.seqNum = 0xFFFF; packet_.seqNum = 0xFFFF;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(0); FillPacket(0);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
for (int i = 1; i < 9; ++i) { for (int i = 1; i < 9; ++i) {
packet_.seqNum += 1; packet_.seqNum += 1;
FillPacket(i); FillPacket(i);
@ -181,7 +181,7 @@ TEST_F(TestSessionInfo, NormalOperation) {
TEST_F(TestSessionInfo, ErrorsEqualDecodableState) { TEST_F(TestSessionInfo, ErrorsEqualDecodableState) {
packet_.seqNum = 0xFFFF; packet_.seqNum = 0xFFFF;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(3); FillPacket(3);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
@ -192,7 +192,7 @@ TEST_F(TestSessionInfo, ErrorsEqualDecodableState) {
TEST_F(TestSessionInfo, SelectiveDecodableState) { TEST_F(TestSessionInfo, SelectiveDecodableState) {
packet_.seqNum = 0xFFFF; packet_.seqNum = 0xFFFF;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
frame_data.rolling_average_packets_per_frame = 11; frame_data.rolling_average_packets_per_frame = 11;
@ -204,13 +204,13 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) {
packet_.seqNum -= 1; packet_.seqNum -= 1;
FillPacket(0); FillPacket(0);
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket( static_cast<size_t>(session_.InsertPacket(
packet_, frame_buffer_, kSelectiveErrors, frame_data))); packet_, frame_buffer_, kSelectiveErrors, frame_data)));
EXPECT_TRUE(session_.decodable()); EXPECT_TRUE(session_.decodable());
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.seqNum += 1; packet_.seqNum += 1;
for (int i = 2; i < 8; ++i) { for (int i = 2; i < 8; ++i) {
packet_.seqNum += 1; packet_.seqNum += 1;
@ -231,7 +231,7 @@ TEST_F(TestSessionInfo, SelectiveDecodableState) {
TEST_F(TestSessionInfo, OutOfBoundsPackets1PacketFrame) { TEST_F(TestSessionInfo, OutOfBoundsPackets1PacketFrame) {
packet_.seqNum = 0x0001; packet_.seqNum = 0x0001;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
@ -239,13 +239,13 @@ TEST_F(TestSessionInfo, OutOfBoundsPackets1PacketFrame) {
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0x0004; packet_.seqNum = 0x0004;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
-3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data));
packet_.seqNum = 0x0000; packet_.seqNum = 0x0000;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
@ -254,14 +254,14 @@ TEST_F(TestSessionInfo, OutOfBoundsPackets1PacketFrame) {
TEST_F(TestSessionInfo, SetMarkerBitOnce) { TEST_F(TestSessionInfo, SetMarkerBitOnce) {
packet_.seqNum = 0x0005; packet_.seqNum = 0x0005;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
++packet_.seqNum; ++packet_.seqNum;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
@ -271,7 +271,7 @@ TEST_F(TestSessionInfo, SetMarkerBitOnce) {
TEST_F(TestSessionInfo, OutOfBoundsPacketsBase) { TEST_F(TestSessionInfo, OutOfBoundsPacketsBase) {
// Allow packets in the range 5-6. // Allow packets in the range 5-6.
packet_.seqNum = 0x0005; packet_.seqNum = 0x0005;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
@ -279,20 +279,20 @@ TEST_F(TestSessionInfo, OutOfBoundsPacketsBase) {
kNoErrors, frame_data))); kNoErrors, frame_data)));
// Insert an older packet with a first packet set. // Insert an older packet with a first packet set.
packet_.seqNum = 0x0004; packet_.seqNum = 0x0004;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
-3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data));
packet_.seqNum = 0x0006; packet_.seqNum = 0x0006;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0x0008; packet_.seqNum = 0x0008;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
@ -301,7 +301,7 @@ TEST_F(TestSessionInfo, OutOfBoundsPacketsBase) {
TEST_F(TestSessionInfo, OutOfBoundsPacketsWrap) { TEST_F(TestSessionInfo, OutOfBoundsPacketsWrap) {
packet_.seqNum = 0xFFFE; packet_.seqNum = 0xFFFE;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
@ -309,27 +309,27 @@ TEST_F(TestSessionInfo, OutOfBoundsPacketsWrap) {
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0x0004; packet_.seqNum = 0x0004;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0x0002; packet_.seqNum = 0x0002;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
ASSERT_EQ(packet_buffer_size(), ASSERT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0xFFF0; packet_.seqNum = 0xFFF0;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
-3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data));
packet_.seqNum = 0x0006; packet_.seqNum = 0x0006;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
@ -340,7 +340,7 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) {
// Insert out of bound regular packets, and then the first and last packet. // Insert out of bound regular packets, and then the first and last packet.
// Verify that correct bounds are maintained. // Verify that correct bounds are maintained.
packet_.seqNum = 0x0003; packet_.seqNum = 0x0003;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
@ -348,27 +348,27 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) {
kNoErrors, frame_data))); kNoErrors, frame_data)));
// Insert an older packet with a first packet set. // Insert an older packet with a first packet set.
packet_.seqNum = 0x0005; packet_.seqNum = 0x0005;
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0x0004; packet_.seqNum = 0x0004;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
-3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data)); -3, session_.InsertPacket(packet_, frame_buffer_, kNoErrors, frame_data));
packet_.seqNum = 0x0010; packet_.seqNum = 0x0010;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0x0008; packet_.seqNum = 0x0008;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = true; packet_.markerBit = true;
FillPacket(1); FillPacket(1);
EXPECT_EQ(packet_buffer_size(), EXPECT_EQ(packet_buffer_size(),
@ -376,7 +376,7 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) {
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum = 0x0009; packet_.seqNum = 0x0009;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
EXPECT_EQ( EXPECT_EQ(
@ -384,7 +384,7 @@ TEST_F(TestSessionInfo, OutOfBoundsOutOfOrder) {
} }
TEST_F(TestNalUnits, OnlyReceivedEmptyPacket) { TEST_F(TestNalUnits, OnlyReceivedEmptyPacket) {
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluComplete; packet_.completeNALU = kNaluComplete;
packet_.frameType = kEmptyFrame; packet_.frameType = kEmptyFrame;
packet_.sizeBytes = 0; packet_.sizeBytes = 0;
@ -398,7 +398,7 @@ TEST_F(TestNalUnits, OnlyReceivedEmptyPacket) {
} }
TEST_F(TestNalUnits, OneIsolatedNaluLoss) { TEST_F(TestNalUnits, OneIsolatedNaluLoss) {
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.completeNALU = kNaluComplete; packet_.completeNALU = kNaluComplete;
packet_.seqNum = 0; packet_.seqNum = 0;
packet_.markerBit = false; packet_.markerBit = false;
@ -407,7 +407,7 @@ TEST_F(TestNalUnits, OneIsolatedNaluLoss) {
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluComplete; packet_.completeNALU = kNaluComplete;
packet_.seqNum += 2; packet_.seqNum += 2;
packet_.markerBit = true; packet_.markerBit = true;
@ -425,7 +425,7 @@ TEST_F(TestNalUnits, OneIsolatedNaluLoss) {
} }
TEST_F(TestNalUnits, LossInMiddleOfNalu) { TEST_F(TestNalUnits, LossInMiddleOfNalu) {
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.completeNALU = kNaluComplete; packet_.completeNALU = kNaluComplete;
packet_.seqNum = 0; packet_.seqNum = 0;
packet_.markerBit = false; packet_.markerBit = false;
@ -434,7 +434,7 @@ TEST_F(TestNalUnits, LossInMiddleOfNalu) {
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluEnd; packet_.completeNALU = kNaluEnd;
packet_.seqNum += 2; packet_.seqNum += 2;
packet_.markerBit = true; packet_.markerBit = true;
@ -450,7 +450,7 @@ TEST_F(TestNalUnits, LossInMiddleOfNalu) {
} }
TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) { TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) {
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.completeNALU = kNaluComplete; packet_.completeNALU = kNaluComplete;
packet_.seqNum = 0; packet_.seqNum = 0;
packet_.markerBit = false; packet_.markerBit = false;
@ -459,7 +459,7 @@ TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) {
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluIncomplete; packet_.completeNALU = kNaluIncomplete;
packet_.seqNum += 2; packet_.seqNum += 2;
packet_.markerBit = false; packet_.markerBit = false;
@ -476,7 +476,7 @@ TEST_F(TestNalUnits, StartAndEndOfLastNalUnitLost) {
TEST_F(TestNalUnits, ReorderWrapNoLoss) { TEST_F(TestNalUnits, ReorderWrapNoLoss) {
packet_.seqNum = 0xFFFF; packet_.seqNum = 0xFFFF;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluIncomplete; packet_.completeNALU = kNaluIncomplete;
packet_.seqNum += 1; packet_.seqNum += 1;
packet_.markerBit = false; packet_.markerBit = false;
@ -485,7 +485,7 @@ TEST_F(TestNalUnits, ReorderWrapNoLoss) {
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.isFirstPacket = true; packet_.is_first_packet_in_frame = true;
packet_.completeNALU = kNaluComplete; packet_.completeNALU = kNaluComplete;
packet_.seqNum -= 1; packet_.seqNum -= 1;
packet_.markerBit = false; packet_.markerBit = false;
@ -494,7 +494,7 @@ TEST_F(TestNalUnits, ReorderWrapNoLoss) {
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluEnd; packet_.completeNALU = kNaluEnd;
packet_.seqNum += 2; packet_.seqNum += 2;
packet_.markerBit = true; packet_.markerBit = true;
@ -511,7 +511,7 @@ TEST_F(TestNalUnits, ReorderWrapNoLoss) {
TEST_F(TestNalUnits, WrapLosses) { TEST_F(TestNalUnits, WrapLosses) {
packet_.seqNum = 0xFFFF; packet_.seqNum = 0xFFFF;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluIncomplete; packet_.completeNALU = kNaluIncomplete;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);
@ -519,7 +519,7 @@ TEST_F(TestNalUnits, WrapLosses) {
static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_, static_cast<size_t>(session_.InsertPacket(packet_, frame_buffer_,
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluEnd; packet_.completeNALU = kNaluEnd;
packet_.seqNum += 2; packet_.seqNum += 2;
packet_.markerBit = true; packet_.markerBit = true;
@ -535,7 +535,7 @@ TEST_F(TestNalUnits, WrapLosses) {
TEST_F(TestNalUnits, ReorderWrapLosses) { TEST_F(TestNalUnits, ReorderWrapLosses) {
packet_.seqNum = 0xFFFF; packet_.seqNum = 0xFFFF;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluEnd; packet_.completeNALU = kNaluEnd;
packet_.seqNum += 2; packet_.seqNum += 2;
packet_.markerBit = true; packet_.markerBit = true;
@ -545,7 +545,7 @@ TEST_F(TestNalUnits, ReorderWrapLosses) {
kNoErrors, frame_data))); kNoErrors, frame_data)));
packet_.seqNum -= 2; packet_.seqNum -= 2;
packet_.isFirstPacket = false; packet_.is_first_packet_in_frame = false;
packet_.completeNALU = kNaluIncomplete; packet_.completeNALU = kNaluIncomplete;
packet_.markerBit = false; packet_.markerBit = false;
FillPacket(1); FillPacket(1);

View File

@ -62,11 +62,11 @@ VCMPacket StreamGenerator::GeneratePacket(uint16_t sequence_number,
packet.seqNum = sequence_number; packet.seqNum = sequence_number;
packet.timestamp = timestamp; packet.timestamp = timestamp;
packet.frameType = type; packet.frameType = type;
packet.isFirstPacket = first_packet; packet.is_first_packet_in_frame = first_packet;
packet.markerBit = marker_bit; packet.markerBit = marker_bit;
packet.sizeBytes = size; packet.sizeBytes = size;
packet.dataPtr = packet_buffer_; packet.dataPtr = packet_buffer_;
if (packet.isFirstPacket) if (packet.is_first_packet_in_frame)
packet.completeNALU = kNaluStart; packet.completeNALU = kNaluStart;
else if (packet.markerBit) else if (packet.markerBit)
packet.completeNALU = kNaluEnd; packet.completeNALU = kNaluEnd;

View File

@ -66,7 +66,7 @@ class VCMRobustnessTest : public ::testing::Test {
rtp_info.header.payloadType = video_codec_.plType; rtp_info.header.payloadType = video_codec_.plType;
rtp_info.type.Video.codec = kRtpVideoVp8; rtp_info.type.Video.codec = kRtpVideoVp8;
rtp_info.type.Video.codecHeader.VP8.InitRTPVideoHeaderVP8(); 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)); ASSERT_EQ(VCM_OK, vcm_->IncomingPacket(payload, kPayloadLen, rtp_info));
} }

View File

@ -59,7 +59,7 @@ class TestPacketBuffer : public ::testing::Test,
packet.codec = kVideoCodecGeneric; packet.codec = kVideoCodecGeneric;
packet.seqNum = seq_num; packet.seqNum = seq_num;
packet.frameType = keyframe ? kVideoFrameKey : kVideoFrameDelta; packet.frameType = keyframe ? kVideoFrameKey : kVideoFrameDelta;
packet.isFirstPacket = first == kFirst; packet.is_first_packet_in_frame = first == kFirst;
packet.markerBit = last == kLast; packet.markerBit = last == kLast;
packet.sizeBytes = data_size; packet.sizeBytes = data_size;
packet.dataPtr = data; packet.dataPtr = data;
@ -138,14 +138,14 @@ TEST_F(TestPacketBuffer, NackCount) {
packet.codec = kVideoCodecGeneric; packet.codec = kVideoCodecGeneric;
packet.seqNum = seq_num; packet.seqNum = seq_num;
packet.frameType = kVideoFrameKey; packet.frameType = kVideoFrameKey;
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.markerBit = false; packet.markerBit = false;
packet.timesNacked = 0; packet.timesNacked = 0;
packet_buffer_->InsertPacket(&packet); packet_buffer_->InsertPacket(&packet);
packet.seqNum++; packet.seqNum++;
packet.isFirstPacket = false; packet.is_first_packet_in_frame = false;
packet.timesNacked = 1; packet.timesNacked = 1;
packet_buffer_->InsertPacket(&packet); packet_buffer_->InsertPacket(&packet);
@ -363,7 +363,7 @@ TEST_F(TestPacketBuffer, GetBitstreamH264BufferPadding) {
packet.video_header.codecHeader.H264.packetization_type = kH264SingleNalu; packet.video_header.codecHeader.H264.packetization_type = kH264SingleNalu;
packet.dataPtr = data; packet.dataPtr = data;
packet.sizeBytes = sizeof(data_data); packet.sizeBytes = sizeof(data_data);
packet.isFirstPacket = true; packet.is_first_packet_in_frame = true;
packet.markerBit = true; packet.markerBit = true;
packet_buffer_->InsertPacket(&packet); packet_buffer_->InsertPacket(&packet);

View File

@ -123,14 +123,14 @@ TEST_F(TestVideoReceiver, PaddingOnlyFramesWithLosses) {
header.type.Video.codec = kRtpVideoVp8; header.type.Video.codec = kRtpVideoVp8;
// Insert one video frame to get one frame decoded. // Insert one video frame to get one frame decoded.
header.frameType = kVideoFrameKey; header.frameType = kVideoFrameKey;
header.type.Video.isFirstPacket = true; header.type.Video.is_first_packet_in_frame = true;
header.header.markerBit = true; header.header.markerBit = true;
InsertAndVerifyDecodableFrame(payload, kFrameSize, &header); InsertAndVerifyDecodableFrame(payload, kFrameSize, &header);
clock_.AdvanceTimeMilliseconds(33); clock_.AdvanceTimeMilliseconds(33);
header.header.timestamp += 3000; header.header.timestamp += 3000;
header.frameType = kEmptyFrame; header.frameType = kEmptyFrame;
header.type.Video.isFirstPacket = false; header.type.Video.is_first_packet_in_frame = false;
header.header.markerBit = false; header.header.markerBit = false;
// Insert padding frames. // Insert padding frames.
for (int i = 0; i < 10; ++i) { for (int i = 0; i < 10; ++i) {
@ -166,7 +166,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) {
WebRtcRTPHeader header; WebRtcRTPHeader header;
memset(&header, 0, sizeof(header)); memset(&header, 0, sizeof(header));
header.frameType = kEmptyFrame; header.frameType = kEmptyFrame;
header.type.Video.isFirstPacket = false; header.type.Video.is_first_packet_in_frame = false;
header.header.markerBit = false; header.header.markerBit = false;
header.header.paddingLength = kPaddingSize; header.header.paddingLength = kPaddingSize;
header.header.payloadType = kUnusedPayloadType; header.header.payloadType = kUnusedPayloadType;
@ -182,7 +182,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) {
header.frameType = kVideoFrameKey; header.frameType = kVideoFrameKey;
else else
header.frameType = kVideoFrameDelta; header.frameType = kVideoFrameDelta;
header.type.Video.isFirstPacket = true; header.type.Video.is_first_packet_in_frame = true;
header.header.markerBit = true; header.header.markerBit = true;
InsertAndVerifyDecodableFrame(payload, kFrameSize, &header); InsertAndVerifyDecodableFrame(payload, kFrameSize, &header);
clock_.AdvanceTimeMilliseconds(33); clock_.AdvanceTimeMilliseconds(33);
@ -191,7 +191,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) {
// Insert 2 padding only frames. // Insert 2 padding only frames.
header.frameType = kEmptyFrame; header.frameType = kEmptyFrame;
header.type.Video.isFirstPacket = false; header.type.Video.is_first_packet_in_frame = false;
header.header.markerBit = false; header.header.markerBit = false;
for (int j = 0; j < 2; ++j) { for (int j = 0; j < 2; ++j) {
// InsertAndVerifyPaddingFrame(payload, &header); // InsertAndVerifyPaddingFrame(payload, &header);

View File

@ -2956,7 +2956,7 @@ class Vp9HeaderObserver : public test::SendTest {
bool new_frame = packets_sent_ == 0 || bool new_frame = packets_sent_ == 0 ||
IsNewerTimestamp(header.timestamp, last_header_.timestamp); 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) { if (!new_frame) {
EXPECT_FALSE(last_header_.markerBit); EXPECT_FALSE(last_header_.markerBit);
EXPECT_EQ(last_header_.timestamp, header.timestamp); EXPECT_EQ(last_header_.timestamp, header.timestamp);