[fix] fix h264 rtp packet packetization and depacketization

This commit is contained in:
dijunkun
2025-01-23 17:28:17 +08:00
parent cd349cd98d
commit 7b839ab773
50 changed files with 871 additions and 422 deletions

View File

@@ -0,0 +1,20 @@
#include "rtp_packet_h264.h"
RtpPacketH264::RtpPacketH264() {}
RtpPacketH264::~RtpPacketH264() {}
bool RtpPacketH264::GetFrameHeaderInfo() {
const uint8_t* frame_buffer = Payload();
fu_indicator_.forbidden_bit = (frame_buffer[0] >> 7) & 0x01;
fu_indicator_.nal_reference_idc = (frame_buffer[0] >> 5) & 0x03;
fu_indicator_.nal_unit_type = frame_buffer[0] & 0x1F;
fu_header_.start = (frame_buffer[1] >> 7) & 0x01;
fu_header_.end = (frame_buffer[1] >> 6) & 0x01;
fu_header_.remain_bit = (frame_buffer[1] >> 5) & 0x01;
fu_header_.nal_unit_type = frame_buffer[1] & 0x1F;
return true;
}