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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
211 bool has_received_rpsi_ ACCESS_ON(&encoder_queue_); | 211 bool has_received_rpsi_ ACCESS_ON(&encoder_queue_); |
212 uint64_t picture_id_rpsi_ ACCESS_ON(&encoder_queue_); | 212 uint64_t picture_id_rpsi_ ACCESS_ON(&encoder_queue_); |
213 Clock* const clock_; | 213 Clock* const clock_; |
214 // Counters used for deciding if the video resolution is currently | 214 // Counters used for deciding if the video resolution is currently |
215 // restricted, and if so, why. | 215 // restricted, and if so, why. |
216 std::vector<int> scale_counter_ ACCESS_ON(&encoder_queue_); | 216 std::vector<int> scale_counter_ ACCESS_ON(&encoder_queue_); |
217 // Set depending on degradation preferences | 217 // Set depending on degradation preferences |
218 VideoSendStream::DegradationPreference degradation_preference_ | 218 VideoSendStream::DegradationPreference degradation_preference_ |
219 ACCESS_ON(&encoder_queue_); | 219 ACCESS_ON(&encoder_queue_); |
220 | 220 |
221 // Pixel count last time the resolution was requested to be changed down. | 221 struct AdaptationRequest { |
222 rtc::Optional<int> max_pixel_count_ ACCESS_ON(&encoder_queue_); | 222 // The pixel count produced by the source at the time of the adaptation. |
223 // Pixel count last time the resolution was requested to be changed up. | 223 int input_pixel_count_; |
224 rtc::Optional<int> max_pixel_count_step_up_ ACCESS_ON(&encoder_queue_); | 224 // True if request was to adapt down, false otherwise. |
225 bool adapt_down_; | |
kthelgason
2017/02/06 12:13:21
Can we make this an enum instead? IMO having expli
sprang_webrtc
2017/02/06 13:18:07
Done.
| |
226 }; | |
227 // Stores a snapshot of the last adaptation request triggered by an AdaptUp | |
228 // or AdaptDown signal. | |
229 rtc::Optional<AdaptationRequest> last_adaptation_request_ | |
230 ACCESS_ON(&encoder_queue_); | |
225 | 231 |
226 rtc::RaceChecker incoming_frame_race_checker_ | 232 rtc::RaceChecker incoming_frame_race_checker_ |
227 GUARDED_BY(incoming_frame_race_checker_); | 233 GUARDED_BY(incoming_frame_race_checker_); |
228 Atomic32 posted_frames_waiting_for_encode_; | 234 Atomic32 posted_frames_waiting_for_encode_; |
229 // Used to make sure incoming time stamp is increasing for every frame. | 235 // Used to make sure incoming time stamp is increasing for every frame. |
230 int64_t last_captured_timestamp_ GUARDED_BY(incoming_frame_race_checker_); | 236 int64_t last_captured_timestamp_ GUARDED_BY(incoming_frame_race_checker_); |
231 // Delta used for translating between NTP and internal timestamps. | 237 // Delta used for translating between NTP and internal timestamps. |
232 const int64_t delta_ntp_internal_ms_ GUARDED_BY(incoming_frame_race_checker_); | 238 const int64_t delta_ntp_internal_ms_ GUARDED_BY(incoming_frame_race_checker_); |
233 | 239 |
234 int64_t last_frame_log_ms_ GUARDED_BY(incoming_frame_race_checker_); | 240 int64_t last_frame_log_ms_ GUARDED_BY(incoming_frame_race_checker_); |
235 int captured_frame_count_ ACCESS_ON(&encoder_queue_); | 241 int captured_frame_count_ ACCESS_ON(&encoder_queue_); |
236 int dropped_frame_count_ ACCESS_ON(&encoder_queue_); | 242 int dropped_frame_count_ ACCESS_ON(&encoder_queue_); |
237 | 243 |
238 VideoBitrateAllocationObserver* bitrate_observer_ ACCESS_ON(&encoder_queue_); | 244 VideoBitrateAllocationObserver* bitrate_observer_ ACCESS_ON(&encoder_queue_); |
239 rtc::Optional<int64_t> last_parameters_update_ms_ ACCESS_ON(&encoder_queue_); | 245 rtc::Optional<int64_t> last_parameters_update_ms_ ACCESS_ON(&encoder_queue_); |
240 | 246 |
241 // All public methods are proxied to |encoder_queue_|. It must must be | 247 // All public methods are proxied to |encoder_queue_|. It must must be |
242 // destroyed first to make sure no tasks are run that use other members. | 248 // destroyed first to make sure no tasks are run that use other members. |
243 rtc::TaskQueue encoder_queue_; | 249 rtc::TaskQueue encoder_queue_; |
244 | 250 |
245 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); | 251 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); |
246 }; | 252 }; |
247 | 253 |
248 } // namespace webrtc | 254 } // namespace webrtc |
249 | 255 |
250 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 256 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |