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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 bool nack_enabled); | 99 bool nack_enabled); |
100 | 100 |
101 // Permanently stop encoding. After this method has returned, it is | 101 // Permanently stop encoding. After this method has returned, it is |
102 // guaranteed that no encoded frames will be delivered to the sink. | 102 // guaranteed that no encoded frames will be delivered to the sink. |
103 void Stop(); | 103 void Stop(); |
104 | 104 |
105 void SendKeyFrame(); | 105 void SendKeyFrame(); |
106 | 106 |
107 // virtual to test EncoderStateFeedback with mocks. | 107 // virtual to test EncoderStateFeedback with mocks. |
108 virtual void OnReceivedIntraFrameRequest(size_t stream_index); | 108 virtual void OnReceivedIntraFrameRequest(size_t stream_index); |
109 virtual void OnReceivedSLI(uint8_t picture_id); | |
110 virtual void OnReceivedRPSI(uint64_t picture_id); | |
111 | 109 |
112 void OnBitrateUpdated(uint32_t bitrate_bps, | 110 void OnBitrateUpdated(uint32_t bitrate_bps, |
113 uint8_t fraction_lost, | 111 uint8_t fraction_lost, |
114 int64_t round_trip_time_ms); | 112 int64_t round_trip_time_ms); |
115 | 113 |
116 protected: | 114 protected: |
117 // Used for testing. For example the |ScalingObserverInterface| methods must | 115 // Used for testing. For example the |ScalingObserverInterface| methods must |
118 // be called on |encoder_queue_|. | 116 // be called on |encoder_queue_|. |
119 rtc::TaskQueue* encoder_queue() { return &encoder_queue_; } | 117 rtc::TaskQueue* encoder_queue() { return &encoder_queue_; } |
120 | 118 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 201 |
204 // Set when ConfigureEncoder has been called in order to lazy reconfigure the | 202 // Set when ConfigureEncoder has been called in order to lazy reconfigure the |
205 // encoder on the next frame. | 203 // encoder on the next frame. |
206 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); | 204 bool pending_encoder_reconfiguration_ ACCESS_ON(&encoder_queue_); |
207 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); | 205 rtc::Optional<VideoFrameInfo> last_frame_info_ ACCESS_ON(&encoder_queue_); |
208 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 206 uint32_t encoder_start_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
209 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); | 207 size_t max_data_payload_length_ ACCESS_ON(&encoder_queue_); |
210 bool nack_enabled_ ACCESS_ON(&encoder_queue_); | 208 bool nack_enabled_ ACCESS_ON(&encoder_queue_); |
211 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); | 209 uint32_t last_observed_bitrate_bps_ ACCESS_ON(&encoder_queue_); |
212 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); | 210 bool encoder_paused_and_dropped_frame_ ACCESS_ON(&encoder_queue_); |
213 bool has_received_sli_ ACCESS_ON(&encoder_queue_); | |
214 uint8_t picture_id_sli_ ACCESS_ON(&encoder_queue_); | |
215 bool has_received_rpsi_ ACCESS_ON(&encoder_queue_); | |
216 uint64_t picture_id_rpsi_ ACCESS_ON(&encoder_queue_); | |
217 Clock* const clock_; | 211 Clock* const clock_; |
218 // Counters used for deciding if the video resolution is currently | 212 // Counters used for deciding if the video resolution is currently |
219 // restricted, and if so, why. | 213 // restricted, and if so, why. |
220 std::vector<int> scale_counter_ ACCESS_ON(&encoder_queue_); | 214 std::vector<int> scale_counter_ ACCESS_ON(&encoder_queue_); |
221 // Set depending on degradation preferences | 215 // Set depending on degradation preferences |
222 VideoSendStream::DegradationPreference degradation_preference_ | 216 VideoSendStream::DegradationPreference degradation_preference_ |
223 ACCESS_ON(&encoder_queue_); | 217 ACCESS_ON(&encoder_queue_); |
224 | 218 |
225 struct AdaptationRequest { | 219 struct AdaptationRequest { |
226 // The pixel count produced by the source at the time of the adaptation. | 220 // The pixel count produced by the source at the time of the adaptation. |
(...skipping 24 matching lines...) Expand all Loading... |
251 // All public methods are proxied to |encoder_queue_|. It must must be | 245 // All public methods are proxied to |encoder_queue_|. It must must be |
252 // destroyed first to make sure no tasks are run that use other members. | 246 // destroyed first to make sure no tasks are run that use other members. |
253 rtc::TaskQueue encoder_queue_; | 247 rtc::TaskQueue encoder_queue_; |
254 | 248 |
255 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); | 249 RTC_DISALLOW_COPY_AND_ASSIGN(ViEEncoder); |
256 }; | 250 }; |
257 | 251 |
258 } // namespace webrtc | 252 } // namespace webrtc |
259 | 253 |
260 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ | 254 #endif // WEBRTC_VIDEO_VIE_ENCODER_H_ |
OLD | NEW |