| 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_VIDEO_H_ | 11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
| 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
| 13 | 13 |
| 14 #include <list> | 14 #include <list> |
| 15 | 15 |
| 16 #include "webrtc/base/criticalsection.h" | 16 #include "webrtc/base/criticalsection.h" |
| 17 #include "webrtc/base/onetimeevent.h" | 17 #include "webrtc/base/onetimeevent.h" |
| 18 #include "webrtc/base/rate_statistics.h" | |
| 19 #include "webrtc/base/thread_annotations.h" | 18 #include "webrtc/base/thread_annotations.h" |
| 20 #include "webrtc/common_types.h" | 19 #include "webrtc/common_types.h" |
| 21 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 20 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
| 21 #include "webrtc/modules/rtp_rtcp/source/bitrate.h" |
| 22 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" | 22 #include "webrtc/modules/rtp_rtcp/source/forward_error_correction.h" |
| 23 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h" | 23 #include "webrtc/modules/rtp_rtcp/source/producer_fec.h" |
| 24 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" | 24 #include "webrtc/modules/rtp_rtcp/source/rtp_rtcp_config.h" |
| 25 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" | 25 #include "webrtc/modules/rtp_rtcp/source/rtp_sender.h" |
| 26 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" | 26 #include "webrtc/modules/rtp_rtcp/source/rtp_utility.h" |
| 27 #include "webrtc/modules/rtp_rtcp/source/video_codec_information.h" | 27 #include "webrtc/modules/rtp_rtcp/source/video_codec_information.h" |
| 28 #include "webrtc/typedefs.h" | 28 #include "webrtc/typedefs.h" |
| 29 | 29 |
| 30 namespace webrtc { | 30 namespace webrtc { |
| 31 | 31 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 61 const uint8_t payloadTypeRED, | 61 const uint8_t payloadTypeRED, |
| 62 const uint8_t payloadTypeFEC); | 62 const uint8_t payloadTypeFEC); |
| 63 | 63 |
| 64 void GenericFECStatus(bool* enable, | 64 void GenericFECStatus(bool* enable, |
| 65 uint8_t* payloadTypeRED, | 65 uint8_t* payloadTypeRED, |
| 66 uint8_t* payloadTypeFEC) const; | 66 uint8_t* payloadTypeFEC) const; |
| 67 | 67 |
| 68 void SetFecParameters(const FecProtectionParams* delta_params, | 68 void SetFecParameters(const FecProtectionParams* delta_params, |
| 69 const FecProtectionParams* key_params); | 69 const FecProtectionParams* key_params); |
| 70 | 70 |
| 71 void ProcessBitrate(); |
| 72 |
| 71 uint32_t VideoBitrateSent() const; | 73 uint32_t VideoBitrateSent() const; |
| 72 uint32_t FecOverheadRate() const; | 74 uint32_t FecOverheadRate() const; |
| 73 | 75 |
| 74 int SelectiveRetransmissions() const; | 76 int SelectiveRetransmissions() const; |
| 75 void SetSelectiveRetransmissions(uint8_t settings); | 77 void SetSelectiveRetransmissions(uint8_t settings); |
| 76 | 78 |
| 77 private: | 79 private: |
| 78 void SendVideoPacket(uint8_t* dataBuffer, | 80 void SendVideoPacket(uint8_t* dataBuffer, |
| 79 const size_t payloadLength, | 81 const size_t payloadLength, |
| 80 const size_t rtpHeaderLength, | 82 const size_t rtpHeaderLength, |
| 81 uint16_t seq_num, | 83 uint16_t seq_num, |
| 82 const uint32_t capture_timestamp, | 84 const uint32_t capture_timestamp, |
| 83 int64_t capture_time_ms, | 85 int64_t capture_time_ms, |
| 84 StorageType storage); | 86 StorageType storage); |
| 85 | 87 |
| 86 void SendVideoPacketAsRed(uint8_t* dataBuffer, | 88 void SendVideoPacketAsRed(uint8_t* dataBuffer, |
| 87 const size_t payloadLength, | 89 const size_t payloadLength, |
| 88 const size_t rtpHeaderLength, | 90 const size_t rtpHeaderLength, |
| 89 uint16_t video_seq_num, | 91 uint16_t video_seq_num, |
| 90 const uint32_t capture_timestamp, | 92 const uint32_t capture_timestamp, |
| 91 int64_t capture_time_ms, | 93 int64_t capture_time_ms, |
| 92 StorageType media_packet_storage, | 94 StorageType media_packet_storage, |
| 93 bool protect); | 95 bool protect); |
| 94 | 96 |
| 95 RTPSenderInterface& _rtpSender; | 97 RTPSenderInterface& _rtpSender; |
| 96 Clock* const clock_; | |
| 97 | 98 |
| 98 // Should never be held when calling out of this class. | 99 // Should never be held when calling out of this class. |
| 99 rtc::CriticalSection crit_; | 100 const rtc::CriticalSection crit_; |
| 100 | 101 |
| 101 RtpVideoCodecTypes _videoType; | 102 RtpVideoCodecTypes _videoType; |
| 102 int32_t _retransmissionSettings GUARDED_BY(crit_); | 103 int32_t _retransmissionSettings GUARDED_BY(crit_); |
| 103 | 104 |
| 104 // FEC | 105 // FEC |
| 105 ForwardErrorCorrection fec_; | 106 ForwardErrorCorrection fec_; |
| 106 bool fec_enabled_ GUARDED_BY(crit_); | 107 bool fec_enabled_ GUARDED_BY(crit_); |
| 107 int8_t red_payload_type_ GUARDED_BY(crit_); | 108 int8_t red_payload_type_ GUARDED_BY(crit_); |
| 108 int8_t fec_payload_type_ GUARDED_BY(crit_); | 109 int8_t fec_payload_type_ GUARDED_BY(crit_); |
| 109 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); | 110 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); |
| 110 FecProtectionParams key_fec_params_ GUARDED_BY(crit_); | 111 FecProtectionParams key_fec_params_ GUARDED_BY(crit_); |
| 111 ProducerFec producer_fec_ GUARDED_BY(crit_); | 112 ProducerFec producer_fec_ GUARDED_BY(crit_); |
| 112 | 113 |
| 113 rtc::CriticalSection stats_crit_; | |
| 114 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets | 114 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets |
| 115 // and any padding overhead. | 115 // and any padding overhead. |
| 116 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); | 116 Bitrate _fecOverheadRate; |
| 117 // Bitrate used for video payload and RTP headers. | 117 // Bitrate used for video payload and RTP headers |
| 118 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); | 118 Bitrate _videoBitrate; |
| 119 OneTimeEvent first_frame_sent_; | 119 OneTimeEvent first_frame_sent_; |
| 120 }; | 120 }; |
| 121 } // namespace webrtc | 121 } // namespace webrtc |
| 122 | 122 |
| 123 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 123 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
| OLD | NEW |