Delete enum RtpVideoCodecTypes, replaced with VideoCodecType.
Bug: webrtc:8995 Change-Id: I0b44aa26f2f6a81aec7ca1281b8513d8e03228b8 Reviewed-on: https://webrtc-review.googlesource.com/79561 Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Reviewed-by: Patrik Höglund <phoglund@webrtc.org> Reviewed-by: Åsa Persson <asapersson@webrtc.org> Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23507}
This commit is contained in:
@ -36,7 +36,7 @@ TEST(TestDecodingState, FrameContinuity) {
|
||||
packet.timestamp = 1;
|
||||
packet.seqNum = 0xffff;
|
||||
packet.frameType = kVideoFrameDelta;
|
||||
packet.video_header.codec = kRtpVideoVp8;
|
||||
packet.video_header.codec = kVideoCodecVP8;
|
||||
packet.video_header.codecHeader.VP8.pictureId = 0x007F;
|
||||
FrameData frame_data;
|
||||
frame_data.rtt_ms = 0;
|
||||
@ -211,7 +211,7 @@ TEST(TestDecodingState, MultiLayerBehavior) {
|
||||
VCMFrameBuffer frame;
|
||||
VCMPacket packet;
|
||||
packet.frameType = kVideoFrameDelta;
|
||||
packet.video_header.codec = kRtpVideoVp8;
|
||||
packet.video_header.codec = kVideoCodecVP8;
|
||||
packet.timestamp = 0;
|
||||
packet.seqNum = 0;
|
||||
packet.video_header.codecHeader.VP8.tl0PicIdx = 0;
|
||||
@ -365,7 +365,7 @@ TEST(TestDecodingState, DiscontinuousPicIdContinuousSeqNum) {
|
||||
VCMPacket packet;
|
||||
frame.Reset();
|
||||
packet.frameType = kVideoFrameKey;
|
||||
packet.video_header.codec = kRtpVideoVp8;
|
||||
packet.video_header.codec = kVideoCodecVP8;
|
||||
packet.timestamp = 0;
|
||||
packet.seqNum = 0;
|
||||
packet.video_header.codecHeader.VP8.tl0PicIdx = 0;
|
||||
@ -418,7 +418,7 @@ TEST(TestDecodingState, PictureIdRepeat) {
|
||||
VCMFrameBuffer frame;
|
||||
VCMPacket packet;
|
||||
packet.frameType = kVideoFrameDelta;
|
||||
packet.video_header.codec = kRtpVideoVp8;
|
||||
packet.video_header.codec = kVideoCodecVP8;
|
||||
packet.timestamp = 0;
|
||||
packet.seqNum = 0;
|
||||
packet.video_header.codecHeader.VP8.tl0PicIdx = 0;
|
||||
@ -456,7 +456,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeKeyFrame) {
|
||||
uint8_t data[] = "I need a data pointer for this test!";
|
||||
packet.sizeBytes = sizeof(data);
|
||||
packet.dataPtr = data;
|
||||
packet.video_header.codec = kRtpVideoVp9;
|
||||
packet.video_header.codec = kVideoCodecVP9;
|
||||
|
||||
RTPVideoHeaderVP9& vp9_hdr = packet.video_header.codecHeader.VP9;
|
||||
vp9_hdr.picture_id = 10;
|
||||
@ -499,7 +499,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeOutOfOrderFrames) {
|
||||
uint8_t data[] = "I need a data pointer for this test!";
|
||||
packet.sizeBytes = sizeof(data);
|
||||
packet.dataPtr = data;
|
||||
packet.video_header.codec = kRtpVideoVp9;
|
||||
packet.video_header.codec = kVideoCodecVP9;
|
||||
|
||||
RTPVideoHeaderVP9& vp9_hdr = packet.video_header.codecHeader.VP9;
|
||||
vp9_hdr.picture_id = 10;
|
||||
@ -554,7 +554,7 @@ TEST(TestDecodingState, FrameContinuityFlexibleModeGeneral) {
|
||||
uint8_t data[] = "I need a data pointer for this test!";
|
||||
packet.sizeBytes = sizeof(data);
|
||||
packet.dataPtr = data;
|
||||
packet.video_header.codec = kRtpVideoVp9;
|
||||
packet.video_header.codec = kVideoCodecVP9;
|
||||
|
||||
RTPVideoHeaderVP9& vp9_hdr = packet.video_header.codecHeader.VP9;
|
||||
vp9_hdr.picture_id = 10;
|
||||
|
||||
@ -92,7 +92,7 @@ void VCMEncodedFrame::Reset() {
|
||||
void VCMEncodedFrame::CopyCodecSpecific(const RTPVideoHeader* header) {
|
||||
if (header) {
|
||||
switch (header->codec) {
|
||||
case kRtpVideoVp8: {
|
||||
case kVideoCodecVP8: {
|
||||
if (_codecSpecificInfo.codecType != kVideoCodecVP8) {
|
||||
// This is the first packet for this frame.
|
||||
_codecSpecificInfo.codecSpecific.VP8.pictureId = -1;
|
||||
@ -119,7 +119,7 @@ void VCMEncodedFrame::CopyCodecSpecific(const RTPVideoHeader* header) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kRtpVideoVp9: {
|
||||
case kVideoCodecVP9: {
|
||||
if (_codecSpecificInfo.codecType != kVideoCodecVP9) {
|
||||
// This is the first packet for this frame.
|
||||
_codecSpecificInfo.codecSpecific.VP9.picture_id = -1;
|
||||
@ -186,12 +186,11 @@ void VCMEncodedFrame::CopyCodecSpecific(const RTPVideoHeader* header) {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case kRtpVideoH264: {
|
||||
case kVideoCodecH264: {
|
||||
_codecSpecificInfo.codecType = kVideoCodecH264;
|
||||
break;
|
||||
}
|
||||
case kRtpVideoNone:
|
||||
case kRtpVideoGeneric: {
|
||||
default: {
|
||||
_codecSpecificInfo.codecType = kVideoCodecUnknown;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ class Vp9SsMapTest : public ::testing::Test {
|
||||
packet_.markerBit = true;
|
||||
packet_.frameType = kVideoFrameKey;
|
||||
packet_.codec = kVideoCodecVP9;
|
||||
packet_.video_header.codec = kRtpVideoVp9;
|
||||
packet_.video_header.codec = kVideoCodecVP9;
|
||||
packet_.video_header.codecHeader.VP9.flexible_mode = false;
|
||||
packet_.video_header.codecHeader.VP9.gof_idx = 0;
|
||||
packet_.video_header.codecHeader.VP9.temporal_idx = kNoTemporalIdx;
|
||||
@ -243,6 +243,7 @@ class TestBasicJitterBuffer : public ::testing::TestWithParam<std::string>,
|
||||
rtpHeader.header.timestamp = timestamp_;
|
||||
rtpHeader.header.markerBit = true;
|
||||
rtpHeader.frameType = kVideoFrameDelta;
|
||||
rtpHeader.type.Video.codec = kVideoCodecUnknown;
|
||||
packet_.reset(new VCMPacket(data_, size_, rtpHeader));
|
||||
}
|
||||
|
||||
@ -800,6 +801,7 @@ TEST_F(TestBasicJitterBuffer, TestReorderingWithPadding) {
|
||||
rtpHeader.header.sequenceNumber = seq_num_ + 2;
|
||||
rtpHeader.header.timestamp = timestamp_ + (33 * 90);
|
||||
rtpHeader.header.markerBit = false;
|
||||
rtpHeader.type.Video.codec = kVideoCodecUnknown;
|
||||
VCMPacket empty_packet(data_, 0, rtpHeader);
|
||||
EXPECT_EQ(kOldPacket,
|
||||
jitter_buffer_->InsertPacket(empty_packet, &retransmitted));
|
||||
@ -920,7 +922,7 @@ TEST_F(TestBasicJitterBuffer, TestSkipForwardVp9) {
|
||||
|
||||
bool re = false;
|
||||
packet_->codec = kVideoCodecVP9;
|
||||
packet_->video_header.codec = kRtpVideoVp9;
|
||||
packet_->video_header.codec = kVideoCodecVP9;
|
||||
packet_->is_first_packet_in_frame = true;
|
||||
packet_->markerBit = true;
|
||||
packet_->video_header.codecHeader.VP9.flexible_mode = false;
|
||||
@ -973,7 +975,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_3TlLayers) {
|
||||
|
||||
bool re = false;
|
||||
packet_->codec = kVideoCodecVP9;
|
||||
packet_->video_header.codec = kRtpVideoVp9;
|
||||
packet_->video_header.codec = kVideoCodecVP9;
|
||||
packet_->is_first_packet_in_frame = true;
|
||||
packet_->markerBit = true;
|
||||
packet_->video_header.codecHeader.VP9.flexible_mode = false;
|
||||
@ -1049,7 +1051,7 @@ TEST_F(TestBasicJitterBuffer, ReorderedVp9SsData_2Tl2SLayers) {
|
||||
|
||||
bool re = false;
|
||||
packet_->codec = kVideoCodecVP9;
|
||||
packet_->video_header.codec = kRtpVideoVp9;
|
||||
packet_->video_header.codec = kVideoCodecVP9;
|
||||
packet_->video_header.codecHeader.VP9.flexible_mode = false;
|
||||
packet_->video_header.codecHeader.VP9.beginning_of_frame = true;
|
||||
packet_->video_header.codecHeader.VP9.end_of_frame = true;
|
||||
@ -1158,7 +1160,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
|
||||
packet_->is_first_packet_in_frame = true;
|
||||
packet_->markerBit = true;
|
||||
packet_->codec = kVideoCodecH264;
|
||||
packet_->video_header.codec = kRtpVideoH264;
|
||||
packet_->video_header.codec = kVideoCodecH264;
|
||||
packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kIdr;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kIdr;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
|
||||
@ -1178,7 +1180,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
|
||||
packet_->is_first_packet_in_frame = true;
|
||||
packet_->markerBit = false;
|
||||
packet_->codec = kVideoCodecH264;
|
||||
packet_->video_header.codec = kRtpVideoH264;
|
||||
packet_->video_header.codec = kVideoCodecH264;
|
||||
packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kStapA;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kSps;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].sps_id = 0;
|
||||
@ -1197,7 +1199,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
|
||||
packet_->is_first_packet_in_frame = false;
|
||||
packet_->markerBit = true;
|
||||
packet_->codec = kVideoCodecH264;
|
||||
packet_->video_header.codec = kRtpVideoH264;
|
||||
packet_->video_header.codec = kVideoCodecH264;
|
||||
packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kIdr;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kIdr;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
|
||||
@ -1219,7 +1221,7 @@ TEST_F(TestBasicJitterBuffer, SpsAndPpsHandling) {
|
||||
packet_->is_first_packet_in_frame = true;
|
||||
packet_->markerBit = true;
|
||||
packet_->codec = kVideoCodecH264;
|
||||
packet_->video_header.codec = kRtpVideoH264;
|
||||
packet_->video_header.codec = kVideoCodecH264;
|
||||
packet_->video_header.codecHeader.H264.nalu_type = H264::NaluType::kSlice;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].type = H264::NaluType::kSlice;
|
||||
packet_->video_header.codecHeader.H264.nalus[0].sps_id = -1;
|
||||
@ -2163,6 +2165,7 @@ TEST_F(TestBasicJitterBuffer, H264IncompleteNalu) {
|
||||
timestamp_ += 33 * 90;
|
||||
WebRtcRTPHeader rtpHeader;
|
||||
memset(&rtpHeader, 0, sizeof(rtpHeader));
|
||||
rtpHeader.type.Video.codec = kVideoCodecUnknown;
|
||||
VCMPacket emptypacket(data_, 0, rtpHeader);
|
||||
emptypacket.seqNum = seq_num_;
|
||||
emptypacket.timestamp = timestamp_;
|
||||
|
||||
@ -89,8 +89,9 @@ void VCMPacket::Reset() {
|
||||
}
|
||||
|
||||
void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
|
||||
codec = videoHeader.codec;
|
||||
switch (videoHeader.codec) {
|
||||
case kRtpVideoVp8:
|
||||
case kVideoCodecVP8:
|
||||
// Handle all packets within a frame as depending on the previous packet
|
||||
// TODO(holmer): This should be changed to make fragments independent
|
||||
// when the VP8 RTP receiver supports fragments.
|
||||
@ -103,9 +104,8 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
|
||||
else
|
||||
completeNALU = kNaluIncomplete;
|
||||
|
||||
codec = kVideoCodecVP8;
|
||||
return;
|
||||
case kRtpVideoVp9:
|
||||
case kVideoCodecVP9:
|
||||
if (is_first_packet_in_frame && markerBit)
|
||||
completeNALU = kNaluComplete;
|
||||
else if (is_first_packet_in_frame)
|
||||
@ -115,9 +115,8 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
|
||||
else
|
||||
completeNALU = kNaluIncomplete;
|
||||
|
||||
codec = kVideoCodecVP9;
|
||||
return;
|
||||
case kRtpVideoH264:
|
||||
case kVideoCodecH264:
|
||||
is_first_packet_in_frame = videoHeader.is_first_packet_in_frame;
|
||||
if (is_first_packet_in_frame)
|
||||
insertStartCode = true;
|
||||
@ -131,12 +130,10 @@ void VCMPacket::CopyCodecSpecifics(const RTPVideoHeader& videoHeader) {
|
||||
} else {
|
||||
completeNALU = kNaluIncomplete;
|
||||
}
|
||||
codec = kVideoCodecH264;
|
||||
return;
|
||||
case kRtpVideoGeneric:
|
||||
codec = kVideoCodecGeneric;
|
||||
case kVideoCodecGeneric:
|
||||
return;
|
||||
case kRtpVideoNone:
|
||||
default:
|
||||
codec = kVideoCodecUnknown;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -60,9 +60,9 @@ int VCMSessionInfo::HighSequenceNumber() const {
|
||||
int VCMSessionInfo::PictureId() const {
|
||||
if (packets_.empty())
|
||||
return kNoPictureId;
|
||||
if (packets_.front().video_header.codec == kRtpVideoVp8) {
|
||||
if (packets_.front().video_header.codec == kVideoCodecVP8) {
|
||||
return packets_.front().video_header.codecHeader.VP8.pictureId;
|
||||
} else if (packets_.front().video_header.codec == kRtpVideoVp9) {
|
||||
} else if (packets_.front().video_header.codec == kVideoCodecVP9) {
|
||||
return packets_.front().video_header.codecHeader.VP9.picture_id;
|
||||
} else {
|
||||
return kNoPictureId;
|
||||
@ -72,9 +72,9 @@ int VCMSessionInfo::PictureId() const {
|
||||
int VCMSessionInfo::TemporalId() const {
|
||||
if (packets_.empty())
|
||||
return kNoTemporalIdx;
|
||||
if (packets_.front().video_header.codec == kRtpVideoVp8) {
|
||||
if (packets_.front().video_header.codec == kVideoCodecVP8) {
|
||||
return packets_.front().video_header.codecHeader.VP8.temporalIdx;
|
||||
} else if (packets_.front().video_header.codec == kRtpVideoVp9) {
|
||||
} else if (packets_.front().video_header.codec == kVideoCodecVP9) {
|
||||
return packets_.front().video_header.codecHeader.VP9.temporal_idx;
|
||||
} else {
|
||||
return kNoTemporalIdx;
|
||||
@ -84,9 +84,9 @@ int VCMSessionInfo::TemporalId() const {
|
||||
bool VCMSessionInfo::LayerSync() const {
|
||||
if (packets_.empty())
|
||||
return false;
|
||||
if (packets_.front().video_header.codec == kRtpVideoVp8) {
|
||||
if (packets_.front().video_header.codec == kVideoCodecVP8) {
|
||||
return packets_.front().video_header.codecHeader.VP8.layerSync;
|
||||
} else if (packets_.front().video_header.codec == kRtpVideoVp9) {
|
||||
} else if (packets_.front().video_header.codec == kVideoCodecVP9) {
|
||||
return packets_.front().video_header.codecHeader.VP9.temporal_up_switch;
|
||||
} else {
|
||||
return false;
|
||||
@ -96,9 +96,9 @@ bool VCMSessionInfo::LayerSync() const {
|
||||
int VCMSessionInfo::Tl0PicId() const {
|
||||
if (packets_.empty())
|
||||
return kNoTl0PicIdx;
|
||||
if (packets_.front().video_header.codec == kRtpVideoVp8) {
|
||||
if (packets_.front().video_header.codec == kVideoCodecVP8) {
|
||||
return packets_.front().video_header.codecHeader.VP8.tl0PicIdx;
|
||||
} else if (packets_.front().video_header.codec == kRtpVideoVp9) {
|
||||
} else if (packets_.front().video_header.codec == kVideoCodecVP9) {
|
||||
return packets_.front().video_header.codecHeader.VP9.tl0_pic_idx;
|
||||
} else {
|
||||
return kNoTl0PicIdx;
|
||||
@ -106,13 +106,14 @@ int VCMSessionInfo::Tl0PicId() const {
|
||||
}
|
||||
|
||||
bool VCMSessionInfo::NonReference() const {
|
||||
if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp8)
|
||||
if (packets_.empty() || packets_.front().video_header.codec != kVideoCodecVP8)
|
||||
return false;
|
||||
return packets_.front().video_header.codecHeader.VP8.nonReference;
|
||||
}
|
||||
|
||||
std::vector<NaluInfo> VCMSessionInfo::GetNaluInfos() const {
|
||||
if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoH264)
|
||||
if (packets_.empty() ||
|
||||
packets_.front().video_header.codec != kVideoCodecH264)
|
||||
return std::vector<NaluInfo>();
|
||||
std::vector<NaluInfo> nalu_infos;
|
||||
for (const VCMPacket& packet : packets_) {
|
||||
@ -125,7 +126,8 @@ std::vector<NaluInfo> VCMSessionInfo::GetNaluInfos() const {
|
||||
}
|
||||
|
||||
void VCMSessionInfo::SetGofInfo(const GofInfoVP9& gof_info, size_t idx) {
|
||||
if (packets_.empty() || packets_.front().video_header.codec != kRtpVideoVp9 ||
|
||||
if (packets_.empty() ||
|
||||
packets_.front().video_header.codec != kVideoCodecVP9 ||
|
||||
packets_.front().video_header.codecHeader.VP9.flexible_mode) {
|
||||
return;
|
||||
}
|
||||
@ -185,7 +187,7 @@ size_t VCMSessionInfo::InsertBuffer(uint8_t* frame_buffer,
|
||||
// header supplied by the H264 depacketizer.
|
||||
const size_t kH264NALHeaderLengthInBytes = 1;
|
||||
const size_t kLengthFieldLength = 2;
|
||||
if (packet.video_header.codec == kRtpVideoH264 &&
|
||||
if (packet.video_header.codec == kVideoCodecH264 &&
|
||||
packet.video_header.codecHeader.H264.packetization_type == kH264StapA) {
|
||||
size_t required_length = 0;
|
||||
const uint8_t* nalu_ptr = packet_buffer + kH264NALHeaderLengthInBytes;
|
||||
|
||||
@ -48,6 +48,7 @@ class SimulcastRateAllocatorTest : public ::testing::TestWithParam<bool> {
|
||||
public:
|
||||
SimulcastRateAllocatorTest() {
|
||||
memset(&codec_, 0, sizeof(VideoCodec));
|
||||
codec_.codecType = kVideoCodecVP8;
|
||||
codec_.minBitrate = kMinBitrateKbps;
|
||||
codec_.targetBitrate = kTargetBitrateKbps;
|
||||
codec_.maxBitrate = kMaxBitrateKbps;
|
||||
|
||||
@ -106,7 +106,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyFrames) {
|
||||
header.header.payloadType = kUnusedPayloadType;
|
||||
header.header.ssrc = 1;
|
||||
header.header.headerLength = 12;
|
||||
header.type.Video.codec = kRtpVideoVp8;
|
||||
header.type.Video.codec = kVideoCodecVP8;
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
EXPECT_CALL(packet_request_callback_, ResendPackets(_, _)).Times(0);
|
||||
InsertAndVerifyPaddingFrame(payload, &header);
|
||||
@ -130,7 +130,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyFramesWithLosses) {
|
||||
header.header.payloadType = kUnusedPayloadType;
|
||||
header.header.ssrc = 1;
|
||||
header.header.headerLength = 12;
|
||||
header.type.Video.codec = kRtpVideoVp8;
|
||||
header.type.Video.codec = kVideoCodecVP8;
|
||||
// Insert one video frame to get one frame decoded.
|
||||
header.frameType = kVideoFrameKey;
|
||||
header.type.Video.is_first_packet_in_frame = true;
|
||||
@ -182,7 +182,7 @@ TEST_F(TestVideoReceiver, PaddingOnlyAndVideo) {
|
||||
header.header.payloadType = kUnusedPayloadType;
|
||||
header.header.ssrc = 1;
|
||||
header.header.headerLength = 12;
|
||||
header.type.Video.codec = kRtpVideoVp8;
|
||||
header.type.Video.codec = kVideoCodecVP8;
|
||||
header.type.Video.codecHeader.VP8.pictureId = -1;
|
||||
header.type.Video.codecHeader.VP8.tl0PicIdx = -1;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
|
||||
Reference in New Issue
Block a user