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

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: addressed feedback Created 4 years, 6 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 28 matching lines...) Expand all
39 class RtcEventLog; 39 class RtcEventLog;
40 40
41 class RTPSenderInterface { 41 class RTPSenderInterface {
42 public: 42 public:
43 RTPSenderInterface() {} 43 RTPSenderInterface() {}
44 virtual ~RTPSenderInterface() {} 44 virtual ~RTPSenderInterface() {}
45 45
46 virtual uint32_t SSRC() const = 0; 46 virtual uint32_t SSRC() const = 0;
47 virtual uint32_t Timestamp() const = 0; 47 virtual uint32_t Timestamp() const = 0;
48 48
49 // Deprecated version of BuildRtpHeader(). |inc_sequence_number| is ignored.
50 // TODO(sergeyu): Remove this method.
49 virtual int32_t BuildRTPheader(uint8_t* data_buffer, 51 virtual int32_t BuildRTPheader(uint8_t* data_buffer,
50 int8_t payload_type, 52 int8_t payload_type,
51 bool marker_bit, 53 bool marker_bit,
52 uint32_t capture_timestamp, 54 uint32_t capture_timestamp,
53 int64_t capture_time_ms, 55 int64_t capture_time_ms,
54 bool timestamp_provided = true, 56 bool timestamp_provided = true,
55 bool inc_sequence_number = true) = 0; 57 bool inc_sequence_number = true) = 0;
56 58
59 virtual int32_t BuildRtpHeader(uint8_t* data_buffer,
60 int8_t payload_type,
61 bool marker_bit,
62 uint32_t capture_timestamp,
63 int64_t capture_time_ms) = 0;
64
57 // This returns the expected header length taking into consideration 65 // This returns the expected header length taking into consideration
58 // the optional RTP header extensions that may not be currently active. 66 // the optional RTP header extensions that may not be currently active.
59 virtual size_t RtpHeaderLength() const = 0; 67 virtual size_t RtpHeaderLength() const = 0;
60 // Returns the next sequence number to use for a packet and allocates 68 // Returns the next sequence number to use for a packet and allocates
61 // 'packets_to_send' number of sequence numbers. It's important all allocated 69 // 'packets_to_send' number of sequence numbers. It's important all allocated
62 // sequence numbers are used in sequence to avoid perceived packet loss. 70 // sequence numbers are used in sequence to avoid perceived packet loss.
63 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0; 71 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0;
64 virtual uint16_t SequenceNumber() const = 0; 72 virtual uint16_t SequenceNumber() const = 0;
65 virtual size_t MaxPayloadLength() const = 0; 73 virtual size_t MaxPayloadLength() const = 0;
66 virtual size_t MaxDataPayloadLength() const = 0; 74 virtual size_t MaxDataPayloadLength() const = 0;
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 154
147 void SetMaxPayloadLength(size_t max_payload_length); 155 void SetMaxPayloadLength(size_t max_payload_length);
148 156
149 int32_t SendOutgoingData(FrameType frame_type, 157 int32_t SendOutgoingData(FrameType frame_type,
150 int8_t payload_type, 158 int8_t payload_type,
151 uint32_t timestamp, 159 uint32_t timestamp,
152 int64_t capture_time_ms, 160 int64_t capture_time_ms,
153 const uint8_t* payload_data, 161 const uint8_t* payload_data,
154 size_t payload_size, 162 size_t payload_size,
155 const RTPFragmentationHeader* fragmentation, 163 const RTPFragmentationHeader* fragmentation,
156 const RTPVideoHeader* rtp_hdr = NULL); 164 const RTPVideoHeader* rtp_header);
157 165
158 // RTP header extension 166 // RTP header extension
159 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset); 167 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset);
160 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time); 168 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time);
161 void SetVideoRotation(VideoRotation rotation); 169 void SetVideoRotation(VideoRotation rotation);
162 int32_t SetTransportSequenceNumber(uint16_t sequence_number); 170 int32_t SetTransportSequenceNumber(uint16_t sequence_number);
163 171
164 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); 172 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id);
165 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override; 173 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override;
166 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type); 174 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type);
167 175
168 size_t RtpHeaderExtensionLength() const; 176 size_t RtpHeaderExtensionLength() const;
169 177
170 uint16_t BuildRTPHeaderExtension(uint8_t* data_buffer, bool marker_bit) const; 178 uint16_t BuildRtpHeaderExtension(uint8_t* data_buffer, bool marker_bit) const;
171 179
172 uint8_t BuildTransmissionTimeOffsetExtension(uint8_t *data_buffer) const; 180 uint8_t BuildTransmissionTimeOffsetExtension(uint8_t *data_buffer) const;
173 uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const; 181 uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const;
174 uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const; 182 uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const;
175 uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const; 183 uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const;
176 uint8_t BuildTransportSequenceNumberExtension(uint8_t* data_buffer, 184 uint8_t BuildTransportSequenceNumberExtension(uint8_t* data_buffer,
177 uint16_t sequence_number) const; 185 uint16_t sequence_number) const;
178 uint8_t BuildPlayoutDelayExtension(uint8_t* data_buffer, 186 uint8_t BuildPlayoutDelayExtension(uint8_t* data_buffer,
179 uint16_t min_playout_delay_ms, 187 uint16_t min_playout_delay_ms,
180 uint16_t max_playout_delay_ms) const; 188 uint16_t max_playout_delay_ms) const;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 void SetRtxSsrc(uint32_t ssrc); 248 void SetRtxSsrc(uint32_t ssrc);
241 249
242 void SetRtxPayloadType(int payload_type, int associated_payload_type); 250 void SetRtxPayloadType(int payload_type, int associated_payload_type);
243 251
244 // Functions wrapping RTPSenderInterface. 252 // Functions wrapping RTPSenderInterface.
245 int32_t BuildRTPheader(uint8_t* data_buffer, 253 int32_t BuildRTPheader(uint8_t* data_buffer,
246 int8_t payload_type, 254 int8_t payload_type,
247 bool marker_bit, 255 bool marker_bit,
248 uint32_t capture_timestamp, 256 uint32_t capture_timestamp,
249 int64_t capture_time_ms, 257 int64_t capture_time_ms,
250 const bool timestamp_provided = true, 258 bool timestamp_provided = true,
251 const bool inc_sequence_number = true) override; 259 bool inc_sequence_number = true) override;
260 int32_t BuildRtpHeader(uint8_t* data_buffer,
261 int8_t payload_type,
262 bool marker_bit,
263 uint32_t capture_timestamp,
264 int64_t capture_time_ms) override;
252 265
253 size_t RtpHeaderLength() const override; 266 size_t RtpHeaderLength() const override;
254 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override; 267 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override;
255 size_t MaxPayloadLength() const override; 268 size_t MaxPayloadLength() const override;
256 269
257 // Current timestamp. 270 // Current timestamp.
258 uint32_t Timestamp() const override; 271 uint32_t Timestamp() const override;
259 uint32_t SSRC() const override; 272 uint32_t SSRC() const override;
260 273
261 int32_t SendToNetwork(uint8_t* data_buffer, 274 int32_t SendToNetwork(uint8_t* data_buffer,
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 uint8_t* payload_type_red, 310 uint8_t* payload_type_red,
298 uint8_t* payload_type_fec) const; 311 uint8_t* payload_type_fec) const;
299 312
300 int32_t SetFecParameters(const FecProtectionParams *delta_params, 313 int32_t SetFecParameters(const FecProtectionParams *delta_params,
301 const FecProtectionParams *key_params); 314 const FecProtectionParams *key_params);
302 315
303 size_t SendPadData(size_t bytes, 316 size_t SendPadData(size_t bytes,
304 bool timestamp_provided, 317 bool timestamp_provided,
305 uint32_t timestamp, 318 uint32_t timestamp,
306 int64_t capture_time_ms); 319 int64_t capture_time_ms);
307
308 size_t SendPadData(size_t bytes, 320 size_t SendPadData(size_t bytes,
309 bool timestamp_provided, 321 bool timestamp_provided,
310 uint32_t timestamp, 322 uint32_t timestamp,
311 int64_t capture_time_ms, 323 int64_t capture_time_ms,
312 int probe_cluster_id); 324 int probe_cluster_id);
313 325
314 // Called on update of RTP statistics. 326 // Called on update of RTP statistics.
315 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); 327 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback);
316 StreamDataCountersCallback* GetRtpStatisticsCallback() const; 328 StreamDataCountersCallback* GetRtpStatisticsCallback() const;
317 329
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 // that the target bitrate is still valid. 534 // that the target bitrate is still valid.
523 rtc::CriticalSection target_bitrate_critsect_; 535 rtc::CriticalSection target_bitrate_critsect_;
524 uint32_t target_bitrate_ GUARDED_BY(target_bitrate_critsect_); 536 uint32_t target_bitrate_ GUARDED_BY(target_bitrate_critsect_);
525 537
526 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); 538 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender);
527 }; 539 };
528 540
529 } // namespace webrtc 541 } // namespace webrtc
530 542
531 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ 543 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698