OLD | NEW |
---|---|
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 Loading... | |
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 virtual int32_t BuildRTPheader(uint8_t* data_buffer, | 49 virtual int32_t BuildRtpHeader(uint8_t* data_buffer, |
danilchap
2016/06/15 13:40:01
this function (with this spelling) is used outside
Sergey Ulanov
2016/06/15 18:27:53
Done.
| |
50 int8_t payload_type, | 50 int8_t payload_type, |
51 bool marker_bit, | 51 bool marker_bit, |
52 uint32_t capture_timestamp, | 52 uint32_t capture_timestamp, |
53 int64_t capture_time_ms, | 53 int64_t capture_time_ms) = 0; |
54 bool timestamp_provided = true, | |
55 bool inc_sequence_number = true) = 0; | |
56 | 54 |
57 // This returns the expected header length taking into consideration | 55 // This returns the expected header length taking into consideration |
58 // the optional RTP header extensions that may not be currently active. | 56 // the optional RTP header extensions that may not be currently active. |
59 virtual size_t RtpHeaderLength() const = 0; | 57 virtual size_t RtpHeaderLength() const = 0; |
60 // Returns the next sequence number to use for a packet and allocates | 58 // 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 | 59 // 'packets_to_send' number of sequence numbers. It's important all allocated |
62 // sequence numbers are used in sequence to avoid perceived packet loss. | 60 // sequence numbers are used in sequence to avoid perceived packet loss. |
63 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0; | 61 virtual uint16_t AllocateSequenceNumber(uint16_t packets_to_send) = 0; |
64 virtual uint16_t SequenceNumber() const = 0; | 62 virtual uint16_t SequenceNumber() const = 0; |
65 virtual size_t MaxPayloadLength() const = 0; | 63 virtual size_t MaxPayloadLength() const = 0; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
146 | 144 |
147 void SetMaxPayloadLength(size_t max_payload_length); | 145 void SetMaxPayloadLength(size_t max_payload_length); |
148 | 146 |
149 int32_t SendOutgoingData(FrameType frame_type, | 147 int32_t SendOutgoingData(FrameType frame_type, |
150 int8_t payload_type, | 148 int8_t payload_type, |
151 uint32_t timestamp, | 149 uint32_t timestamp, |
152 int64_t capture_time_ms, | 150 int64_t capture_time_ms, |
153 const uint8_t* payload_data, | 151 const uint8_t* payload_data, |
154 size_t payload_size, | 152 size_t payload_size, |
155 const RTPFragmentationHeader* fragmentation, | 153 const RTPFragmentationHeader* fragmentation, |
156 const RTPVideoHeader* rtp_hdr = NULL); | 154 const RTPVideoHeader* rtp_header); |
157 | 155 |
158 // RTP header extension | 156 // RTP header extension |
159 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset); | 157 int32_t SetTransmissionTimeOffset(int32_t transmission_time_offset); |
160 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time); | 158 int32_t SetAbsoluteSendTime(uint32_t absolute_send_time); |
161 void SetVideoRotation(VideoRotation rotation); | 159 void SetVideoRotation(VideoRotation rotation); |
162 int32_t SetTransportSequenceNumber(uint16_t sequence_number); | 160 int32_t SetTransportSequenceNumber(uint16_t sequence_number); |
163 | 161 |
164 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); | 162 int32_t RegisterRtpHeaderExtension(RTPExtensionType type, uint8_t id); |
165 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override; | 163 bool IsRtpHeaderExtensionRegistered(RTPExtensionType type) override; |
166 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type); | 164 int32_t DeregisterRtpHeaderExtension(RTPExtensionType type); |
167 | 165 |
168 size_t RtpHeaderExtensionLength() const; | 166 size_t RtpHeaderExtensionLength() const; |
169 | 167 |
170 uint16_t BuildRTPHeaderExtension(uint8_t* data_buffer, bool marker_bit) const; | 168 uint16_t BuildRtpHeaderExtension(uint8_t* data_buffer, bool marker_bit) const; |
171 | 169 |
172 uint8_t BuildTransmissionTimeOffsetExtension(uint8_t *data_buffer) const; | 170 uint8_t BuildTransmissionTimeOffsetExtension(uint8_t *data_buffer) const; |
173 uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const; | 171 uint8_t BuildAudioLevelExtension(uint8_t* data_buffer) const; |
174 uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const; | 172 uint8_t BuildAbsoluteSendTimeExtension(uint8_t* data_buffer) const; |
175 uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const; | 173 uint8_t BuildVideoRotationExtension(uint8_t* data_buffer) const; |
176 uint8_t BuildTransportSequenceNumberExtension(uint8_t* data_buffer, | 174 uint8_t BuildTransportSequenceNumberExtension(uint8_t* data_buffer, |
177 uint16_t sequence_number) const; | 175 uint16_t sequence_number) const; |
178 uint8_t BuildPlayoutDelayExtension(uint8_t* data_buffer, | 176 uint8_t BuildPlayoutDelayExtension(uint8_t* data_buffer, |
179 uint16_t min_playout_delay_ms, | 177 uint16_t min_playout_delay_ms, |
180 uint16_t max_playout_delay_ms) const; | 178 uint16_t max_playout_delay_ms) const; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 // RTX. | 233 // RTX. |
236 void SetRtxStatus(int mode); | 234 void SetRtxStatus(int mode); |
237 int RtxStatus() const; | 235 int RtxStatus() const; |
238 | 236 |
239 uint32_t RtxSsrc() const; | 237 uint32_t RtxSsrc() const; |
240 void SetRtxSsrc(uint32_t ssrc); | 238 void SetRtxSsrc(uint32_t ssrc); |
241 | 239 |
242 void SetRtxPayloadType(int payload_type, int associated_payload_type); | 240 void SetRtxPayloadType(int payload_type, int associated_payload_type); |
243 | 241 |
244 // Functions wrapping RTPSenderInterface. | 242 // Functions wrapping RTPSenderInterface. |
245 int32_t BuildRTPheader(uint8_t* data_buffer, | 243 int32_t BuildRtpHeader(uint8_t* data_buffer, |
246 int8_t payload_type, | 244 int8_t payload_type, |
247 bool marker_bit, | 245 bool marker_bit, |
248 uint32_t capture_timestamp, | 246 uint32_t capture_timestamp, |
249 int64_t capture_time_ms, | 247 int64_t capture_time_ms) override; |
250 const bool timestamp_provided = true, | |
danilchap
2016/06/15 13:40:01
there is use (outside webrtc) of this function wit
Sergey Ulanov
2016/06/15 18:27:53
Added deprecated version with these parameters. No
| |
251 const bool inc_sequence_number = true) override; | |
252 | 248 |
253 size_t RtpHeaderLength() const override; | 249 size_t RtpHeaderLength() const override; |
254 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override; | 250 uint16_t AllocateSequenceNumber(uint16_t packets_to_send) override; |
255 size_t MaxPayloadLength() const override; | 251 size_t MaxPayloadLength() const override; |
256 | 252 |
257 // Current timestamp. | 253 // Current timestamp. |
258 uint32_t Timestamp() const override; | 254 uint32_t Timestamp() const override; |
259 uint32_t SSRC() const override; | 255 uint32_t SSRC() const override; |
260 | 256 |
261 int32_t SendToNetwork(uint8_t* data_buffer, | 257 int32_t SendToNetwork(uint8_t* data_buffer, |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 uint8_t payload_type_red, | 289 uint8_t payload_type_red, |
294 uint8_t payload_type_fec); | 290 uint8_t payload_type_fec); |
295 | 291 |
296 void GenericFECStatus(bool* enable, | 292 void GenericFECStatus(bool* enable, |
297 uint8_t* payload_type_red, | 293 uint8_t* payload_type_red, |
298 uint8_t* payload_type_fec) const; | 294 uint8_t* payload_type_fec) const; |
299 | 295 |
300 int32_t SetFecParameters(const FecProtectionParams *delta_params, | 296 int32_t SetFecParameters(const FecProtectionParams *delta_params, |
301 const FecProtectionParams *key_params); | 297 const FecProtectionParams *key_params); |
302 | 298 |
303 size_t SendPadData(size_t bytes, | 299 size_t SendPadData(size_t bytes, int probe_cluster_id); |
danilchap
2016/06/15 13:40:01
this version is used outside webrtc, (with timesta
Sergey Ulanov
2016/06/15 18:27:53
Done.
| |
304 bool timestamp_provided, | |
305 uint32_t timestamp, | |
306 int64_t capture_time_ms); | |
307 | |
308 size_t SendPadData(size_t bytes, | |
309 bool timestamp_provided, | |
310 uint32_t timestamp, | |
311 int64_t capture_time_ms, | |
312 int probe_cluster_id); | |
313 | 300 |
314 // Called on update of RTP statistics. | 301 // Called on update of RTP statistics. |
315 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); | 302 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); |
316 StreamDataCountersCallback* GetRtpStatisticsCallback() const; | 303 StreamDataCountersCallback* GetRtpStatisticsCallback() const; |
317 | 304 |
318 uint32_t BitrateSent() const; | 305 uint32_t BitrateSent() const; |
319 | 306 |
320 void SetRtpState(const RtpState& rtp_state); | 307 void SetRtpState(const RtpState& rtp_state); |
321 RtpState GetRtpState() const; | 308 RtpState GetRtpState() const; |
322 void SetRtxRtpState(const RtpState& rtp_state); | 309 void SetRtxRtpState(const RtpState& rtp_state); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 // that the target bitrate is still valid. | 509 // that the target bitrate is still valid. |
523 rtc::CriticalSection target_bitrate_critsect_; | 510 rtc::CriticalSection target_bitrate_critsect_; |
524 uint32_t target_bitrate_ GUARDED_BY(target_bitrate_critsect_); | 511 uint32_t target_bitrate_ GUARDED_BY(target_bitrate_critsect_); |
525 | 512 |
526 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); | 513 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); |
527 }; | 514 }; |
528 | 515 |
529 } // namespace webrtc | 516 } // namespace webrtc |
530 | 517 |
531 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 518 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
OLD | NEW |