From 87443ee3e69abf8dbf656952d29501daa248ff2c Mon Sep 17 00:00:00 2001 From: eladalon Date: Wed, 13 Sep 2017 02:45:15 -0700 Subject: [PATCH] Make rtp::Packet's destructor and constructors public This will allow the RTP-related subclasses of RtcEvent keep an rtp::Packet for the header, rather than hold the heaver, and at the moment unnecessary for logging, RtpPacketReceived/RtpPacketToSend. BUG=webrtc:8111 Review-Url: https://codereview.webrtc.org/3013023004 Cr-Commit-Position: refs/heads/master@{#19812} --- webrtc/modules/rtp_rtcp/source/rtp_packet.h | 25 ++++++++++----------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet.h b/webrtc/modules/rtp_rtcp/source/rtp_packet.h index fb19815b59..5a02f6ca3f 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_packet.h +++ b/webrtc/modules/rtp_rtcp/source/rtp_packet.h @@ -30,6 +30,18 @@ class Packet { static constexpr int kMinExtensionId = 1; static constexpr int kMaxExtensionId = 14; + // |extensions| required for SetExtension/ReserveExtension functions during + // packet creating and used if available in Parse function. + // Adding and getting extensions will fail until |extensions| is + // provided via constructor or IdentifyExtensions function. + Packet(); + explicit Packet(const ExtensionManager* extensions); + Packet(const Packet&); + Packet(const ExtensionManager* extensions, size_t capacity); + ~Packet(); + + Packet& operator=(const Packet&) = default; + // Parse and copy given buffer into Packet. bool Parse(const uint8_t* buffer, size_t size); bool Parse(rtc::ArrayView packet); @@ -113,19 +125,6 @@ class Packet { uint8_t* AllocatePayload(size_t size_bytes); bool SetPadding(uint8_t size_bytes, Random* random); - protected: - // |extensions| required for SetExtension/ReserveExtension functions during - // packet creating and used if available in Parse function. - // Adding and getting extensions will fail until |extensions| is - // provided via constructor or IdentifyExtensions function. - Packet(); - explicit Packet(const ExtensionManager* extensions); - Packet(const Packet&); - Packet(const ExtensionManager* extensions, size_t capacity); - ~Packet(); - - Packet& operator=(const Packet&) = default; - private: struct ExtensionInfo { ExtensionType type;