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