| 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 |
| 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/base/constructormagic.h" | 19 #include "webrtc/base/constructormagic.h" |
| 20 #include "webrtc/base/criticalsection.h" | 20 #include "webrtc/base/criticalsection.h" |
| 21 #include "webrtc/base/deprecation.h" |
| 21 #include "webrtc/base/random.h" | 22 #include "webrtc/base/random.h" |
| 22 #include "webrtc/base/rate_statistics.h" | 23 #include "webrtc/base/rate_statistics.h" |
| 23 #include "webrtc/base/thread_annotations.h" | 24 #include "webrtc/base/thread_annotations.h" |
| 24 #include "webrtc/common_types.h" | 25 #include "webrtc/common_types.h" |
| 25 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 26 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 26 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" | 27 #include "webrtc/modules/rtp_rtcp/source/playout_delay_oracle.h" |
| 27 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" | 28 #include "webrtc/modules/rtp_rtcp/source/rtp_header_extension.h" |
| 28 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" | 29 #include "webrtc/modules/rtp_rtcp/source/rtp_packet_history.h" |
| 29 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 30 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" |
| 30 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 31 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 uint8_t payload_type_red, | 265 uint8_t payload_type_red, |
| 265 uint8_t payload_type_fec); | 266 uint8_t payload_type_fec); |
| 266 | 267 |
| 267 void GenericFECStatus(bool* enable, | 268 void GenericFECStatus(bool* enable, |
| 268 uint8_t* payload_type_red, | 269 uint8_t* payload_type_red, |
| 269 uint8_t* payload_type_fec) const; | 270 uint8_t* payload_type_fec) const; |
| 270 | 271 |
| 271 int32_t SetFecParameters(const FecProtectionParams *delta_params, | 272 int32_t SetFecParameters(const FecProtectionParams *delta_params, |
| 272 const FecProtectionParams *key_params); | 273 const FecProtectionParams *key_params); |
| 273 | 274 |
| 275 RTC_DEPRECATED |
| 274 size_t SendPadData(size_t bytes, | 276 size_t SendPadData(size_t bytes, |
| 275 bool timestamp_provided, | 277 bool timestamp_provided, |
| 276 uint32_t timestamp, | 278 uint32_t timestamp, |
| 277 int64_t capture_time_ms); | 279 int64_t capture_time_ms); |
| 278 size_t SendPadData(size_t bytes, | |
| 279 bool timestamp_provided, | |
| 280 uint32_t timestamp, | |
| 281 int64_t capture_time_ms, | |
| 282 int probe_cluster_id); | |
| 283 | 280 |
| 284 // Called on update of RTP statistics. | 281 // Called on update of RTP statistics. |
| 285 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); | 282 void RegisterRtpStatisticsCallback(StreamDataCountersCallback* callback); |
| 286 StreamDataCountersCallback* GetRtpStatisticsCallback() const; | 283 StreamDataCountersCallback* GetRtpStatisticsCallback() const; |
| 287 | 284 |
| 288 uint32_t BitrateSent() const; | 285 uint32_t BitrateSent() const; |
| 289 | 286 |
| 290 void SetRtpState(const RtpState& rtp_state); | 287 void SetRtpState(const RtpState& rtp_state); |
| 291 RtpState GetRtpState() const; | 288 RtpState GetRtpState() const; |
| 292 void SetRtxRtpState(const RtpState& rtp_state); | 289 void SetRtxRtpState(const RtpState& rtp_state); |
| 293 RtpState GetRtxRtpState() const; | 290 RtpState GetRtxRtpState() const; |
| 294 bool ActivateCVORtpHeaderExtension(); | 291 bool ActivateCVORtpHeaderExtension(); |
| 295 | 292 |
| 296 protected: | 293 protected: |
| 297 int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type); | 294 int32_t CheckPayloadType(int8_t payload_type, RtpVideoCodecTypes* video_type); |
| 298 | 295 |
| 299 private: | 296 private: |
| 300 // Maps capture time in milliseconds to send-side delay in milliseconds. | 297 // Maps capture time in milliseconds to send-side delay in milliseconds. |
| 301 // Send-side delay is the difference between transmission time and capture | 298 // Send-side delay is the difference between transmission time and capture |
| 302 // time. | 299 // time. |
| 303 typedef std::map<int64_t, int> SendDelayMap; | 300 typedef std::map<int64_t, int> SendDelayMap; |
| 304 | 301 |
| 302 size_t SendPadData(size_t bytes, int probe_cluster_id); |
| 303 |
| 304 size_t DeprecatedSendPadData(size_t bytes, |
| 305 bool timestamp_provided, |
| 306 uint32_t timestamp, |
| 307 int64_t capture_time_ms, |
| 308 int probe_cluster_id); |
| 309 |
| 305 size_t CreateRtpHeader(uint8_t* header, | 310 size_t CreateRtpHeader(uint8_t* header, |
| 306 int8_t payload_type, | 311 int8_t payload_type, |
| 307 uint32_t ssrc, | 312 uint32_t ssrc, |
| 308 bool marker_bit, | 313 bool marker_bit, |
| 309 uint32_t timestamp, | 314 uint32_t timestamp, |
| 310 uint16_t sequence_number, | 315 uint16_t sequence_number, |
| 311 const std::vector<uint32_t>& csrcs) const | 316 const std::vector<uint32_t>& csrcs) const |
| 312 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); | 317 EXCLUSIVE_LOCKS_REQUIRED(send_critsect_); |
| 313 | 318 |
| 314 bool PrepareAndSendPacket(std::unique_ptr<RtpPacketToSend> packet, | 319 bool PrepareAndSendPacket(std::unique_ptr<RtpPacketToSend> packet, |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); | 432 std::map<int8_t, int8_t> rtx_payload_type_map_ GUARDED_BY(send_critsect_); |
| 428 | 433 |
| 429 RateLimiter* const retransmission_rate_limiter_; | 434 RateLimiter* const retransmission_rate_limiter_; |
| 430 | 435 |
| 431 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); | 436 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RTPSender); |
| 432 }; | 437 }; |
| 433 | 438 |
| 434 } // namespace webrtc | 439 } // namespace webrtc |
| 435 | 440 |
| 436 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ | 441 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_H_ |
| OLD | NEW |