Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: webrtc/video/vie_encoder.cc

Issue 2795043004: Use simulcast for screenshare only in conference mode (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 codec.startBitrate = 430 codec.startBitrate =
431 std::max(encoder_start_bitrate_bps_ / 1000, codec.minBitrate); 431 std::max(encoder_start_bitrate_bps_ / 1000, codec.minBitrate);
432 codec.startBitrate = std::min(codec.startBitrate, codec.maxBitrate); 432 codec.startBitrate = std::min(codec.startBitrate, codec.maxBitrate);
433 codec.expect_encode_from_texture = last_frame_info_->is_texture; 433 codec.expect_encode_from_texture = last_frame_info_->is_texture;
434 434
435 bool success = video_sender_.RegisterSendCodec( 435 bool success = video_sender_.RegisterSendCodec(
436 &codec, number_of_cores_, 436 &codec, number_of_cores_,
437 static_cast<uint32_t>(max_data_payload_length_)) == VCM_OK; 437 static_cast<uint32_t>(max_data_payload_length_)) == VCM_OK;
438 if (!success) { 438 if (!success) {
439 LOG(LS_ERROR) << "Failed to configure encoder."; 439 LOG(LS_ERROR) << "Failed to configure encoder.";
440 RTC_DCHECK(success); 440 rate_allocator_.reset();
441 } 441 }
442 442
443 video_sender_.UpdateChannelParemeters(rate_allocator_.get(), 443 video_sender_.UpdateChannelParemeters(rate_allocator_.get(),
444 bitrate_observer_); 444 bitrate_observer_);
445 445
446 int framerate = stats_proxy_->GetSendFrameRate(); 446 int framerate = stats_proxy_->GetSendFrameRate();
447 if (framerate == 0) 447 if (framerate == 0)
448 framerate = codec.maxFramerate; 448 framerate = codec.maxFramerate;
449 stats_proxy_->OnEncoderReconfigured( 449 stats_proxy_->OnEncoderReconfigured(
450 encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate)); 450 encoder_config_, rate_allocator_.get()
451 ? rate_allocator_->GetPreferredBitrateBps(framerate)
452 : codec.maxBitrate);
451 453
452 pending_encoder_reconfiguration_ = false; 454 pending_encoder_reconfiguration_ = false;
453 455
454 sink_->OnEncoderConfigurationChanged( 456 sink_->OnEncoderConfigurationChanged(
455 std::move(streams), encoder_config_.min_transmit_bitrate_bps); 457 std::move(streams), encoder_config_.min_transmit_bitrate_bps);
456 458
457 ConfigureQualityScaler(); 459 ConfigureQualityScaler();
458 } 460 }
459 461
460 void ViEEncoder::ConfigureQualityScaler() { 462 void ViEEncoder::ConfigureQualityScaler() {
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 --scale_counter_[reason]; 810 --scale_counter_[reason];
809 source_proxy_->RequestHigherResolutionThan(current_pixel_count); 811 source_proxy_->RequestHigherResolutionThan(current_pixel_count);
810 LOG(LS_INFO) << "Scaling up resolution."; 812 LOG(LS_INFO) << "Scaling up resolution.";
811 for (size_t i = 0; i < kScaleReasonSize; ++i) { 813 for (size_t i = 0; i < kScaleReasonSize; ++i) {
812 LOG(LS_INFO) << "Scaled " << scale_counter_[i] 814 LOG(LS_INFO) << "Scaled " << scale_counter_[i]
813 << " times for reason: " << (i ? "cpu" : "quality"); 815 << " times for reason: " << (i ? "cpu" : "quality");
814 } 816 }
815 } 817 }
816 818
817 } // namespace webrtc 819 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2_unittest.cc ('k') | webrtc/video/vie_encoder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698