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

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

Issue 2789773004: Add functions to get/set rtp header extension by id. (Closed)
Patch Set: . Created 3 years, 9 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/rtp_packet.h
diff --git a/webrtc/modules/rtp_rtcp/source/rtp_packet.h b/webrtc/modules/rtp_rtcp/source/rtp_packet.h
index 75c73cfbcc92ccb07f7a1331a6e6b3345f79d432..293e12b5ee8aeaef6a599b720c2c0d1c80635b7e 100644
--- a/webrtc/modules/rtp_rtcp/source/rtp_packet.h
+++ b/webrtc/modules/rtp_rtcp/source/rtp_packet.h
@@ -95,6 +95,19 @@ class Packet {
template <typename Extension>
bool ReserveExtension();
+ bool HasRawExtension(int id) const;
nisse-webrtc 2017/04/03 09:38:00 |id| is the numerical value used on the wire (and
danilchap 2017/04/03 10:57:00 Failed to find verbose enough argument name, so ad
+
+ // Returns place where extension with |id| is stored.
+ // Returns empty arrayview if extension is not present.
nisse-webrtc 2017/04/03 09:38:00 The return convention makes sense, assuming that n
danilchap 2017/04/03 10:57:00 Yes, extension is not allowed to have 0 length.
+ rtc::ArrayView<const uint8_t> GetRawExtension(int id) const;
+
+ // Allocates and store header extension. Returns true on success.
+ bool SetRawExtension(int id, rtc::ArrayView<const uint8_t> data);
+
+ // Allocates and returns place to store rtp header extension.
+ // Returns empty arrayview on failure.
+ rtc::ArrayView<uint8_t> AllocateRawExtension(int id, size_t length);
+
// Reserve size_bytes for payload. Returns nullptr on failure.
uint8_t* SetPayloadSize(size_t size_bytes);
// Same as SetPayloadSize but doesn't guarantee to keep current payload.
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtp_packet.cc » ('j') | webrtc/modules/rtp_rtcp/source/rtp_packet.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698