diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc index ead279425a..549a280407 100644 --- a/video/video_stream_encoder.cc +++ b/video/video_stream_encoder.cc @@ -525,11 +525,11 @@ VideoStreamEncoder::VideoStreamEncoder( frame_encode_metadata_writer_(this), experiment_groups_(GetExperimentGroups()), next_frame_id_(0), + encoder_switch_experiment_(ParseEncoderSwitchFieldTrial()), + encoder_switch_requested_(false), encoder_queue_(task_queue_factory->CreateTaskQueue( "EncoderQueue", - TaskQueueFactory::Priority::NORMAL)), - encoder_switch_experiment_(ParseEncoderSwitchFieldTrial()), - encoder_switch_requested_(false) { + TaskQueueFactory::Priority::NORMAL)) { RTC_DCHECK(encoder_stats_observer); RTC_DCHECK(overuse_detector_); RTC_DCHECK_GE(number_of_cores, 1); diff --git a/video/video_stream_encoder.h b/video/video_stream_encoder.h index 309052f79a..3b096329fe 100644 --- a/video/video_stream_encoder.h +++ b/video/video_stream_encoder.h @@ -389,10 +389,6 @@ class VideoStreamEncoder : public VideoStreamEncoderInterface, std::array, kMaxSimulcastStreams> encoder_buffer_state_ RTC_GUARDED_BY(encoded_image_lock_); - // All public methods are proxied to |encoder_queue_|. It must must be - // destroyed first to make sure no tasks are run that use other members. - rtc::TaskQueue encoder_queue_; - struct EncoderSwitchExperiment { struct Thresholds { absl::optional bitrate; @@ -429,6 +425,10 @@ class VideoStreamEncoder : public VideoStreamEncoderInterface, // track of whether a request has been made or not. bool encoder_switch_requested_ RTC_GUARDED_BY(&encoder_queue_); + // All public methods are proxied to |encoder_queue_|. It must must be + // destroyed first to make sure no tasks are run that use other members. + rtc::TaskQueue encoder_queue_; + RTC_DISALLOW_COPY_AND_ASSIGN(VideoStreamEncoder); };