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

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

Issue 1307663004: Add a ParseHeader method to RtcpPacket, for parsing common RTCP header. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Refactorings, unit tests Created 5 years, 3 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 c5432de9d6030544f4d6ea91405950d1712cbce6..601e6366f132ea2daa6dc5aa4a260f03708afffd 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_packet.h
@@ -94,16 +94,29 @@ class RtcpPacket {
protected:
RtcpPacket() {}
+ struct CommonHeader {
+ CommonHeader();
+
+ uint8_t count_or_format;
+ uint8_t payload_type;
+ uint32_t payload_size_bytes;
+ };
+
virtual bool Create(uint8_t* packet,
size_t* index,
size_t max_length,
PacketReadyCallback* callback) const = 0;
- void CreateHeader(uint8_t count_or_format,
- uint8_t packet_type,
- size_t length,
- uint8_t* buffer,
- size_t* pos) const;
+ static void CreateHeader(uint8_t count_or_format,
+ uint8_t packet_type,
+ size_t block_length, // Size in 32bit words - 1.
+ uint8_t* buffer,
+ size_t* pos);
+
+ static bool ParseHeader(const uint8_t* packet,
+ size_t index,
+ size_t max_length,
+ CommonHeader* header);
bool OnBufferFull(uint8_t* packet,
size_t* index,
« no previous file with comments | « no previous file | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('j') | webrtc/modules/rtp_rtcp/source/rtcp_packet.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698