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

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

Issue 2867713003: Remove hardcoded kValueSizeBytes values from variable-length header extensions. (Closed)
Patch Set: Patch 5 Created 3 years, 7 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
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 10
11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
13 13
14 #include <map> 14 #include <map>
15 #include <memory> 15 #include <memory>
16 #include <utility> 16 #include <utility>
17 #include <vector> 17 #include <vector>
18 18
19 #include "webrtc/api/call/transport.h" 19 #include "webrtc/api/call/transport.h"
20 #include "webrtc/base/arraysize.h"
danilchap 2017/05/10 18:15:10 include it where you use it (i.e. in .cc instead o
erikvarga1 2017/05/11 08:40:13 Done.
21 #include "webrtc/base/array_view.h"
20 #include "webrtc/base/constructormagic.h" 22 #include "webrtc/base/constructormagic.h"
21 #include "webrtc/base/criticalsection.h" 23 #include "webrtc/base/criticalsection.h"
22 #include "webrtc/base/deprecation.h" 24 #include "webrtc/base/deprecation.h"
23 #include "webrtc/base/optional.h" 25 #include "webrtc/base/optional.h"
24 #include "webrtc/base/random.h" 26 #include "webrtc/base/random.h"
25 #include "webrtc/base/rate_statistics.h" 27 #include "webrtc/base/rate_statistics.h"
26 #include "webrtc/base/thread_annotations.h" 28 #include "webrtc/base/thread_annotations.h"
27 #include "webrtc/common_types.h" 29 #include "webrtc/common_types.h"
28 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h" 30 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h"
29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 31 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 ~RTPSender(); 66 ~RTPSender();
65 67
66 void ProcessBitrate(); 68 void ProcessBitrate();
67 69
68 uint16_t ActualSendBitrateKbit() const; 70 uint16_t ActualSendBitrateKbit() const;
69 71
70 uint32_t VideoBitrateSent() const; 72 uint32_t VideoBitrateSent() const;
71 uint32_t FecOverheadRate() const; 73 uint32_t FecOverheadRate() const;
72 uint32_t NackOverheadRate() const; 74 uint32_t NackOverheadRate() const;
73 75
74 // Excluding size of RTP and FEC headers.
75 size_t MaxPayloadSize() const;
76
77 int32_t RegisterPayload(const char* payload_name, 76 int32_t RegisterPayload(const char* payload_name,
78 const int8_t payload_type, 77 const int8_t payload_type,
79 const uint32_t frequency, 78 const uint32_t frequency,
80 const size_t channels, 79 const size_t channels,
81 const uint32_t rate); 80 const uint32_t rate);
82 81
83 int32_t DeRegisterSendPayload(const int8_t payload_type); 82 int32_t DeRegisterSendPayload(const int8_t payload_type);
84 83
85 void SetSendPayloadType(int8_t payload_type); 84 void SetSendPayloadType(int8_t payload_type);
86 85
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 140
142 // RTX. 141 // RTX.
143 void SetRtxStatus(int mode); 142 void SetRtxStatus(int mode);
144 int RtxStatus() const; 143 int RtxStatus() const;
145 144
146 uint32_t RtxSsrc() const; 145 uint32_t RtxSsrc() const;
147 void SetRtxSsrc(uint32_t ssrc); 146 void SetRtxSsrc(uint32_t ssrc);
148 147
149 void SetRtxPayloadType(int payload_type, int associated_payload_type); 148 void SetRtxPayloadType(int payload_type, int associated_payload_type);
150 149
150 // Size info for header extensions used by FEC packets.
151 static rtc::ArrayView<const RtpExtensionSize> FecExtensionSizes();
152
151 // Create empty packet, fills ssrc, csrcs and reserve place for header 153 // Create empty packet, fills ssrc, csrcs and reserve place for header
152 // extensions RtpSender updates before sending. 154 // extensions RtpSender updates before sending.
153 std::unique_ptr<RtpPacketToSend> AllocatePacket() const; 155 std::unique_ptr<RtpPacketToSend> AllocatePacket() const;
154 // Allocate sequence number for provided packet. 156 // Allocate sequence number for provided packet.
155 // Save packet's fields to generate padding that doesn't break media stream. 157 // Save packet's fields to generate padding that doesn't break media stream.
156 // Return false if sending was turned off. 158 // Return false if sending was turned off.
157 bool AssignSequenceNumber(RtpPacketToSend* packet); 159 bool AssignSequenceNumber(RtpPacketToSend* packet);
158 160
161 // Used for padding and FEC packets only.
159 size_t RtpHeaderLength() const; 162 size_t RtpHeaderLength() const;
160 uint16_t AllocateSequenceNumber(uint16_t packets_to_send); 163 uint16_t AllocateSequenceNumber(uint16_t packets_to_send);
161 // Including RTP headers. 164 // Including RTP headers.
162 size_t MaxRtpPacketSize() const; 165 size_t MaxRtpPacketSize() const;
163 166
164 uint32_t SSRC() const; 167 uint32_t SSRC() const;
165 168
166 rtc::Optional<uint32_t> FlexfecSsrc() const; 169 rtc::Optional<uint32_t> FlexfecSsrc() const;
167 170
168 bool SendToNetwork(std::unique_ptr<RtpPacketToSend> packet, 171 bool SendToNetwork(std::unique_ptr<RtpPacketToSend> packet,
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 OverheadObserver* overhead_observer_; 327 OverheadObserver* overhead_observer_;
325 328
326 const bool send_side_bwe_with_overhead_; 329 const bool send_side_bwe_with_overhead_;
327 330
328 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); 331 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender);
329 }; 332 };
330 333
331 } // namespace webrtc 334 } // namespace webrtc
332 335
333 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ 336 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698