Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet.h

Issue 1696203002: [rtp_rtcp] rtc::scoped_ptr<rtcp::RawPacket> replaced with rtc::Buffer (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/rtp_rtcp/source/rtcp_packet.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_packet.h b/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
index 33064aac1581019dcf965f067e86d66f8ddf7405..fef7258b5a8874e3aaf5f03e382ecc737e70279c 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
@@ -14,7 +14,7 @@
#include <vector>
-#include "webrtc/base/scoped_ptr.h"
+#include "webrtc/base/buffer.h"
#include "webrtc/modules/rtp_rtcp/source/rtcp_utility.h"
#include "webrtc/typedefs.h"
@@ -23,18 +23,16 @@ namespace rtcp {
static const int kCommonFbFmtLength = 12;
-class RawPacket;
-
// Class for building RTCP packets.
//
// Example:
// ReportBlock report_block;
-// report_block.To(234)
-// report_block.FractionLost(10);
+// report_block.To(234);
+// report_block.WithFractionLost(10);
//
// ReceiverReport rr;
// rr.From(123);
-// rr.WithReportBlock(&report_block)
+// rr.WithReportBlock(report_block);
//
// Fir fir;
// fir.From(123);
@@ -44,11 +42,11 @@ class RawPacket;
// uint8_t packet[kPacketSize]; // with sequence number 56.
// fir.Build(packet, &length, kPacketSize);
//
-// RawPacket packet = fir.Build(); // Returns a RawPacket holding
+// rtc::Buffer packet = fir.Build(); // Returns a RawPacket holding
// // the built rtcp packet.
//
-// rr.Append(&fir) // Builds a compound RTCP packet with
-// RawPacket packet = rr.Build(); // a receiver report, report block
+// rr.Append(&fir); // Builds a compound RTCP packet with
+// rtc::Buffer packet = rr.Build(); // a receiver report, report block
// // and fir message.
class RtcpPacket {
@@ -71,7 +69,7 @@ class RtcpPacket {
// Convenience method mostly used for test. Max length of IP_PACKET_SIZE is
// used, will cause assertion error if fragmentation occurs.
- rtc::scoped_ptr<RawPacket> Build() const;
+ rtc::Buffer Build() const;
// Returns true if all calls to Create succeeded. A buffer of size
// IP_PACKET_SIZE will be allocated and reused between calls to callback.
@@ -115,33 +113,6 @@ class RtcpPacket {
size_t max_length,
PacketReadyCallback* callback) const;
};
-
-// Class holding a RTCP packet.
-//
-// Takes a built rtcp packet.
-// RawPacket raw_packet(buffer, length);
-//
-// To access the raw packet:
-// raw_packet.Buffer(); - pointer to the raw packet
-// raw_packet.BufferLength(); - the length of the raw packet
-
-class RawPacket {
- public:
- explicit RawPacket(size_t buffer_length);
- RawPacket(const uint8_t* packet, size_t packet_length);
-
- const uint8_t* Buffer() const;
- uint8_t* MutableBuffer();
- size_t BufferLength() const;
- size_t Length() const;
- void SetLength(size_t length);
-
- private:
- const size_t buffer_length_;
- size_t length_;
- rtc::scoped_ptr<uint8_t[]> buffer_;
-};
-
} // namespace rtcp
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_H_

Powered by Google App Engine
This is Rietveld 408576698