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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.h

Issue 1575413002: [rtp_rtcp] rtcp header structure copied from RTCPUtility and extended (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: spelling Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_COMMON_HEADER_H_
11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_COMMON_HEADER_H_
12
13 #include "webrtc/base/basictypes.h"
14
15 namespace webrtc {
16 namespace rtcp {
17 class CommonHeader {
18 public:
19 CommonHeader() {}
20 CommonHeader(const CommonHeader&) = default;
21 CommonHeader& operator =(const CommonHeader&) = default;
22
23 bool Parse(const uint8_t* buffer, size_t size_bytes);
24
25 uint8_t type() const { return packet_type_; }
26 // Depending on packet type same header field can be used either as count or
27 // as feedback message type (fmt). Caller expected to know how it is used.
28 uint8_t fmt() const { return count_or_format_; }
29 uint8_t count() const { return count_or_format_; }
30 size_t payload_size_bytes() const { return payload_size_; }
31 const uint8_t* payload() const { return payload_; }
32 // Returns pointer to the next RTCP packet in compound packet.
33 const uint8_t* NextPacket() const {
34 return payload_ + payload_size_ + padding_size_;
35 }
36
37 private:
38 uint8_t packet_type_ = 0;
39 uint8_t count_or_format_ = 0;
40 uint8_t padding_size_ = 0;
41 uint32_t payload_size_ = 0;
42 const uint8_t* payload_ = nullptr;
43 };
44 } // namespace rtcp
45 } // namespace webrtc
46 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_COMMON_HEADER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/rtp_rtcp.gypi ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet/common_header.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698