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

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

Issue 2067673004: Style cleanups in RtpSender. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 4 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
(...skipping 29 matching lines...) Expand all
40 class RtcEventLog; 40 class RtcEventLog;
41 41
42 class RTPSenderInterface { 42 class RTPSenderInterface {
43 public: 43 public:
44 RTPSenderInterface() {} 44 RTPSenderInterface() {}
45 virtual ~RTPSenderInterface() {} 45 virtual ~RTPSenderInterface() {}
46 46
47 virtual uint32_t SSRC() const = 0; 47 virtual uint32_t SSRC() const = 0;
48 virtual uint32_t Timestamp() const = 0; 48 virtual uint32_t Timestamp() const = 0;
49 49
50 // Deprecated version of BuildRtpHeader(). |timestamp_provided| and
51 // |inc_sequence_number| are ignored.
52 // TODO(sergeyu): Remove this method.
50 virtual int32_t BuildRTPheader(uint8_t* data_buffer, 53 virtual int32_t BuildRTPheader(uint8_t* data_buffer,
51 int8_t payload_type, 54 int8_t payload_type,
52 bool marker_bit, 55 bool marker_bit,
53 uint32_t capture_timestamp, 56 uint32_t capture_timestamp,
54 int64_t capture_time_ms, 57 int64_t capture_time_ms,
55 bool timestamp_provided = true, 58 bool timestamp_provided = true,
56 bool inc_sequence_number = true) = 0; 59 bool inc_sequence_number = true) = 0;
57 60
61 virtual int32_t BuildRtpHeader(uint8_t* data_buffer,
62 int8_t payload_type,
63 bool marker_bit,
64 uint32_t capture_timestamp,
65 int64_t capture_time_ms) = 0;
66
58 // This returns the expected header length taking into consideration 67 // This returns the expected header length taking into consideration
59 // the optional RTP header extensions that may not be currently active. 68 // the optional RTP header extensions that may not be currently active.
60 virtual size_t RtpHeaderLength() const = 0; 69 virtual size_t RtpHeaderLength() const = 0;
61 // Returns the next sequence number to use for a packet and allocates 70 // Returns the next sequence number to use for a packet and allocates
62 // 'packets_to_send' number of sequence numbers. It's important all allocated 71 // 'packets_to_send' number of sequence numbers. It's important all allocated
63 // sequence numbers are used in sequence to avoid perceived packet loss. 72 // sequence numbers are used in sequence to avoid perceived packet loss.
64 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0; 73 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0;
65 virtual uint16_t SequenceNumber() const = 0; 74 virtual uint16_t SequenceNumber() const = 0;
66 virtual size_t MaxPayloadLength() const = 0; 75 virtual size_t MaxPayloadLength() const = 0;
67 virtual size_t MaxDataPayloadLength() const = 0; 76 virtual size_t MaxDataPayloadLength() const = 0;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 154
146 void SetMaxPayloadLength(size_t max_payload_length); 155 void SetMaxPayloadLength(size_t max_payload_length);
147 156
148 int32_t SendOutgoingData(FrameType frame_type, 157 int32_t SendOutgoingData(FrameType frame_type,
149 int8_t payload_type, 158 int8_t payload_type,
150 uint32_t timestamp, 159 uint32_t timestamp,
151 int64_t capture_time_ms, 160 int64_t capture_time_ms,
152 const uint8_t* payload_data, 161 const uint8_t* payload_data,
153 size_t payload_size, 162 size_t payload_size,
154 const RTPFragmentationHeader* fragmentation, 163 const RTPFragmentationHeader* fragmentation,
155 const RTPVideoHeader* rtp_hdr = NULL); 164 const RTPVideoHeader* rtp_header);
156 165
157 // RTP header extension 166 // RTP header extension
158 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset); 167 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset);
159 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time); 168 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time);
160 void SetVideoRotation(VideoRotation rotation); 169 void SetVideoRotation(VideoRotation rotation);
161 int32_t SetTransportSequenceNumber(uint16_t sequence_number); 170 int32_t SetTransportSequenceNumber(uint16_t sequence_number);
162 171
163 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); 172 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id);
164 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override; 173 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override;
165 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type); 174 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type);
166 175
167 size_t RtpHeaderExtensionLength() const; 176 size_t RtpHeaderExtensionLength() const;
168 177
169 uint16_t BuildRTPHeaderExtension(uint8_t* data_buffer, bool marker_bit) const 178 uint16_t BuildRtpHeaderExtension(uint8_t* data_buffer, bool marker_bit) const
170 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); 179 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
171 180
172 uint8_t BuildTransmissionTimeOffsetExtension(uint8_t* data_buffer) const 181 uint8_t BuildTransmissionTimeOffsetExtension(uint8_t* data_buffer) const
173 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); 182 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
174 uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const 183 uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const
175 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); 184 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
176 uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const 185 uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const
177 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); 186 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
178 uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const 187 uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const
179 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); 188 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_);
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void SetRtxSsrc(uint32_t ssrc); 253 void SetRtxSsrc(uint32_t ssrc);
245 254
246 void SetRtxPayloadType(int payload_type, int associated_payload_type); 255 void SetRtxPayloadType(int payload_type, int associated_payload_type);
247 256
248 // Functions wrapping RTPSenderInterface. 257 // Functions wrapping RTPSenderInterface.
249 int32_t BuildRTPheader(uint8_t* data_buffer, 258 int32_t BuildRTPheader(uint8_t* data_buffer,
250 int8_t payload_type, 259 int8_t payload_type,
251 bool marker_bit, 260 bool marker_bit,
252 uint32_t capture_timestamp, 261 uint32_t capture_timestamp,
253 int64_t capture_time_ms, 262 int64_t capture_time_ms,
254 const bool timestamp_provided = true, 263 bool timestamp_provided = true,
255 const bool inc_sequence_number = true) override; 264 bool inc_sequence_number = true) override;
265 int32_t BuildRtpHeader(uint8_t* data_buffer,
266 int8_t payload_type,
267 bool marker_bit,
268 uint32_t capture_timestamp,
269 int64_t capture_time_ms) override;
256 270
257 size_t RtpHeaderLength() const override; 271 size_t RtpHeaderLength() const override;
258 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override; 272 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override;
259 size_t MaxPayloadLength() const override; 273 size_t MaxPayloadLength() const override;
260 274
261 // Current timestamp. 275 // Current timestamp.
262 uint32_t Timestamp() const override; 276 uint32_t Timestamp() const override;
263 uint32_t SSRC() const override; 277 uint32_t SSRC() const override;
264 278
265 int32_t SendToNetwork(uint8_t* data_buffer, 279 int32_t SendToNetwork(uint8_t* data_buffer,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 uint8_t* payload_type_red, 315 uint8_t* payload_type_red,
302 uint8_t* payload_type_fec) const; 316 uint8_t* payload_type_fec) const;
303 317
304 int32_t SetFecParameters(const FecProtectionParams *delta_params, 318 int32_t SetFecParameters(const FecProtectionParams *delta_params,
305 const FecProtectionParams *key_params); 319 const FecProtectionParams *key_params);
306 320
307 size_t SendPadData(size_t bytes, 321 size_t SendPadData(size_t bytes,
308 bool timestamp_provided, 322 bool timestamp_provided,
309 uint32_t timestamp, 323 uint32_t timestamp,
310 int64_t capture_time_ms); 324 int64_t capture_time_ms);
311
312 size_t SendPadData(size_t bytes, 325 size_t SendPadData(size_t bytes,
313 bool timestamp_provided, 326 bool timestamp_provided,
314 uint32_t timestamp, 327 uint32_t timestamp,
315 int64_t capture_time_ms, 328 int64_t capture_time_ms,
316 int probe_cluster_id); 329 int probe_cluster_id);
317 330
318 // Called on update of RTP statistics. 331 // Called on update of RTP statistics.
319 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); 332 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback);
320 StreamDataCountersCallback* GetRtpStatisticsCallback() const; 333 StreamDataCountersCallback* GetRtpStatisticsCallback() const;
321 334
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); 497 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_);
485 498
486 RateLimiter* const retransmission_rate_limiter_; 499 RateLimiter* const retransmission_rate_limiter_;
487 500
488 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); 501 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender);
489 }; 502 };
490 503
491 } // namespace webrtc 504 } // namespace webrtc
492 505
493 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ 506 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc ('k') | webrtc/modules/rtp_rtcp/source/rtp_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698