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

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtp_packet.h

Issue 3012983002: Remove RtpPacketToSend::GetHeader as almost unused. (Closed)
Patch Set: -forward declare of RTPHeader Created 3 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 unified diff | Download patch
« no previous file with comments | « webrtc/modules/rtp_rtcp/BUILD.gn ('k') | webrtc/modules/rtp_rtcp/source/rtp_packet.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ 10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_
11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ 11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_
12 12
13 #include <vector> 13 #include <vector>
14 14
15 #include "webrtc/api/array_view.h" 15 #include "webrtc/api/array_view.h"
16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
17 #include "webrtc/rtc_base/basictypes.h" 17 #include "webrtc/rtc_base/basictypes.h"
18 #include "webrtc/rtc_base/copyonwritebuffer.h" 18 #include "webrtc/rtc_base/copyonwritebuffer.h"
19 19
20 namespace webrtc { 20 namespace webrtc {
21 struct RTPHeader;
22 class RtpHeaderExtensionMap; 21 class RtpHeaderExtensionMap;
23 class Random; 22 class Random;
24 23
25 namespace rtp { 24 namespace rtp {
26 class Packet { 25 class Packet {
27 public: 26 public:
28 using ExtensionType = RTPExtensionType; 27 using ExtensionType = RTPExtensionType;
29 using ExtensionManager = RtpHeaderExtensionMap; 28 using ExtensionManager = RtpHeaderExtensionMap;
30 static constexpr size_t kMaxExtensionHeaders = 14; 29 static constexpr size_t kMaxExtensionHeaders = 14;
31 static constexpr int kMinExtensionId = 1; 30 static constexpr int kMinExtensionId = 1;
(...skipping 10 matching lines...) Expand all
42 void IdentifyExtensions(const ExtensionManager& extensions); 41 void IdentifyExtensions(const ExtensionManager& extensions);
43 42
44 // Header. 43 // Header.
45 bool Marker() const; 44 bool Marker() const;
46 uint8_t PayloadType() const; 45 uint8_t PayloadType() const;
47 uint16_t SequenceNumber() const; 46 uint16_t SequenceNumber() const;
48 uint32_t Timestamp() const; 47 uint32_t Timestamp() const;
49 uint32_t Ssrc() const; 48 uint32_t Ssrc() const;
50 std::vector<uint32_t> Csrcs() const; 49 std::vector<uint32_t> Csrcs() const;
51 50
52 // TODO(danilchap): Remove this function when all code update to use RtpPacket
53 // directly. Function is there just for easier backward compatibilty.
54 void GetHeader(RTPHeader* header) const;
55
56 size_t headers_size() const; 51 size_t headers_size() const;
57 52
58 // Payload. 53 // Payload.
59 size_t payload_size() const; 54 size_t payload_size() const;
60 size_t padding_size() const; 55 size_t padding_size() const;
61 rtc::ArrayView<const uint8_t> payload() const; 56 rtc::ArrayView<const uint8_t> payload() const;
62 57
63 // Buffer. 58 // Buffer.
64 rtc::CopyOnWriteBuffer Buffer() const; 59 rtc::CopyOnWriteBuffer Buffer() const;
65 size_t capacity() const; 60 size_t capacity() const;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 115
121 protected: 116 protected:
122 // |extensions| required for SetExtension/ReserveExtension functions during 117 // |extensions| required for SetExtension/ReserveExtension functions during
123 // packet creating and used if available in Parse function. 118 // packet creating and used if available in Parse function.
124 // Adding and getting extensions will fail until |extensions| is 119 // Adding and getting extensions will fail until |extensions| is
125 // provided via constructor or IdentifyExtensions function. 120 // provided via constructor or IdentifyExtensions function.
126 Packet(); 121 Packet();
127 explicit Packet(const ExtensionManager* extensions); 122 explicit Packet(const ExtensionManager* extensions);
128 Packet(const Packet&); 123 Packet(const Packet&);
129 Packet(const ExtensionManager* extensions, size_t capacity); 124 Packet(const ExtensionManager* extensions, size_t capacity);
130 virtual ~Packet(); 125 ~Packet();
131 126
132 Packet& operator=(const Packet&) = default; 127 Packet& operator=(const Packet&) = default;
133 128
134 private: 129 private:
135 struct ExtensionInfo { 130 struct ExtensionInfo {
136 ExtensionType type; 131 ExtensionType type;
137 uint16_t offset; 132 uint16_t offset;
138 uint8_t length; 133 uint8_t length;
139 }; 134 };
140 135
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 auto buffer = AllocateExtension(Extension::kId, Extension::kValueSizeBytes); 192 auto buffer = AllocateExtension(Extension::kId, Extension::kValueSizeBytes);
198 if (buffer.empty()) 193 if (buffer.empty())
199 return false; 194 return false;
200 memset(buffer.data(), 0, Extension::kValueSizeBytes); 195 memset(buffer.data(), 0, Extension::kValueSizeBytes);
201 return true; 196 return true;
202 } 197 }
203 } // namespace rtp 198 } // namespace rtp
204 } // namespace webrtc 199 } // namespace webrtc
205 200
206 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ 201 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/BUILD.gn ('k') | webrtc/modules/rtp_rtcp/source/rtp_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698