#ifndef RTC_AV1_RTP_PACKETIZER_H
#define RTC_AV1_RTP_PACKETIZER_H
#if RTC_ENABLE_MEDIA
#include "mediahandler.hpp"
#include "nalunit.hpp"
#include "rtppacketizer.hpp"
namespace rtc {
class RTC_CPP_EXPORT AV1RtpPacketizer final : public RtpPacketizer {
public:
inline static const uint32_t defaultClockRate = 90 * 1000;
enum class Packetization {
Obu = RTC_OBU_PACKETIZED_OBU,
TemporalUnit = RTC_OBU_PACKETIZED_TEMPORAL_UNIT,
};
AV1RtpPacketizer(Packetization packetization, shared_ptr<RtpPacketizationConfig> rtpConfig,
uint16_t maxFragmentSize = NalUnits::defaultMaximumFragmentSize);
void outgoing(message_vector &messages, const message_callback &send) override;
private:
shared_ptr<NalUnits> splitMessage(binary_ptr message);
std::vector<shared_ptr<binary>> packetizeObu(binary_ptr message, uint16_t maxFragmentSize);
const uint16_t maxFragmentSize;
const Packetization packetization;
std::shared_ptr<binary> sequenceHeader;
};
using AV1PacketizationHandler [[deprecated("Add AV1RtpPacketizer directly")]] = PacketizationHandler;
}
#endif
#endif