| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 |
| 11 | #ifndef VIDEO_VIDEO_STREAM_ENCODER_H_ |
| 12 | #define VIDEO_VIDEO_STREAM_ENCODER_H_ |
| 13 |
| 14 | #include <atomic> |
| 15 | #include <map> |
| 16 | #include <memory> |
| 17 | #include <string> |
| 18 | #include <vector> |
| 19 |
| 20 | #include "api/adaptation/resource.h" |
| 21 | #include "api/sequence_checker.h" |
| 22 | #include "api/units/data_rate.h" |
| 23 | #include "api/video/video_bitrate_allocator.h" |
| 24 | #include "api/video/video_rotation.h" |
| 25 | #include "api/video/video_sink_interface.h" |
| 26 | #include "api/video/video_stream_encoder_interface.h" |
| 27 | #include "api/video/video_stream_encoder_observer.h" |
| 28 | #include "api/video/video_stream_encoder_settings.h" |
| 29 | #include "api/video_codecs/video_codec.h" |
| 30 | #include "api/video_codecs/video_encoder.h" |
| 31 | #include "call/adaptation/adaptation_constraint.h" |
| 32 | #include "call/adaptation/resource_adaptation_processor.h" |
| 33 | #include "call/adaptation/resource_adaptation_processor_interface.h" |
| 34 | #include "call/adaptation/video_source_restrictions.h" |
| 35 | #include "call/adaptation/video_stream_input_state_provider.h" |
| 36 | #include "modules/video_coding/utility/frame_dropper.h" |
| 37 | #include "modules/video_coding/utility/qp_parser.h" |
| 38 | #include "rtc_base/experiments/rate_control_settings.h" |
| 39 | #include "rtc_base/numerics/exp_filter.h" |
| 40 | #include "rtc_base/race_checker.h" |
| 41 | #include "rtc_base/rate_statistics.h" |
| 42 | #include "rtc_base/task_queue.h" |
| 43 | #include "rtc_base/task_utils/pending_task_safety_flag.h" |
| 44 | #include "rtc_base/thread_annotations.h" |
| 45 | #include "system_wrappers/include/clock.h" |
| 46 | #include "video/adaptation/video_stream_encoder_resource_manager.h" |
| 47 | #include "video/encoder_bitrate_adjuster.h" |
| 48 | #include "video/frame_cadence_adapter.h" |
| 49 | #include "video/frame_encode_metadata_writer.h" |
| 50 | #include "video/video_source_sink_controller.h" |
| 51 |
| 52 | namespace webrtc { |
| 53 |
| 54 | // VideoStreamEncoder represent a video encoder that accepts raw video frames as |
| 55 | // input and produces an encoded bit stream. |
| 56 | // Usage: |
| 57 | // Instantiate. |
| 58 | // Call SetSink. |
| 59 | // Call SetSource. |
| 60 | // Call ConfigureEncoder with the codec settings. |
| 61 | // Call Stop() when done. |
| 62 | class VideoStreamEncoder : public VideoStreamEncoderInterface, |
| 63 | private EncodedImageCallback, |
| 64 | public VideoSourceRestrictionsListener { |
| 65 | public: |
| 66 | // TODO(bugs.webrtc.org/12000): Reporting of VideoBitrateAllocation is being |
| 67 | // deprecated. Instead VideoLayersAllocation should be reported. |
| 68 | enum class BitrateAllocationCallbackType { |
| 69 | kVideoBitrateAllocation, |
| 70 | kVideoBitrateAllocationWhenScreenSharing, |
| 71 | kVideoLayersAllocation |
| 72 | }; |
| 73 | VideoStreamEncoder( |
| 74 | Clock* clock, |
| 75 | uint32_t number_of_cores, |
| 76 | VideoStreamEncoderObserver* encoder_stats_observer, |
| 77 | const VideoStreamEncoderSettings& settings, |
| 78 | std::unique_ptr<OveruseFrameDetector> overuse_detector, |
| 79 | std::unique_ptr<FrameCadenceAdapterInterface> frame_cadence_adapter, |
| 80 | std::unique_ptr<webrtc::TaskQueueBase, webrtc::TaskQueueDeleter> |
| 81 | encoder_queue, |
| 82 | BitrateAllocationCallbackType allocation_cb_type); |
| 83 | ~VideoStreamEncoder() override; |
| 84 |
| 85 | void AddAdaptationResource(rtc::scoped_refptr<Resource> resource) override; |
| 86 | std::vector<rtc::scoped_refptr<Resource>> GetAdaptationResources() override; |
| 87 |
| 88 | void SetSource(rtc::VideoSourceInterface<VideoFrame>* source, |
| 89 | const DegradationPreference& degradation_preference) override; |
| 90 |
| 91 | void SetSink(EncoderSink* sink, bool rotation_applied) override; |
| 92 |
| 93 | // TODO(perkj): Can we remove VideoCodec.startBitrate ? |
| 94 | void SetStartBitrate(int start_bitrate_bps) override; |
| 95 |
| 96 | void SetFecControllerOverride( |
| 97 | FecControllerOverride* fec_controller_override) override; |
| 98 |
| 99 | void ConfigureEncoder(VideoEncoderConfig config, |
| 100 | size_t max_data_payload_length) override; |
| 101 |
| 102 | // Permanently stop encoding. After this method has returned, it is |
| 103 | // guaranteed that no encoded frames will be delivered to the sink. |
| 104 | void Stop() override; |
| 105 |
| 106 | void SendKeyFrame() override; |
| 107 |
| 108 | void OnLossNotification( |
| 109 | const VideoEncoder::LossNotification& loss_notification) override; |
| 110 |
| 111 | void OnBitrateUpdated(DataRate target_bitrate, |
| 112 | DataRate stable_target_bitrate, |
| 113 | DataRate target_headroom, |
| 114 | uint8_t fraction_lost, |
| 115 | int64_t round_trip_time_ms, |
| 116 | double cwnd_reduce_ratio) override; |
| 117 |
| 118 | DataRate UpdateTargetBitrate(DataRate target_bitrate, |
| 119 | double cwnd_reduce_ratio); |
| 120 |
| 121 | protected: |
| 122 | // Used for testing. For example the `ScalingObserverInterface` methods must |
| 123 | // be called on `encoder_queue_`. |
| 124 | rtc::TaskQueue* encoder_queue() { return &encoder_queue_; } |
| 125 |
| 126 | void OnVideoSourceRestrictionsUpdated( |
| 127 | VideoSourceRestrictions restrictions, |
| 128 | const VideoAdaptationCounters& adaptation_counters, |
| 129 | rtc::scoped_refptr<Resource> reason, |
| 130 | const VideoSourceRestrictions& unfiltered_restrictions) override; |
| 131 |
| 132 | // Used for injected test resources. |
| 133 | // TODO(eshr): Move all adaptation tests out of VideoStreamEncoder tests. |
| 134 | void InjectAdaptationResource(rtc::scoped_refptr<Resource> resource, |
| 135 | VideoAdaptationReason reason); |
| 136 | void InjectAdaptationConstraint(AdaptationConstraint* adaptation_constraint); |
| 137 |
| 138 | void AddRestrictionsListenerForTesting( |
| 139 | VideoSourceRestrictionsListener* restrictions_listener); |
| 140 | void RemoveRestrictionsListenerForTesting( |
| 141 | VideoSourceRestrictionsListener* restrictions_listener); |
| 142 |
| 143 | private: |
| 144 | class CadenceCallback : public FrameCadenceAdapterInterface::Callback { |
| 145 | public: |
| 146 | explicit CadenceCallback(VideoStreamEncoder& video_stream_encoder) |
| 147 | : video_stream_encoder_(video_stream_encoder) {} |
| 148 | // FrameCadenceAdapterInterface::Callback overrides. |
| 149 | void OnFrame(Timestamp post_time, |
| 150 | int frames_scheduled_for_processing, |
| 151 | const VideoFrame& frame) override { |
| 152 | video_stream_encoder_.OnFrame(post_time, frames_scheduled_for_processing, |
| 153 | frame); |
| 154 | } |
| 155 | void OnDiscardedFrame() override { |
| 156 | video_stream_encoder_.OnDiscardedFrame(); |
| 157 | } |
| 158 |
| 159 | private: |
| 160 | VideoStreamEncoder& video_stream_encoder_; |
| 161 | }; |
| 162 |
| 163 | class VideoFrameInfo { |
| 164 | public: |
| 165 | VideoFrameInfo(int width, int height, bool is_texture) |
| 166 | : width(width), height(height), is_texture(is_texture) {} |
| 167 | int width; |
| 168 | int height; |
| 169 | bool is_texture; |
| 170 | int pixel_count() const { return width * height; } |
| 171 | }; |
| 172 |
| 173 | struct EncoderRateSettings { |
| 174 | EncoderRateSettings(); |
| 175 | EncoderRateSettings(const VideoBitrateAllocation& bitrate, |
| 176 | double framerate_fps, |
| 177 | DataRate bandwidth_allocation, |
| 178 | DataRate encoder_target, |
| 179 | DataRate stable_encoder_target); |
| 180 | bool operator==(const EncoderRateSettings& rhs) const; |
| 181 | bool operator!=(const EncoderRateSettings& rhs) const; |
| 182 |
| 183 | VideoEncoder::RateControlParameters rate_control; |
| 184 | // This is the scalar target bitrate before the VideoBitrateAllocator, i.e. |
| 185 | // the `target_bitrate` argument of the OnBitrateUpdated() method. This is |
| 186 | // needed because the bitrate allocator may truncate the total bitrate and a |
| 187 | // later call to the same allocator instance, e.g. |
| 188 | // |using last_encoder_rate_setings_->bitrate.get_sum_bps()|, may trick it |
| 189 | // into thinking the available bitrate has decreased since the last call. |
| 190 | DataRate encoder_target; |
| 191 | DataRate stable_encoder_target; |
| 192 | }; |
| 193 |
| 194 | class DegradationPreferenceManager; |
| 195 |
| 196 | void ReconfigureEncoder() RTC_RUN_ON(&encoder_queue_); |
| 197 | void OnEncoderSettingsChanged() RTC_RUN_ON(&encoder_queue_); |
| 198 | void OnFrame(Timestamp post_time, |
| 199 | int frames_scheduled_for_processing, |
| 200 | const VideoFrame& video_frame); |
| 201 | void OnDiscardedFrame(); |
| 202 |
| 203 | void MaybeEncodeVideoFrame(const VideoFrame& frame, |
| 204 | int64_t time_when_posted_in_ms); |
| 205 |
| 206 | void EncodeVideoFrame(const VideoFrame& frame, |
| 207 | int64_t time_when_posted_in_ms); |
| 208 | // Indicates whether frame should be dropped because the pixel count is too |
| 209 | // large for the current bitrate configuration. |
| 210 | bool DropDueToSize(uint32_t pixel_count) const RTC_RUN_ON(&encoder_queue_); |
| 211 |
| 212 | // Implements EncodedImageCallback. |
| 213 | EncodedImageCallback::Result OnEncodedImage( |
| 214 | const EncodedImage& encoded_image, |
| 215 | const CodecSpecificInfo* codec_specific_info) override; |
| 216 |
| 217 | void OnDroppedFrame(EncodedImageCallback::DropReason reason) override; |
| 218 |
| 219 | bool EncoderPaused() const; |
| 220 | void TraceFrameDropStart(); |
| 221 | void TraceFrameDropEnd(); |
| 222 |
| 223 | // Returns a copy of `rate_settings` with the `bitrate` field updated using |
| 224 | // the current VideoBitrateAllocator. |
| 225 | EncoderRateSettings UpdateBitrateAllocation( |
| 226 | const EncoderRateSettings& rate_settings) RTC_RUN_ON(&encoder_queue_); |
| 227 |
| 228 | uint32_t GetInputFramerateFps() RTC_RUN_ON(&encoder_queue_); |
| 229 | void SetEncoderRates(const EncoderRateSettings& rate_settings) |
| 230 | RTC_RUN_ON(&encoder_queue_); |
| 231 |
| 232 | void RunPostEncode(const EncodedImage& encoded_image, |
| 233 | int64_t time_sent_us, |
| 234 | int temporal_index, |
| 235 | DataSize frame_size); |
| 236 | void ReleaseEncoder() RTC_RUN_ON(&encoder_queue_); |
| 237 | // After calling this function `resource_adaptation_processor_` will be null. |
| 238 | void ShutdownResourceAdaptationQueue(); |
| 239 |
| 240 | void CheckForAnimatedContent(const VideoFrame& frame, |
| 241 | int64_t time_when_posted_in_ms) |
| 242 | RTC_RUN_ON(&encoder_queue_); |
| 243 |
| 244 | TaskQueueBase* const worker_queue_; |
| 245 |
| 246 | const uint32_t number_of_cores_; |
| 247 |
| 248 | EncoderSink* sink_; |
| 249 | const VideoStreamEncoderSettings settings_; |
| 250 | const BitrateAllocationCallbackType allocation_cb_type_; |
| 251 | const RateControlSettings rate_control_settings_; |
| 252 |
| 253 | std::unique_ptr<VideoEncoderFactory::EncoderSelectorInterface> const |
| 254 | encoder_selector_; |
| 255 | VideoStreamEncoderObserver* const encoder_stats_observer_; |
| 256 | // Adapter that avoids public inheritance of the cadence adapter's callback |
| 257 | // interface. |
| 258 | CadenceCallback cadence_callback_; |
| 259 | // Frame cadence encoder adapter. Frames enter this adapter first, and it then |
| 260 | // forwards them to our OnFrame method. |
| 261 | std::unique_ptr<FrameCadenceAdapterInterface> frame_cadence_adapter_ |
| 262 | RTC_GUARDED_BY(&encoder_queue_) RTC_PT_GUARDED_BY(&encoder_queue_); |
| 263 |
| 264 | VideoEncoderConfig encoder_config_ RTC_GUARDED_BY(&encoder_queue_); |
| 265 | std::unique_ptr<VideoEncoder> encoder_ RTC_GUARDED_BY(&encoder_queue_) |
| 266 | RTC_PT_GUARDED_BY(&encoder_queue_); |
| 267 | bool encoder_initialized_; |
| 268 | std::unique_ptr<VideoBitrateAllocator> rate_allocator_ |
| 269 | RTC_GUARDED_BY(&encoder_queue_) RTC_PT_GUARDED_BY(&encoder_queue_); |
| 270 | int max_framerate_ RTC_GUARDED_BY(&encoder_queue_); |
| 271 |
| 272 | // Set when ConfigureEncoder has been called in order to lazy reconfigure the |
| 273 | // encoder on the next frame. |
| 274 | bool pending_encoder_reconfiguration_ RTC_GUARDED_BY(&encoder_queue_); |
| 275 | // Set when configuration must create a new encoder object, e.g., |
| 276 | // because of a codec change. |
| 277 | bool pending_encoder_creation_ RTC_GUARDED_BY(&encoder_queue_); |
| 278 |
| 279 | absl::optional<VideoFrameInfo> last_frame_info_ |
| 280 | RTC_GUARDED_BY(&encoder_queue_); |
| 281 | int crop_width_ RTC_GUARDED_BY(&encoder_queue_); |
| 282 | int crop_height_ RTC_GUARDED_BY(&encoder_queue_); |
| 283 | absl::optional<uint32_t> encoder_target_bitrate_bps_ |
| 284 | RTC_GUARDED_BY(&encoder_queue_); |
| 285 | size_t max_data_payload_length_ RTC_GUARDED_BY(&encoder_queue_); |
| 286 | absl::optional<EncoderRateSettings> last_encoder_rate_settings_ |
| 287 | RTC_GUARDED_BY(&encoder_queue_); |
| 288 | bool encoder_paused_and_dropped_frame_ RTC_GUARDED_BY(&encoder_queue_); |
| 289 |
| 290 | // Set to true if at least one frame was sent to encoder since last encoder |
| 291 | // initialization. |
| 292 | bool was_encode_called_since_last_initialization_ |
| 293 | RTC_GUARDED_BY(&encoder_queue_); |
| 294 |
| 295 | bool encoder_failed_ RTC_GUARDED_BY(&encoder_queue_); |
| 296 | Clock* const clock_; |
| 297 |
| 298 | // Used to make sure incoming time stamp is increasing for every frame. |
| 299 | int64_t last_captured_timestamp_ RTC_GUARDED_BY(&encoder_queue_); |
| 300 | // Delta used for translating between NTP and internal timestamps. |
| 301 | const int64_t delta_ntp_internal_ms_ RTC_GUARDED_BY(&encoder_queue_); |
| 302 |
| 303 | int64_t last_frame_log_ms_ RTC_GUARDED_BY(&encoder_queue_); |
| 304 | int captured_frame_count_ RTC_GUARDED_BY(&encoder_queue_); |
| 305 | int dropped_frame_cwnd_pushback_count_ RTC_GUARDED_BY(&encoder_queue_); |
| 306 | int dropped_frame_encoder_block_count_ RTC_GUARDED_BY(&encoder_queue_); |
| 307 | absl::optional<VideoFrame> pending_frame_ RTC_GUARDED_BY(&encoder_queue_); |
| 308 | int64_t pending_frame_post_time_us_ RTC_GUARDED_BY(&encoder_queue_); |
| 309 |
| 310 | VideoFrame::UpdateRect accumulated_update_rect_ |
| 311 | RTC_GUARDED_BY(&encoder_queue_); |
| 312 | bool accumulated_update_rect_is_valid_ RTC_GUARDED_BY(&encoder_queue_); |
| 313 |
| 314 | // Used for automatic content type detection. |
| 315 | absl::optional<VideoFrame::UpdateRect> last_update_rect_ |
| 316 | RTC_GUARDED_BY(&encoder_queue_); |
| 317 | Timestamp animation_start_time_ RTC_GUARDED_BY(&encoder_queue_); |
| 318 | bool cap_resolution_due_to_video_content_ RTC_GUARDED_BY(&encoder_queue_); |
| 319 | // Used to correctly ignore changes in update_rect introduced by |
| 320 | // resize triggered by animation detection. |
| 321 | enum class ExpectResizeState { |
| 322 | kNoResize, // Normal operation. |
| 323 | kResize, // Resize was triggered by the animation detection. |
| 324 | kFirstFrameAfterResize // Resize observed. |
| 325 | } expect_resize_state_ RTC_GUARDED_BY(&encoder_queue_); |
| 326 |
| 327 | FecControllerOverride* fec_controller_override_ |
| 328 | RTC_GUARDED_BY(&encoder_queue_); |
| 329 | absl::optional<int64_t> last_parameters_update_ms_ |
| 330 | RTC_GUARDED_BY(&encoder_queue_); |
| 331 | absl::optional<int64_t> last_encode_info_ms_ RTC_GUARDED_BY(&encoder_queue_); |
| 332 |
| 333 | VideoEncoder::EncoderInfo encoder_info_ RTC_GUARDED_BY(&encoder_queue_); |
| 334 | VideoCodec send_codec_ RTC_GUARDED_BY(&encoder_queue_); |
| 335 |
| 336 | FrameDropper frame_dropper_ RTC_GUARDED_BY(&encoder_queue_); |
| 337 | // If frame dropper is not force disabled, frame dropping might still be |
| 338 | // disabled if VideoEncoder::GetEncoderInfo() indicates that the encoder has a |
| 339 | // trusted rate controller. This is determined on a per-frame basis, as the |
| 340 | // encoder behavior might dynamically change. |
| 341 | bool force_disable_frame_dropper_ RTC_GUARDED_BY(&encoder_queue_); |
| 342 | // Incremented on worker thread whenever `frame_dropper_` determines that a |
| 343 | // frame should be dropped. Decremented on whichever thread runs |
| 344 | // OnEncodedImage(), which is only called by one thread but not necessarily |
| 345 | // the worker thread. |
| 346 | std::atomic<int> pending_frame_drops_; |
| 347 |
| 348 | // Congestion window frame drop ratio (drop 1 in every |
| 349 | // cwnd_frame_drop_interval_ frames). |
| 350 | absl::optional<int> cwnd_frame_drop_interval_ RTC_GUARDED_BY(&encoder_queue_); |
| 351 | // Frame counter for congestion window frame drop. |
| 352 | int cwnd_frame_counter_ RTC_GUARDED_BY(&encoder_queue_); |
| 353 |
| 354 | std::unique_ptr<EncoderBitrateAdjuster> bitrate_adjuster_ |
| 355 | RTC_GUARDED_BY(&encoder_queue_); |
| 356 |
| 357 | // TODO(sprang): Change actually support keyframe per simulcast stream, or |
| 358 | // turn this into a simple bool `pending_keyframe_request_`. |
| 359 | std::vector<VideoFrameType> next_frame_types_ RTC_GUARDED_BY(&encoder_queue_); |
| 360 |
| 361 | FrameEncodeMetadataWriter frame_encode_metadata_writer_; |
| 362 |
| 363 | // Experiment groups parsed from field trials for realtime video ([0]) and |
| 364 | // screenshare ([1]). 0 means no group specified. Positive values are |
| 365 | // experiment group numbers incremented by 1. |
| 366 | const std::array<uint8_t, 2> experiment_groups_; |
| 367 |
| 368 | struct AutomaticAnimationDetectionExperiment { |
| 369 | bool enabled = false; |
| 370 | int min_duration_ms = 2000; |
| 371 | double min_area_ratio = 0.8; |
| 372 | int min_fps = 10; |
| 373 | std::unique_ptr<StructParametersParser> Parser() { |
| 374 | return StructParametersParser::Create( |
| 375 | "enabled", &enabled, // |
| 376 | "min_duration_ms", &min_duration_ms, // |
| 377 | "min_area_ratio", &min_area_ratio, // |
| 378 | "min_fps", &min_fps); |
| 379 | } |
| 380 | }; |
| 381 |
| 382 | AutomaticAnimationDetectionExperiment |
| 383 | ParseAutomatincAnimationDetectionFieldTrial() const; |
| 384 |
| 385 | AutomaticAnimationDetectionExperiment |
| 386 | automatic_animation_detection_experiment_ RTC_GUARDED_BY(&encoder_queue_); |
| 387 |
| 388 | // Provides video stream input states: current resolution and frame rate. |
| 389 | VideoStreamInputStateProvider input_state_provider_; |
| 390 |
| 391 | std::unique_ptr<VideoStreamAdapter> video_stream_adapter_ |
| 392 | RTC_GUARDED_BY(&encoder_queue_); |
| 393 | // Responsible for adapting input resolution or frame rate to ensure resources |
| 394 | // (e.g. CPU or bandwidth) are not overused. Adding resources can occur on any |
| 395 | // thread. |
| 396 | std::unique_ptr<ResourceAdaptationProcessorInterface> |
| 397 | resource_adaptation_processor_; |
| 398 | std::unique_ptr<DegradationPreferenceManager> degradation_preference_manager_ |
| 399 | RTC_GUARDED_BY(&encoder_queue_); |
| 400 | std::vector<AdaptationConstraint*> adaptation_constraints_ |
| 401 | RTC_GUARDED_BY(&encoder_queue_); |
| 402 | // Handles input, output and stats reporting related to VideoStreamEncoder |
| 403 | // specific resources, such as "encode usage percent" measurements and "QP |
| 404 | // scaling". Also involved with various mitigations such as initial frame |
| 405 | // dropping. |
| 406 | // The manager primarily operates on the `encoder_queue_` but its lifetime is |
| 407 | // tied to the VideoStreamEncoder (which is destroyed off the encoder queue) |
| 408 | // and its resource list is accessible from any thread. |
| 409 | VideoStreamEncoderResourceManager stream_resource_manager_ |
| 410 | RTC_GUARDED_BY(&encoder_queue_); |
| 411 | std::vector<rtc::scoped_refptr<Resource>> additional_resources_ |
| 412 | RTC_GUARDED_BY(&encoder_queue_); |
| 413 | // Carries out the VideoSourceRestrictions provided by the |
| 414 | // ResourceAdaptationProcessor, i.e. reconfigures the source of video frames |
| 415 | // to provide us with different resolution or frame rate. |
| 416 | // This class is thread-safe. |
| 417 | VideoSourceSinkController video_source_sink_controller_ |
| 418 | RTC_GUARDED_BY(worker_queue_); |
| 419 |
| 420 | // Default bitrate limits in EncoderInfoSettings allowed. |
| 421 | const bool default_limits_allowed_; |
| 422 |
| 423 | // QP parser is used to extract QP value from encoded frame when that is not |
| 424 | // provided by encoder. |
| 425 | QpParser qp_parser_; |
| 426 | const bool qp_parsing_allowed_; |
| 427 |
| 428 | // Public methods are proxied to the task queues. The queues must be destroyed |
| 429 | // first to make sure no tasks run that use other members. |
| 430 | rtc::TaskQueue encoder_queue_; |
| 431 |
| 432 | // Used to cancel any potentially pending tasks to the worker thread. |
| 433 | ScopedTaskSafety task_safety_; |
| 434 |
| 435 | RTC_DISALLOW_COPY_AND_ASSIGN(VideoStreamEncoder); |
| 436 | }; |
| 437 |
| 438 | } // namespace webrtc |
| 439 |
| 440 | #endif // VIDEO_VIDEO_STREAM_ENCODER_H_ |
| 441 |