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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 TemporalLayerStats() | 90 TemporalLayerStats() |
91 : frame_rate_fp1000s(kTLRateWindowSizeMs, 1000 * 1000), | 91 : frame_rate_fp1000s(kTLRateWindowSizeMs, 1000 * 1000), |
92 last_frame_time_ms(0) {} | 92 last_frame_time_ms(0) {} |
93 // Frame rate, in frames per 1000 seconds. This essentially turns the fps | 93 // Frame rate, in frames per 1000 seconds. This essentially turns the fps |
94 // value into a fixed point value with three decimals. Improves precision at | 94 // value into a fixed point value with three decimals. Improves precision at |
95 // low frame rates. | 95 // low frame rates. |
96 RateStatistics frame_rate_fp1000s; | 96 RateStatistics frame_rate_fp1000s; |
97 int64_t last_frame_time_ms; | 97 int64_t last_frame_time_ms; |
98 }; | 98 }; |
99 | 99 |
100 size_t CalculateFecPacketOverhead() const EXCLUSIVE_LOCKS_REQUIRED(crit_); | 100 size_t CalculateFecPacketOverhead() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
101 | 101 |
102 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, | 102 void SendVideoPacket(std::unique_ptr<RtpPacketToSend> packet, |
103 StorageType storage); | 103 StorageType storage); |
104 | 104 |
105 void SendVideoPacketAsRedMaybeWithUlpfec( | 105 void SendVideoPacketAsRedMaybeWithUlpfec( |
106 std::unique_ptr<RtpPacketToSend> media_packet, | 106 std::unique_ptr<RtpPacketToSend> media_packet, |
107 StorageType media_packet_storage, | 107 StorageType media_packet_storage, |
108 bool protect_media_packet); | 108 bool protect_media_packet); |
109 | 109 |
110 // TODO(brandtr): Remove the FlexFEC functions when FlexfecSender has been | 110 // TODO(brandtr): Remove the FlexFEC functions when FlexfecSender has been |
111 // moved to PacedSender. | 111 // moved to PacedSender. |
112 void SendVideoPacketWithFlexfec(std::unique_ptr<RtpPacketToSend> media_packet, | 112 void SendVideoPacketWithFlexfec(std::unique_ptr<RtpPacketToSend> media_packet, |
113 StorageType media_packet_storage, | 113 StorageType media_packet_storage, |
114 bool protect_media_packet); | 114 bool protect_media_packet); |
115 | 115 |
116 bool red_enabled() const EXCLUSIVE_LOCKS_REQUIRED(crit_) { | 116 bool red_enabled() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) { |
117 return red_payload_type_ >= 0; | 117 return red_payload_type_ >= 0; |
118 } | 118 } |
119 | 119 |
120 bool ulpfec_enabled() const EXCLUSIVE_LOCKS_REQUIRED(crit_) { | 120 bool ulpfec_enabled() const RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_) { |
121 return ulpfec_payload_type_ >= 0; | 121 return ulpfec_payload_type_ >= 0; |
122 } | 122 } |
123 | 123 |
124 bool flexfec_enabled() const { return flexfec_sender_ != nullptr; } | 124 bool flexfec_enabled() const { return flexfec_sender_ != nullptr; } |
125 | 125 |
126 bool UpdateConditionalRetransmit(uint8_t temporal_id, | 126 bool UpdateConditionalRetransmit(uint8_t temporal_id, |
127 int64_t expected_retransmission_time_ms) | 127 int64_t expected_retransmission_time_ms) |
128 EXCLUSIVE_LOCKS_REQUIRED(stats_crit_); | 128 RTC_EXCLUSIVE_LOCKS_REQUIRED(stats_crit_); |
129 | 129 |
130 RTPSender* const rtp_sender_; | 130 RTPSender* const rtp_sender_; |
131 Clock* const clock_; | 131 Clock* const clock_; |
132 | 132 |
133 // Should never be held when calling out of this class. | 133 // Should never be held when calling out of this class. |
134 rtc::CriticalSection crit_; | 134 rtc::CriticalSection crit_; |
135 | 135 |
136 RtpVideoCodecTypes video_type_; | 136 RtpVideoCodecTypes video_type_; |
137 int32_t retransmission_settings_ GUARDED_BY(crit_); | 137 int32_t retransmission_settings_ RTC_GUARDED_BY(crit_); |
138 VideoRotation last_rotation_ GUARDED_BY(crit_); | 138 VideoRotation last_rotation_ RTC_GUARDED_BY(crit_); |
139 | 139 |
140 // RED/ULPFEC. | 140 // RED/ULPFEC. |
141 int red_payload_type_ GUARDED_BY(crit_); | 141 int red_payload_type_ RTC_GUARDED_BY(crit_); |
142 int ulpfec_payload_type_ GUARDED_BY(crit_); | 142 int ulpfec_payload_type_ RTC_GUARDED_BY(crit_); |
143 UlpfecGenerator ulpfec_generator_ GUARDED_BY(crit_); | 143 UlpfecGenerator ulpfec_generator_ RTC_GUARDED_BY(crit_); |
144 | 144 |
145 // FlexFEC. | 145 // FlexFEC. |
146 FlexfecSender* const flexfec_sender_; | 146 FlexfecSender* const flexfec_sender_; |
147 | 147 |
148 // FEC parameters, applicable to either ULPFEC or FlexFEC. | 148 // FEC parameters, applicable to either ULPFEC or FlexFEC. |
149 FecProtectionParams delta_fec_params_ GUARDED_BY(crit_); | 149 FecProtectionParams delta_fec_params_ RTC_GUARDED_BY(crit_); |
150 FecProtectionParams key_fec_params_ GUARDED_BY(crit_); | 150 FecProtectionParams key_fec_params_ RTC_GUARDED_BY(crit_); |
151 | 151 |
152 rtc::CriticalSection stats_crit_; | 152 rtc::CriticalSection stats_crit_; |
153 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets | 153 // Bitrate used for FEC payload, RED headers, RTP headers for FEC packets |
154 // and any padding overhead. | 154 // and any padding overhead. |
155 RateStatistics fec_bitrate_ GUARDED_BY(stats_crit_); | 155 RateStatistics fec_bitrate_ RTC_GUARDED_BY(stats_crit_); |
156 // Bitrate used for video payload and RTP headers. | 156 // Bitrate used for video payload and RTP headers. |
157 RateStatistics video_bitrate_ GUARDED_BY(stats_crit_); | 157 RateStatistics video_bitrate_ RTC_GUARDED_BY(stats_crit_); |
158 | 158 |
159 std::map<int, TemporalLayerStats> frame_stats_by_temporal_layer_ | 159 std::map<int, TemporalLayerStats> frame_stats_by_temporal_layer_ |
160 GUARDED_BY(stats_crit_); | 160 RTC_GUARDED_BY(stats_crit_); |
161 | 161 |
162 OneTimeEvent first_frame_sent_; | 162 OneTimeEvent first_frame_sent_; |
163 }; | 163 }; |
164 | 164 |
165 } // namespace webrtc | 165 } // namespace webrtc |
166 | 166 |
167 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ | 167 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_SENDER_VIDEO_H_ |
OLD | NEW |