mirror of
https://github.com/mii443/libdatachannel.git
synced 2025-08-29 10:29:31 +00:00
Add chainable Rtcp Handler
This commit is contained in:
@ -23,23 +23,7 @@
|
||||
namespace rtc {
|
||||
|
||||
OpusPacketizationHandler::OpusPacketizationHandler(std::shared_ptr<OpusRtpPacketizer> packetizer)
|
||||
: RtcpHandler(), RtcpSenderReporter(packetizer->rtpConfig), packetizer(packetizer) {
|
||||
senderReportOutgoingCallback = [this](message_ptr msg) { outgoingCallback(msg); };
|
||||
}
|
||||
|
||||
message_ptr OpusPacketizationHandler::incoming(message_ptr ptr) { return ptr; }
|
||||
|
||||
message_ptr OpusPacketizationHandler::outgoing(message_ptr ptr) {
|
||||
if (ptr->type == Message::Binary) {
|
||||
return withStatsRecording<message_ptr>(
|
||||
[this, ptr](std::function<void(message_ptr)> addToReport) {
|
||||
auto rtp = packetizer->packetize(*ptr, false);
|
||||
addToReport(rtp);
|
||||
return rtp;
|
||||
});
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
: RtcpChainableHandler(packetizer) { }
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
|
Reference in New Issue
Block a user