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 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
431 codec.startBitrate = | 431 codec.startBitrate = |
432 std::max(encoder_start_bitrate_bps_ / 1000, codec.minBitrate); | 432 std::max(encoder_start_bitrate_bps_ / 1000, codec.minBitrate); |
433 codec.startBitrate = std::min(codec.startBitrate, codec.maxBitrate); | 433 codec.startBitrate = std::min(codec.startBitrate, codec.maxBitrate); |
434 codec.expect_encode_from_texture = last_frame_info_->is_texture; | 434 codec.expect_encode_from_texture = last_frame_info_->is_texture; |
435 | 435 |
436 bool success = video_sender_.RegisterSendCodec( | 436 bool success = video_sender_.RegisterSendCodec( |
437 &codec, number_of_cores_, | 437 &codec, number_of_cores_, |
438 static_cast<uint32_t>(max_data_payload_length_)) == VCM_OK; | 438 static_cast<uint32_t>(max_data_payload_length_)) == VCM_OK; |
439 if (!success) { | 439 if (!success) { |
440 LOG(LS_ERROR) << "Failed to configure encoder."; | 440 LOG(LS_ERROR) << "Failed to configure encoder."; |
441 rate_allocator_.reset(); | |
442 RTC_DCHECK(success); | 441 RTC_DCHECK(success); |
443 } else { | 442 } |
444 video_sender_.UpdateChannelParemeters(rate_allocator_.get(), | 443 |
444 video_sender_.UpdateChannelParemeters(rate_allocator_.get(), | |
445 bitrate_observer_); | 445 bitrate_observer_); |
åsapersson
2017/03/15 11:03:01
nit: check spacing
ilnik
2017/03/15 11:04:51
Done.
| |
446 } | |
447 | 446 |
448 int framerate = stats_proxy_->GetSendFrameRate(); | 447 int framerate = stats_proxy_->GetSendFrameRate(); |
449 if (framerate == 0) | 448 if (framerate == 0) |
450 framerate = codec.maxFramerate; | 449 framerate = codec.maxFramerate; |
451 stats_proxy_->OnEncoderReconfigured( | 450 stats_proxy_->OnEncoderReconfigured( |
452 encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate)); | 451 encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate)); |
453 | 452 |
454 pending_encoder_reconfiguration_ = false; | 453 pending_encoder_reconfiguration_ = false; |
455 | 454 |
456 sink_->OnEncoderConfigurationChanged( | 455 sink_->OnEncoderConfigurationChanged( |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
810 --scale_counter_[reason]; | 809 --scale_counter_[reason]; |
811 source_proxy_->RequestHigherResolutionThan(current_pixel_count); | 810 source_proxy_->RequestHigherResolutionThan(current_pixel_count); |
812 LOG(LS_INFO) << "Scaling up resolution."; | 811 LOG(LS_INFO) << "Scaling up resolution."; |
813 for (size_t i = 0; i < kScaleReasonSize; ++i) { | 812 for (size_t i = 0; i < kScaleReasonSize; ++i) { |
814 LOG(LS_INFO) << "Scaled " << scale_counter_[i] | 813 LOG(LS_INFO) << "Scaled " << scale_counter_[i] |
815 << " times for reason: " << (i ? "cpu" : "quality"); | 814 << " times for reason: " << (i ? "cpu" : "quality"); |
816 } | 815 } |
817 } | 816 } |
818 | 817 |
819 } // namespace webrtc | 818 } // namespace webrtc |
OLD | NEW |