diff --git a/modules/rtp_rtcp/source/rtp_packet_received.cc b/modules/rtp_rtcp/source/rtp_packet_received.cc index f84029b604..83f10e20cf 100644 --- a/modules/rtp_rtcp/source/rtp_packet_received.cc +++ b/modules/rtp_rtcp/source/rtp_packet_received.cc @@ -17,6 +17,12 @@ namespace webrtc { +RtpPacketReceived::RtpPacketReceived() = default; +RtpPacketReceived::RtpPacketReceived(const ExtensionManager* extensions) + : RtpPacket(extensions) {} + +RtpPacketReceived::~RtpPacketReceived() {} + void RtpPacketReceived::GetHeader(RTPHeader* header) const { header->markerBit = Marker(); header->payloadType = PayloadType(); diff --git a/modules/rtp_rtcp/source/rtp_packet_received.h b/modules/rtp_rtcp/source/rtp_packet_received.h index 3ed1544dbc..4cf6b23bd7 100644 --- a/modules/rtp_rtcp/source/rtp_packet_received.h +++ b/modules/rtp_rtcp/source/rtp_packet_received.h @@ -10,6 +10,8 @@ #ifndef MODULES_RTP_RTCP_SOURCE_RTP_PACKET_RECEIVED_H_ #define MODULES_RTP_RTCP_SOURCE_RTP_PACKET_RECEIVED_H_ +#include + #include "common_types.h" // NOLINT(build/include) #include "modules/rtp_rtcp/source/rtp_packet.h" #include "system_wrappers/include/ntp_time.h" @@ -18,9 +20,10 @@ namespace webrtc { // Class to hold rtp packet with metadata for receiver side. class RtpPacketReceived : public RtpPacket { public: - RtpPacketReceived() = default; - explicit RtpPacketReceived(const ExtensionManager* extensions) - : RtpPacket(extensions) {} + RtpPacketReceived(); + explicit RtpPacketReceived(const ExtensionManager* extensions); + + ~RtpPacketReceived(); // TODO(danilchap): Remove this function when all code update to use RtpPacket // directly. Function is there just for easier backward compatibilty. @@ -44,11 +47,21 @@ class RtpPacketReceived : public RtpPacket { payload_type_frequency_ = value; } + // Additional data bound to the RTP packet for use in application code, + // outside of WebRTC. + rtc::ArrayView application_data() const { + return application_data_; + } + void set_application_data(rtc::ArrayView data) { + application_data_.assign(data.begin(), data.end()); + } + private: NtpTime capture_time_; int64_t arrival_time_ms_ = 0; int payload_type_frequency_ = 0; bool recovered_ = false; + std::vector application_data_; }; } // namespace webrtc