Revert "Remove RTPVideoHeader::h264() accessors."
This reverts commit dfbced6504720d2c0807d7b92798eb80ba3f8be9. Reason for revert: Crashes when making a video call. #9 0x00000001043dd8d8 in webrtc::RTPVideoHeaderH264& absl::variant_internal::TypedThrowBadVariantAccess<webrtc::RTPVideoHeaderH264&>() at /third_party/absl/types/internal/variant.h:315 #10 0x00000001043dd8ac in absl::variant_internal::VariantAccessResultImpl<2ul, absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&&&>::type absl::variant_internal::VariantCoreAccess::CheckedAccess<2ul, absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&>(absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&&&) at /third_party/absl/types/internal/variant.h:597 #11 0x00000001043db778 in webrtc::RTPVideoHeaderH264& absl::get<webrtc::RTPVideoHeaderH264, webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>(absl::variant<webrtc::RTPVideoHeaderVP8, webrtc::RTPVideoHeaderVP9, webrtc::RTPVideoHeaderH264>&) at /third_party/absl/types/variant.h:299 #12 0x0000000104558bcc in webrtc::RtpPacketizer::Create(webrtc::VideoCodecType, unsigned long, unsigned long, webrtc::RTPVideoHeader const*, webrtc::FrameType) at webrtc/modules/rtp_rtcp/source/rtp_format.cc:30 Original change's description: > Remove RTPVideoHeader::h264() accessors. > > Bug: none > Change-Id: I043bcaf358575688b223bc3631506e148b47fd58 > Reviewed-on: https://webrtc-review.googlesource.com/88220 > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23971} TBR=danilchap@webrtc.org,stefan@webrtc.org,philipel@webrtc.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: none Change-Id: If99bcabdfe3cae7094f24e407bbe2f47233e46e3 Reviewed-on: https://webrtc-review.googlesource.com/88820 Commit-Queue: JT Teh <jtteh@webrtc.org> Reviewed-by: Zeke Chin <tkchin@webrtc.org> Reviewed-by: JT Teh <jtteh@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23993}
This commit is contained in:
@ -508,19 +508,17 @@ class TestPacketBufferH264 : public TestPacketBuffer {
|
||||
uint8_t* data = nullptr) { // data pointer
|
||||
VCMPacket packet;
|
||||
packet.codec = kVideoCodecH264;
|
||||
auto& h264_header =
|
||||
packet.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
packet.seqNum = seq_num;
|
||||
packet.timestamp = timestamp;
|
||||
if (keyframe == kKeyFrame) {
|
||||
if (sps_pps_idr_is_keyframe_) {
|
||||
h264_header.nalus[0].type = H264::NaluType::kSps;
|
||||
h264_header.nalus[1].type = H264::NaluType::kPps;
|
||||
h264_header.nalus[2].type = H264::NaluType::kIdr;
|
||||
h264_header.nalus_length = 3;
|
||||
packet.video_header.h264().nalus[0].type = H264::NaluType::kSps;
|
||||
packet.video_header.h264().nalus[1].type = H264::NaluType::kPps;
|
||||
packet.video_header.h264().nalus[2].type = H264::NaluType::kIdr;
|
||||
packet.video_header.h264().nalus_length = 3;
|
||||
} else {
|
||||
h264_header.nalus[0].type = H264::NaluType::kIdr;
|
||||
h264_header.nalus_length = 1;
|
||||
packet.video_header.h264().nalus[0].type = H264::NaluType::kIdr;
|
||||
packet.video_header.h264().nalus_length = 1;
|
||||
}
|
||||
}
|
||||
packet.is_first_packet_in_frame = first == kFirst;
|
||||
@ -594,14 +592,12 @@ TEST_P(TestPacketBufferH264Parameterized, GetBitstreamBufferPadding) {
|
||||
new uint8_t[sizeof(data_data) + EncodedImage::kBufferPaddingBytesH264]);
|
||||
|
||||
VCMPacket packet;
|
||||
auto& h264_header =
|
||||
packet.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus_length = 1;
|
||||
h264_header.nalus[0].type = H264::NaluType::kIdr;
|
||||
h264_header.packetization_type = kH264SingleNalu;
|
||||
packet.video_header.h264().nalus_length = 1;
|
||||
packet.video_header.h264().nalus[0].type = H264::NaluType::kIdr;
|
||||
packet.seqNum = seq_num;
|
||||
packet.codec = kVideoCodecH264;
|
||||
packet.insertStartCode = true;
|
||||
packet.video_header.h264().packetization_type = kH264SingleNalu;
|
||||
packet.dataPtr = data;
|
||||
packet.sizeBytes = sizeof(data_data);
|
||||
packet.is_first_packet_in_frame = true;
|
||||
@ -759,9 +755,7 @@ TEST_F(TestPacketBuffer, IncomingCodecChange) {
|
||||
EXPECT_TRUE(packet_buffer_->InsertPacket(&packet));
|
||||
|
||||
packet.codec = kVideoCodecH264;
|
||||
auto& h264_header =
|
||||
packet.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus_length = 1;
|
||||
packet.video_header.h264().nalus_length = 1;
|
||||
packet.timestamp = 3;
|
||||
packet.seqNum = 3;
|
||||
EXPECT_TRUE(packet_buffer_->InsertPacket(&packet));
|
||||
@ -784,9 +778,7 @@ TEST_F(TestPacketBuffer, TooManyNalusInPacket) {
|
||||
packet.frameType = kVideoFrameKey;
|
||||
packet.is_first_packet_in_frame = true;
|
||||
packet.markerBit = true;
|
||||
auto& h264_header =
|
||||
packet.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus_length = kMaxNalusPerPacket;
|
||||
packet.video_header.h264().nalus_length = kMaxNalusPerPacket;
|
||||
packet.sizeBytes = 0;
|
||||
packet.dataPtr = nullptr;
|
||||
EXPECT_TRUE(packet_buffer_->InsertPacket(&packet));
|
||||
@ -881,10 +873,9 @@ class TestPacketBufferH264IdrIsKeyframe
|
||||
};
|
||||
|
||||
TEST_F(TestPacketBufferH264IdrIsKeyframe, IdrIsKeyframe) {
|
||||
auto& h264_header =
|
||||
packet_.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus[0].type = H264::NaluType::kIdr;
|
||||
h264_header.nalus_length = 1;
|
||||
packet_.video_header.h264().nalus[0].type = H264::NaluType::kIdr;
|
||||
packet_.video_header.h264().nalus_length = 1;
|
||||
|
||||
packet_buffer_->InsertPacket(&packet_);
|
||||
|
||||
ASSERT_EQ(1u, frames_from_callback_.size());
|
||||
@ -892,12 +883,10 @@ TEST_F(TestPacketBufferH264IdrIsKeyframe, IdrIsKeyframe) {
|
||||
}
|
||||
|
||||
TEST_F(TestPacketBufferH264IdrIsKeyframe, SpsPpsIdrIsKeyframe) {
|
||||
auto& h264_header =
|
||||
packet_.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus[0].type = H264::NaluType::kSps;
|
||||
h264_header.nalus[1].type = H264::NaluType::kPps;
|
||||
h264_header.nalus[2].type = H264::NaluType::kIdr;
|
||||
h264_header.nalus_length = 3;
|
||||
packet_.video_header.h264().nalus[0].type = H264::NaluType::kSps;
|
||||
packet_.video_header.h264().nalus[1].type = H264::NaluType::kPps;
|
||||
packet_.video_header.h264().nalus[2].type = H264::NaluType::kIdr;
|
||||
packet_.video_header.h264().nalus_length = 3;
|
||||
|
||||
packet_buffer_->InsertPacket(&packet_);
|
||||
|
||||
@ -913,10 +902,8 @@ class TestPacketBufferH264SpsPpsIdrIsKeyframe
|
||||
};
|
||||
|
||||
TEST_F(TestPacketBufferH264SpsPpsIdrIsKeyframe, IdrIsNotKeyframe) {
|
||||
auto& h264_header =
|
||||
packet_.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus[0].type = H264::NaluType::kIdr;
|
||||
h264_header.nalus_length = 1;
|
||||
packet_.video_header.h264().nalus[0].type = H264::NaluType::kIdr;
|
||||
packet_.video_header.h264().nalus_length = 1;
|
||||
|
||||
packet_buffer_->InsertPacket(&packet_);
|
||||
|
||||
@ -925,11 +912,9 @@ TEST_F(TestPacketBufferH264SpsPpsIdrIsKeyframe, IdrIsNotKeyframe) {
|
||||
}
|
||||
|
||||
TEST_F(TestPacketBufferH264SpsPpsIdrIsKeyframe, SpsPpsIsNotKeyframe) {
|
||||
auto& h264_header =
|
||||
packet_.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus[0].type = H264::NaluType::kSps;
|
||||
h264_header.nalus[1].type = H264::NaluType::kPps;
|
||||
h264_header.nalus_length = 2;
|
||||
packet_.video_header.h264().nalus[0].type = H264::NaluType::kSps;
|
||||
packet_.video_header.h264().nalus[1].type = H264::NaluType::kPps;
|
||||
packet_.video_header.h264().nalus_length = 2;
|
||||
|
||||
packet_buffer_->InsertPacket(&packet_);
|
||||
|
||||
@ -938,12 +923,10 @@ TEST_F(TestPacketBufferH264SpsPpsIdrIsKeyframe, SpsPpsIsNotKeyframe) {
|
||||
}
|
||||
|
||||
TEST_F(TestPacketBufferH264SpsPpsIdrIsKeyframe, SpsPpsIdrIsKeyframe) {
|
||||
auto& h264_header =
|
||||
packet_.video_header.video_type_header.emplace<RTPVideoHeaderH264>();
|
||||
h264_header.nalus[0].type = H264::NaluType::kSps;
|
||||
h264_header.nalus[1].type = H264::NaluType::kPps;
|
||||
h264_header.nalus[2].type = H264::NaluType::kIdr;
|
||||
h264_header.nalus_length = 3;
|
||||
packet_.video_header.h264().nalus[0].type = H264::NaluType::kSps;
|
||||
packet_.video_header.h264().nalus[1].type = H264::NaluType::kPps;
|
||||
packet_.video_header.h264().nalus[2].type = H264::NaluType::kIdr;
|
||||
packet_.video_header.h264().nalus_length = 3;
|
||||
|
||||
packet_buffer_->InsertPacket(&packet_);
|
||||
|
||||
|
Reference in New Issue
Block a user