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}
This commit is contained in:
eladalon
2017-09-13 02:45:15 -07:00
committed by Commit Bot
parent 4090f380e5
commit 87443ee3e6

View File

@ -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<const uint8_t> 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;