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(); |
441 RTC_DCHECK(success); | 442 RTC_DCHECK(success); |
| 443 } else { |
| 444 video_sender_.UpdateChannelParemeters(rate_allocator_.get(), |
| 445 bitrate_observer_); |
442 } | 446 } |
443 | 447 |
444 video_sender_.UpdateChannelParemeters(rate_allocator_.get(), | |
445 bitrate_observer_); | |
446 | |
447 int framerate = stats_proxy_->GetSendFrameRate(); | 448 int framerate = stats_proxy_->GetSendFrameRate(); |
448 if (framerate == 0) | 449 if (framerate == 0) |
449 framerate = codec.maxFramerate; | 450 framerate = codec.maxFramerate; |
450 stats_proxy_->OnEncoderReconfigured( | 451 stats_proxy_->OnEncoderReconfigured( |
451 encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate)); | 452 encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate)); |
452 | 453 |
453 pending_encoder_reconfiguration_ = false; | 454 pending_encoder_reconfiguration_ = false; |
454 | 455 |
455 sink_->OnEncoderConfigurationChanged( | 456 sink_->OnEncoderConfigurationChanged( |
456 std::move(streams), encoder_config_.min_transmit_bitrate_bps); | 457 std::move(streams), encoder_config_.min_transmit_bitrate_bps); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
809 --scale_counter_[reason]; | 810 --scale_counter_[reason]; |
810 source_proxy_->RequestHigherResolutionThan(current_pixel_count); | 811 source_proxy_->RequestHigherResolutionThan(current_pixel_count); |
811 LOG(LS_INFO) << "Scaling up resolution."; | 812 LOG(LS_INFO) << "Scaling up resolution."; |
812 for (size_t i = 0; i < kScaleReasonSize; ++i) { | 813 for (size_t i = 0; i < kScaleReasonSize; ++i) { |
813 LOG(LS_INFO) << "Scaled " << scale_counter_[i] | 814 LOG(LS_INFO) << "Scaled " << scale_counter_[i] |
814 << " times for reason: " << (i ? "cpu" : "quality"); | 815 << " times for reason: " << (i ? "cpu" : "quality"); |
815 } | 816 } |
816 } | 817 } |
817 | 818 |
818 } // namespace webrtc | 819 } // namespace webrtc |
OLD | NEW |