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

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 1 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/constructormagic.h" 20 #include "webrtc/base/constructormagic.h"
danilchap 2017/05/09 12:33:49 #include "webrtc/base/array_view.h"
erikvarga1 2017/05/09 13:30:30 Oops, I forgot that. Done now.
21 #include "webrtc/base/criticalsection.h" 21 #include "webrtc/base/criticalsection.h"
22 #include "webrtc/base/deprecation.h" 22 #include "webrtc/base/deprecation.h"
23 #include "webrtc/base/optional.h" 23 #include "webrtc/base/optional.h"
24 #include "webrtc/base/random.h" 24 #include "webrtc/base/random.h"
25 #include "webrtc/base/rate_statistics.h" 25 #include "webrtc/base/rate_statistics.h"
26 #include "webrtc/base/thread_annotations.h" 26 #include "webrtc/base/thread_annotations.h"
27 #include "webrtc/common_types.h" 27 #include "webrtc/common_types.h"
28 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h" 28 #include "webrtc/modules/rtp_rtcp/include/flexfec_sender.h"
29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" 29 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"
30 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" 30 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h"
(...skipping 25 matching lines...) Expand all
56 BitrateStatisticsObserver* bitrate_callback, 56 BitrateStatisticsObserver* bitrate_callback,
57 FrameCountObserver* frame_count_observer, 57 FrameCountObserver* frame_count_observer,
58 SendSideDelayObserver* send_side_delay_observer, 58 SendSideDelayObserver* send_side_delay_observer,
59 RtcEventLog* event_log, 59 RtcEventLog* event_log,
60 SendPacketObserver* send_packet_observer, 60 SendPacketObserver* send_packet_observer,
61 RateLimiter* nack_rate_limiter, 61 RateLimiter* nack_rate_limiter,
62 OverheadObserver* overhead_observer); 62 OverheadObserver* overhead_observer);
63 63
64 ~RTPSender(); 64 ~RTPSender();
65 65
66 // Size info for header extensions used by FEC packets.
67 static rtc::ArrayView<const RtpExtensionSize> FecExtensionSizes();
danilchap 2017/05/09 12:33:49 may be declare it it near AllocatePacket function,
erikvarga1 2017/05/09 13:30:31 Done. I thought for some reason that static functi
danilchap 2017/05/09 14:45:22 Factory methods should be placed at the top (and f
68
66 void ProcessBitrate(); 69 void ProcessBitrate();
67 70
68 uint16_t ActualSendBitrateKbit() const; 71 uint16_t ActualSendBitrateKbit() const;
69 72
70 uint32_t VideoBitrateSent() const; 73 uint32_t VideoBitrateSent() const;
71 uint32_t FecOverheadRate() const; 74 uint32_t FecOverheadRate() const;
72 uint32_t NackOverheadRate() const; 75 uint32_t NackOverheadRate() const;
73 76
74 // Excluding size of RTP and FEC headers. 77 // Excluding size of RTP and FEC headers.
75 size_t MaxPayloadSize() const; 78 size_t MaxPayloadSize(
79 rtc::ArrayView<const RtpExtensionSize> extension_sizes) const;
76 80
77 int32_t RegisterPayload(const char* payload_name, 81 int32_t RegisterPayload(const char* payload_name,
78 const int8_t payload_type, 82 const int8_t payload_type,
79 const uint32_t frequency, 83 const uint32_t frequency,
80 const size_t channels, 84 const size_t channels,
81 const uint32_t rate); 85 const uint32_t rate);
82 86
83 int32_t DeRegisterSendPayload(const int8_t payload_type); 87 int32_t DeRegisterSendPayload(const int8_t payload_type);
84 88
85 void SetSendPayloadType(int8_t payload_type); 89 void SetSendPayloadType(int8_t payload_type);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void SetRtxPayloadType(int payload_type, int associated_payload_type); 153 void SetRtxPayloadType(int payload_type, int associated_payload_type);
150 154
151 // Create empty packet, fills ssrc, csrcs and reserve place for header 155 // Create empty packet, fills ssrc, csrcs and reserve place for header
152 // extensions RtpSender updates before sending. 156 // extensions RtpSender updates before sending.
153 std::unique_ptr<RtpPacketToSend> AllocatePacket() const; 157 std::unique_ptr<RtpPacketToSend> AllocatePacket() const;
154 // Allocate sequence number for provided packet. 158 // Allocate sequence number for provided packet.
155 // Save packet's fields to generate padding that doesn't break media stream. 159 // Save packet's fields to generate padding that doesn't break media stream.
156 // Return false if sending was turned off. 160 // Return false if sending was turned off.
157 bool AssignSequenceNumber(RtpPacketToSend* packet); 161 bool AssignSequenceNumber(RtpPacketToSend* packet);
158 162
159 size_t RtpHeaderLength() const; 163 size_t RtpHeaderLength(
164 rtc::ArrayView<const RtpExtensionSize> extension_sizes) const;
160 uint16_t AllocateSequenceNumber(uint16_t packets_to_send); 165 uint16_t AllocateSequenceNumber(uint16_t packets_to_send);
161 // Including RTP headers. 166 // Including RTP headers.
162 size_t MaxRtpPacketSize() const; 167 size_t MaxRtpPacketSize() const;
163 168
164 uint32_t SSRC() const; 169 uint32_t SSRC() const;
165 170
166 rtc::Optional<uint32_t> FlexfecSsrc() const; 171 rtc::Optional<uint32_t> FlexfecSsrc() const;
167 172
168 bool SendToNetwork(std::unique_ptr<RtpPacketToSend> packet, 173 bool SendToNetwork(std::unique_ptr<RtpPacketToSend> packet,
169 StorageType storage, 174 StorageType storage,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 OverheadObserver* overhead_observer_; 329 OverheadObserver* overhead_observer_;
325 330
326 const bool send_side_bwe_with_overhead_; 331 const bool send_side_bwe_with_overhead_;
327 332
328 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); 333 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender);
329 }; 334 };
330 335
331 } // namespace webrtc 336 } // namespace webrtc
332 337
333 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ 338 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698