| 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 |
| 11 #include "webrtc/video/vie_encoder.h" | 11 #include "webrtc/video/vie_encoder.h" |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 #include <limits> | 14 #include <limits> |
| 15 #include <utility> | 15 #include <utility> |
| 16 | 16 |
| 17 #include "webrtc/modules/video_coding/include/video_codec_initializer.h" | |
| 18 #include "webrtc/base/checks.h" | 17 #include "webrtc/base/checks.h" |
| 19 #include "webrtc/base/logging.h" | 18 #include "webrtc/base/logging.h" |
| 20 #include "webrtc/base/trace_event.h" | 19 #include "webrtc/base/trace_event.h" |
| 21 #include "webrtc/base/timeutils.h" | 20 #include "webrtc/base/timeutils.h" |
| 22 #include "webrtc/modules/pacing/paced_sender.h" | 21 #include "webrtc/modules/pacing/paced_sender.h" |
| 23 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h" | |
| 24 #include "webrtc/modules/video_coding/include/video_coding.h" | 22 #include "webrtc/modules/video_coding/include/video_coding.h" |
| 25 #include "webrtc/modules/video_coding/include/video_coding_defines.h" | 23 #include "webrtc/modules/video_coding/include/video_coding_defines.h" |
| 26 #include "webrtc/video/overuse_frame_detector.h" | 24 #include "webrtc/video/overuse_frame_detector.h" |
| 27 #include "webrtc/video/send_statistics_proxy.h" | 25 #include "webrtc/video/send_statistics_proxy.h" |
| 28 #include "webrtc/video_frame.h" | 26 #include "webrtc/video_frame.h" |
| 29 | 27 |
| 30 namespace webrtc { | 28 namespace webrtc { |
| 31 | 29 |
| 32 namespace { | 30 namespace { |
| 33 // Time interval for logging frame counts. | 31 // Time interval for logging frame counts. |
| 34 const int64_t kFrameLogIntervalMs = 60000; | 32 const int64_t kFrameLogIntervalMs = 60000; |
| 35 | 33 |
| 34 VideoCodecType PayloadNameToCodecType(const std::string& payload_name) { |
| 35 if (payload_name == "VP8") |
| 36 return kVideoCodecVP8; |
| 37 if (payload_name == "VP9") |
| 38 return kVideoCodecVP9; |
| 39 if (payload_name == "H264") |
| 40 return kVideoCodecH264; |
| 41 return kVideoCodecGeneric; |
| 42 } |
| 43 |
| 44 VideoCodec VideoEncoderConfigToVideoCodec( |
| 45 const VideoEncoderConfig& config, |
| 46 const std::vector<VideoStream>& streams, |
| 47 const std::string& payload_name, |
| 48 int payload_type) { |
| 49 static const int kEncoderMinBitrateKbps = 30; |
| 50 RTC_DCHECK(!streams.empty()); |
| 51 RTC_DCHECK_GE(config.min_transmit_bitrate_bps, 0); |
| 52 |
| 53 VideoCodec video_codec; |
| 54 memset(&video_codec, 0, sizeof(video_codec)); |
| 55 video_codec.codecType = PayloadNameToCodecType(payload_name); |
| 56 |
| 57 switch (config.content_type) { |
| 58 case VideoEncoderConfig::ContentType::kRealtimeVideo: |
| 59 video_codec.mode = kRealtimeVideo; |
| 60 break; |
| 61 case VideoEncoderConfig::ContentType::kScreen: |
| 62 video_codec.mode = kScreensharing; |
| 63 if (streams.size() == 1 && |
| 64 streams[0].temporal_layer_thresholds_bps.size() == 1) { |
| 65 video_codec.targetBitrate = |
| 66 streams[0].temporal_layer_thresholds_bps[0] / 1000; |
| 67 } |
| 68 break; |
| 69 } |
| 70 |
| 71 if (config.encoder_specific_settings) |
| 72 config.encoder_specific_settings->FillEncoderSpecificSettings(&video_codec); |
| 73 |
| 74 switch (video_codec.codecType) { |
| 75 case kVideoCodecVP8: { |
| 76 if (!config.encoder_specific_settings) |
| 77 *video_codec.VP8() = VideoEncoder::GetDefaultVp8Settings(); |
| 78 video_codec.VP8()->numberOfTemporalLayers = static_cast<unsigned char>( |
| 79 streams.back().temporal_layer_thresholds_bps.size() + 1); |
| 80 break; |
| 81 } |
| 82 case kVideoCodecVP9: { |
| 83 if (!config.encoder_specific_settings) |
| 84 *video_codec.VP9() = VideoEncoder::GetDefaultVp9Settings(); |
| 85 if (video_codec.mode == kScreensharing && |
| 86 config.encoder_specific_settings) { |
| 87 video_codec.VP9()->flexibleMode = true; |
| 88 // For now VP9 screensharing use 1 temporal and 2 spatial layers. |
| 89 RTC_DCHECK_EQ(1, video_codec.VP9()->numberOfTemporalLayers); |
| 90 RTC_DCHECK_EQ(2, video_codec.VP9()->numberOfSpatialLayers); |
| 91 } |
| 92 video_codec.VP9()->numberOfTemporalLayers = static_cast<unsigned char>( |
| 93 streams.back().temporal_layer_thresholds_bps.size() + 1); |
| 94 break; |
| 95 } |
| 96 case kVideoCodecH264: { |
| 97 if (!config.encoder_specific_settings) |
| 98 *video_codec.H264() = VideoEncoder::GetDefaultH264Settings(); |
| 99 break; |
| 100 } |
| 101 default: |
| 102 // TODO(pbos): Support encoder_settings codec-agnostically. |
| 103 RTC_DCHECK(!config.encoder_specific_settings) |
| 104 << "Encoder-specific settings for codec type not wired up."; |
| 105 break; |
| 106 } |
| 107 |
| 108 strncpy(video_codec.plName, payload_name.c_str(), kPayloadNameSize - 1); |
| 109 video_codec.plName[kPayloadNameSize - 1] = '\0'; |
| 110 video_codec.plType = payload_type; |
| 111 video_codec.numberOfSimulcastStreams = |
| 112 static_cast<unsigned char>(streams.size()); |
| 113 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; |
| 114 if (video_codec.minBitrate < kEncoderMinBitrateKbps) |
| 115 video_codec.minBitrate = kEncoderMinBitrateKbps; |
| 116 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); |
| 117 if (video_codec.codecType == kVideoCodecVP9) { |
| 118 // If the vector is empty, bitrates will be configured automatically. |
| 119 RTC_DCHECK(config.spatial_layers.empty() || |
| 120 config.spatial_layers.size() == |
| 121 video_codec.VP9()->numberOfSpatialLayers); |
| 122 RTC_DCHECK_LE(video_codec.VP9()->numberOfSpatialLayers, |
| 123 kMaxSimulcastStreams); |
| 124 for (size_t i = 0; i < config.spatial_layers.size(); ++i) |
| 125 video_codec.spatialLayers[i] = config.spatial_layers[i]; |
| 126 } |
| 127 for (size_t i = 0; i < streams.size(); ++i) { |
| 128 SimulcastStream* sim_stream = &video_codec.simulcastStream[i]; |
| 129 RTC_DCHECK_GT(streams[i].width, 0u); |
| 130 RTC_DCHECK_GT(streams[i].height, 0u); |
| 131 RTC_DCHECK_GT(streams[i].max_framerate, 0); |
| 132 // Different framerates not supported per stream at the moment. |
| 133 RTC_DCHECK_EQ(streams[i].max_framerate, streams[0].max_framerate); |
| 134 RTC_DCHECK_GE(streams[i].min_bitrate_bps, 0); |
| 135 RTC_DCHECK_GE(streams[i].target_bitrate_bps, streams[i].min_bitrate_bps); |
| 136 RTC_DCHECK_GE(streams[i].max_bitrate_bps, streams[i].target_bitrate_bps); |
| 137 RTC_DCHECK_GE(streams[i].max_qp, 0); |
| 138 |
| 139 sim_stream->width = static_cast<uint16_t>(streams[i].width); |
| 140 sim_stream->height = static_cast<uint16_t>(streams[i].height); |
| 141 sim_stream->minBitrate = streams[i].min_bitrate_bps / 1000; |
| 142 sim_stream->targetBitrate = streams[i].target_bitrate_bps / 1000; |
| 143 sim_stream->maxBitrate = streams[i].max_bitrate_bps / 1000; |
| 144 sim_stream->qpMax = streams[i].max_qp; |
| 145 sim_stream->numberOfTemporalLayers = static_cast<unsigned char>( |
| 146 streams[i].temporal_layer_thresholds_bps.size() + 1); |
| 147 |
| 148 video_codec.width = std::max(video_codec.width, |
| 149 static_cast<uint16_t>(streams[i].width)); |
| 150 video_codec.height = std::max( |
| 151 video_codec.height, static_cast<uint16_t>(streams[i].height)); |
| 152 video_codec.minBitrate = |
| 153 std::min(static_cast<uint16_t>(video_codec.minBitrate), |
| 154 static_cast<uint16_t>(streams[i].min_bitrate_bps / 1000)); |
| 155 video_codec.maxBitrate += streams[i].max_bitrate_bps / 1000; |
| 156 video_codec.qpMax = std::max(video_codec.qpMax, |
| 157 static_cast<unsigned int>(streams[i].max_qp)); |
| 158 } |
| 159 |
| 160 if (video_codec.maxBitrate == 0) { |
| 161 // Unset max bitrate -> cap to one bit per pixel. |
| 162 video_codec.maxBitrate = |
| 163 (video_codec.width * video_codec.height * video_codec.maxFramerate) / |
| 164 1000; |
| 165 } |
| 166 if (video_codec.maxBitrate < kEncoderMinBitrateKbps) |
| 167 video_codec.maxBitrate = kEncoderMinBitrateKbps; |
| 168 |
| 169 RTC_DCHECK_GT(streams[0].max_framerate, 0); |
| 170 video_codec.maxFramerate = streams[0].max_framerate; |
| 171 return video_codec; |
| 172 } |
| 173 |
| 36 // TODO(pbos): Lower these thresholds (to closer to 100%) when we handle | 174 // TODO(pbos): Lower these thresholds (to closer to 100%) when we handle |
| 37 // pipelining encoders better (multiple input frames before something comes | 175 // pipelining encoders better (multiple input frames before something comes |
| 38 // out). This should effectively turn off CPU adaptations for systems that | 176 // out). This should effectively turn off CPU adaptations for systems that |
| 39 // remotely cope with the load right now. | 177 // remotely cope with the load right now. |
| 40 CpuOveruseOptions GetCpuOveruseOptions(bool full_overuse_time) { | 178 CpuOveruseOptions GetCpuOveruseOptions(bool full_overuse_time) { |
| 41 CpuOveruseOptions options; | 179 CpuOveruseOptions options; |
| 42 if (full_overuse_time) { | 180 if (full_overuse_time) { |
| 43 options.low_encode_usage_threshold_percent = 150; | 181 options.low_encode_usage_threshold_percent = 150; |
| 44 options.high_encode_usage_threshold_percent = 200; | 182 options.high_encode_usage_threshold_percent = 200; |
| 45 } | 183 } |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 ViEEncoder::ViEEncoder(uint32_t number_of_cores, | 363 ViEEncoder::ViEEncoder(uint32_t number_of_cores, |
| 226 SendStatisticsProxy* stats_proxy, | 364 SendStatisticsProxy* stats_proxy, |
| 227 const VideoSendStream::Config::EncoderSettings& settings, | 365 const VideoSendStream::Config::EncoderSettings& settings, |
| 228 rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback, | 366 rtc::VideoSinkInterface<VideoFrame>* pre_encode_callback, |
| 229 EncodedFrameObserver* encoder_timing) | 367 EncodedFrameObserver* encoder_timing) |
| 230 : shutdown_event_(true /* manual_reset */, false), | 368 : shutdown_event_(true /* manual_reset */, false), |
| 231 number_of_cores_(number_of_cores), | 369 number_of_cores_(number_of_cores), |
| 232 source_proxy_(new VideoSourceProxy(this)), | 370 source_proxy_(new VideoSourceProxy(this)), |
| 233 sink_(nullptr), | 371 sink_(nullptr), |
| 234 settings_(settings), | 372 settings_(settings), |
| 235 codec_type_(PayloadNameToCodecType(settings.payload_name) | 373 codec_type_(PayloadNameToCodecType(settings.payload_name)), |
| 236 .value_or(VideoCodecType::kVideoCodecUnknown)), | |
| 237 video_sender_(Clock::GetRealTimeClock(), this, this), | 374 video_sender_(Clock::GetRealTimeClock(), this, this), |
| 238 overuse_detector_(Clock::GetRealTimeClock(), | 375 overuse_detector_(Clock::GetRealTimeClock(), |
| 239 GetCpuOveruseOptions(settings.full_overuse_time), | 376 GetCpuOveruseOptions(settings.full_overuse_time), |
| 240 this, | 377 this, |
| 241 encoder_timing, | 378 encoder_timing, |
| 242 stats_proxy), | 379 stats_proxy), |
| 243 stats_proxy_(stats_proxy), | 380 stats_proxy_(stats_proxy), |
| 244 pre_encode_callback_(pre_encode_callback), | 381 pre_encode_callback_(pre_encode_callback), |
| 245 module_process_thread_(nullptr), | 382 module_process_thread_(nullptr), |
| 246 pending_encoder_reconfiguration_(false), | 383 pending_encoder_reconfiguration_(false), |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 RTC_DCHECK(shutdown_event_.Wait(0)) | 415 RTC_DCHECK(shutdown_event_.Wait(0)) |
| 279 << "Must call ::Stop() before destruction."; | 416 << "Must call ::Stop() before destruction."; |
| 280 } | 417 } |
| 281 | 418 |
| 282 void ViEEncoder::Stop() { | 419 void ViEEncoder::Stop() { |
| 283 RTC_DCHECK_RUN_ON(&thread_checker_); | 420 RTC_DCHECK_RUN_ON(&thread_checker_); |
| 284 source_proxy_->SetSource(nullptr, VideoSendStream::DegradationPreference()); | 421 source_proxy_->SetSource(nullptr, VideoSendStream::DegradationPreference()); |
| 285 encoder_queue_.PostTask([this] { | 422 encoder_queue_.PostTask([this] { |
| 286 RTC_DCHECK_RUN_ON(&encoder_queue_); | 423 RTC_DCHECK_RUN_ON(&encoder_queue_); |
| 287 overuse_detector_.StopCheckForOveruse(); | 424 overuse_detector_.StopCheckForOveruse(); |
| 288 rate_allocator_.reset(); | |
| 289 video_sender_.RegisterExternalEncoder(nullptr, settings_.payload_type, | 425 video_sender_.RegisterExternalEncoder(nullptr, settings_.payload_type, |
| 290 false); | 426 false); |
| 291 shutdown_event_.Set(); | 427 shutdown_event_.Set(); |
| 292 }); | 428 }); |
| 293 | 429 |
| 294 shutdown_event_.Wait(rtc::Event::kForever); | 430 shutdown_event_.Wait(rtc::Event::kForever); |
| 295 } | 431 } |
| 296 | 432 |
| 297 void ViEEncoder::RegisterProcessThread(ProcessThread* module_process_thread) { | 433 void ViEEncoder::RegisterProcessThread(ProcessThread* module_process_thread) { |
| 298 RTC_DCHECK_RUN_ON(&thread_checker_); | 434 RTC_DCHECK_RUN_ON(&thread_checker_); |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 } | 509 } |
| 374 } | 510 } |
| 375 | 511 |
| 376 void ViEEncoder::ReconfigureEncoder() { | 512 void ViEEncoder::ReconfigureEncoder() { |
| 377 RTC_DCHECK_RUN_ON(&encoder_queue_); | 513 RTC_DCHECK_RUN_ON(&encoder_queue_); |
| 378 RTC_DCHECK(pending_encoder_reconfiguration_); | 514 RTC_DCHECK(pending_encoder_reconfiguration_); |
| 379 std::vector<VideoStream> streams = | 515 std::vector<VideoStream> streams = |
| 380 encoder_config_.video_stream_factory->CreateEncoderStreams( | 516 encoder_config_.video_stream_factory->CreateEncoderStreams( |
| 381 last_frame_info_->width, last_frame_info_->height, encoder_config_); | 517 last_frame_info_->width, last_frame_info_->height, encoder_config_); |
| 382 | 518 |
| 383 VideoCodec codec; | 519 VideoCodec codec = VideoEncoderConfigToVideoCodec( |
| 384 if (!VideoCodecInitializer::SetupCodec(encoder_config_, settings_, streams, | 520 encoder_config_, streams, settings_.payload_name, settings_.payload_type); |
| 385 &codec, &rate_allocator_)) { | |
| 386 LOG(LS_ERROR) << "Failed to create encoder configuration."; | |
| 387 } | |
| 388 | 521 |
| 389 codec.startBitrate = | 522 codec.startBitrate = |
| 390 std::max(encoder_start_bitrate_bps_ / 1000, codec.minBitrate); | 523 std::max(encoder_start_bitrate_bps_ / 1000, codec.minBitrate); |
| 391 codec.startBitrate = std::min(codec.startBitrate, codec.maxBitrate); | 524 codec.startBitrate = std::min(codec.startBitrate, codec.maxBitrate); |
| 392 codec.expect_encode_from_texture = last_frame_info_->is_texture; | 525 codec.expect_encode_from_texture = last_frame_info_->is_texture; |
| 393 | 526 |
| 394 bool success = video_sender_.RegisterSendCodec( | 527 bool success = video_sender_.RegisterSendCodec( |
| 395 &codec, number_of_cores_, | 528 &codec, number_of_cores_, |
| 396 static_cast<uint32_t>(max_data_payload_length_)) == VCM_OK; | 529 static_cast<uint32_t>(max_data_payload_length_)) == VCM_OK; |
| 397 if (!success) { | 530 if (!success) { |
| 398 LOG(LS_ERROR) << "Failed to configure encoder."; | 531 LOG(LS_ERROR) << "Failed to configure encoder."; |
| 399 RTC_DCHECK(success); | 532 RTC_DCHECK(success); |
| 400 } | 533 } |
| 401 | 534 |
| 402 video_sender_.UpdateChannelParemeters(rate_allocator_.get()); | 535 rate_allocator_.reset(new SimulcastRateAllocator(codec)); |
| 403 | |
| 404 if (stats_proxy_) { | 536 if (stats_proxy_) { |
| 405 int framerate = stats_proxy_->GetSendFrameRate(); | 537 stats_proxy_->OnEncoderReconfigured(encoder_config_, |
| 406 if (framerate == 0) | 538 rate_allocator_->GetPreferedBitrate()); |
| 407 framerate = codec.maxFramerate; | |
| 408 stats_proxy_->OnEncoderReconfigured( | |
| 409 encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate)); | |
| 410 } | 539 } |
| 411 | 540 |
| 412 pending_encoder_reconfiguration_ = false; | 541 pending_encoder_reconfiguration_ = false; |
| 413 | 542 if (stats_proxy_) { |
| 543 stats_proxy_->OnEncoderReconfigured(encoder_config_, |
| 544 rate_allocator_->GetPreferedBitrate()); |
| 545 } |
| 414 sink_->OnEncoderConfigurationChanged( | 546 sink_->OnEncoderConfigurationChanged( |
| 415 std::move(streams), encoder_config_.min_transmit_bitrate_bps); | 547 std::move(streams), encoder_config_.min_transmit_bitrate_bps); |
| 416 } | 548 } |
| 417 | 549 |
| 418 void ViEEncoder::OnFrame(const VideoFrame& video_frame) { | 550 void ViEEncoder::OnFrame(const VideoFrame& video_frame) { |
| 419 RTC_DCHECK_RUNS_SERIALIZED(&incoming_frame_race_checker_); | 551 RTC_DCHECK_RUNS_SERIALIZED(&incoming_frame_race_checker_); |
| 420 VideoFrame incoming_frame = video_frame; | 552 VideoFrame incoming_frame = video_frame; |
| 421 | 553 |
| 422 // Local time in webrtc time base. | 554 // Local time in webrtc time base. |
| 423 int64_t current_time = clock_->TimeInMilliseconds(); | 555 int64_t current_time = clock_->TimeInMilliseconds(); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 return; | 757 return; |
| 626 } | 758 } |
| 627 RTC_DCHECK_RUN_ON(&encoder_queue_); | 759 RTC_DCHECK_RUN_ON(&encoder_queue_); |
| 628 RTC_DCHECK(sink_) << "sink_ must be set before the encoder is active."; | 760 RTC_DCHECK(sink_) << "sink_ must be set before the encoder is active."; |
| 629 | 761 |
| 630 LOG(LS_VERBOSE) << "OnBitrateUpdated, bitrate " << bitrate_bps | 762 LOG(LS_VERBOSE) << "OnBitrateUpdated, bitrate " << bitrate_bps |
| 631 << " packet loss " << static_cast<int>(fraction_lost) | 763 << " packet loss " << static_cast<int>(fraction_lost) |
| 632 << " rtt " << round_trip_time_ms; | 764 << " rtt " << round_trip_time_ms; |
| 633 | 765 |
| 634 video_sender_.SetChannelParameters(bitrate_bps, fraction_lost, | 766 video_sender_.SetChannelParameters(bitrate_bps, fraction_lost, |
| 635 round_trip_time_ms, rate_allocator_.get()); | 767 round_trip_time_ms); |
| 636 | 768 |
| 637 encoder_start_bitrate_bps_ = | 769 encoder_start_bitrate_bps_ = |
| 638 bitrate_bps != 0 ? bitrate_bps : encoder_start_bitrate_bps_; | 770 bitrate_bps != 0 ? bitrate_bps : encoder_start_bitrate_bps_; |
| 639 bool video_is_suspended = bitrate_bps == 0; | 771 bool video_is_suspended = bitrate_bps == 0; |
| 640 bool video_suspension_changed = video_is_suspended != EncoderPaused(); | 772 bool video_suspension_changed = |
| 773 video_is_suspended != (last_observed_bitrate_bps_ == 0); |
| 641 last_observed_bitrate_bps_ = bitrate_bps; | 774 last_observed_bitrate_bps_ = bitrate_bps; |
| 642 | 775 |
| 643 if (stats_proxy_ && video_suspension_changed) { | 776 if (stats_proxy_ && video_suspension_changed) { |
| 644 LOG(LS_INFO) << "Video suspend state changed to: " | 777 LOG(LS_INFO) << "Video suspend state changed to: " |
| 645 << (video_is_suspended ? "suspended" : "not suspended"); | 778 << (video_is_suspended ? "suspended" : "not suspended"); |
| 646 stats_proxy_->OnSuspendChange(video_is_suspended); | 779 stats_proxy_->OnSuspendChange(video_is_suspended); |
| 647 } | 780 } |
| 648 } | 781 } |
| 649 | 782 |
| 650 void ViEEncoder::OveruseDetected() { | 783 void ViEEncoder::OveruseDetected() { |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 current_pixel_count > *max_pixel_count_step_up_) { | 818 current_pixel_count > *max_pixel_count_step_up_) { |
| 686 max_pixel_count_ = rtc::Optional<int>(); | 819 max_pixel_count_ = rtc::Optional<int>(); |
| 687 max_pixel_count_step_up_ = rtc::Optional<int>(current_pixel_count); | 820 max_pixel_count_step_up_ = rtc::Optional<int>(current_pixel_count); |
| 688 --cpu_restricted_counter_; | 821 --cpu_restricted_counter_; |
| 689 stats_proxy_->OnCpuRestrictedResolutionChanged(cpu_restricted_counter_ > 0); | 822 stats_proxy_->OnCpuRestrictedResolutionChanged(cpu_restricted_counter_ > 0); |
| 690 source_proxy_->RequestHigherResolutionThan(current_pixel_count); | 823 source_proxy_->RequestHigherResolutionThan(current_pixel_count); |
| 691 } | 824 } |
| 692 } | 825 } |
| 693 | 826 |
| 694 } // namespace webrtc | 827 } // namespace webrtc |
| OLD | NEW |