[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

@@ -1,11 +1,16 @@
#include "rtp_packetizer.h"
std::unique_ptr<RtpPacketizer> Create(uint32_t payload_type, uint8_t* payload,
size_t payload_size) {
#include "rtp_packetizer_av1.h"
#include "rtp_packetizer_generic.h"
#include "rtp_packetizer_h264.h"
std::unique_ptr<RtpPacketizer> RtpPacketizer::Create(uint32_t payload_type) {
switch (payload_type) {
case RtpPacket::PAYLOAD_TYPE::H264:
return std::make_unique<RtpPacketizerH264>(payload, payload_size);
case RtpPacket::PAYLOAD_TYPE::AV1:
return std::make_unique<RtpPacketizerAv1>(payload, payload_size);
case rtp::PAYLOAD_TYPE::H264:
return std::make_unique<RtpPacketizerH264>();
case rtp::PAYLOAD_TYPE::AV1:
return std::make_unique<RtpPacketizerAv1>();
default:
return std::make_unique<RtpPacketizerGeneric>();
}
}