Reland "Remove RTPVideoHeader::h264() accessors."

Downstream projects have been updated, so this can now be relanded.
This is a revert (and rebase) of: https://webrtc-review.googlesource.com/c/src/+/88820

Bug: none
Change-Id: I424664ddef7aeebd3c6c94ae67c7f70a342dc9a4
Reviewed-on: https://webrtc-review.googlesource.com/92082
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Philip Eliasson <philipel@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24181}
This commit is contained in:
philipel
2018-08-02 14:03:53 +02:00
committed by Commit Bot
parent 9f6450d5a5
commit 7d745e5a89
14 changed files with 222 additions and 203 deletions

View File

@ -112,8 +112,10 @@ std::vector<NaluInfo> VCMSessionInfo::GetNaluInfos() const {
return std::vector<NaluInfo>();
std::vector<NaluInfo> nalu_infos;
for (const VCMPacket& packet : packets_) {
for (size_t i = 0; i < packet.video_header.h264().nalus_length; ++i) {
nalu_infos.push_back(packet.video_header.h264().nalus[i]);
const auto& h264 =
absl::get<RTPVideoHeaderH264>(packet.video_header.video_type_header);
for (size_t i = 0; i < h264.nalus_length; ++i) {
nalu_infos.push_back(h264.nalus[i]);
}
}
return nalu_infos;
@ -177,8 +179,9 @@ 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 == kVideoCodecH264 &&
packet.video_header.h264().packetization_type == kH264StapA) {
const auto* h264 =
absl::get_if<RTPVideoHeaderH264>(&packet.video_header.video_type_header);
if (h264 && h264->packetization_type == kH264StapA) {
size_t required_length = 0;
const uint8_t* nalu_ptr = packet_buffer + kH264NALHeaderLengthInBytes;
while (nalu_ptr < packet_buffer + packet.sizeBytes) {