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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 stats_proxy), | 272 stats_proxy), |
273 stats_proxy_(stats_proxy), | 273 stats_proxy_(stats_proxy), |
274 pre_encode_callback_(pre_encode_callback), | 274 pre_encode_callback_(pre_encode_callback), |
275 module_process_thread_(nullptr), | 275 module_process_thread_(nullptr), |
276 pending_encoder_reconfiguration_(false), | 276 pending_encoder_reconfiguration_(false), |
277 encoder_start_bitrate_bps_(0), | 277 encoder_start_bitrate_bps_(0), |
278 max_data_payload_length_(0), | 278 max_data_payload_length_(0), |
279 nack_enabled_(false), | 279 nack_enabled_(false), |
280 last_observed_bitrate_bps_(0), | 280 last_observed_bitrate_bps_(0), |
281 encoder_paused_and_dropped_frame_(false), | 281 encoder_paused_and_dropped_frame_(false), |
282 has_received_sli_(false), | |
283 picture_id_sli_(0), | |
284 has_received_rpsi_(false), | |
285 picture_id_rpsi_(0), | |
286 clock_(Clock::GetRealTimeClock()), | 282 clock_(Clock::GetRealTimeClock()), |
287 scale_counter_(kScaleReasonSize, 0), | 283 scale_counter_(kScaleReasonSize, 0), |
288 degradation_preference_(DegradationPreference::kMaintainResolution), | 284 degradation_preference_(DegradationPreference::kMaintainResolution), |
289 last_captured_timestamp_(0), | 285 last_captured_timestamp_(0), |
290 delta_ntp_internal_ms_(clock_->CurrentNtpInMilliseconds() - | 286 delta_ntp_internal_ms_(clock_->CurrentNtpInMilliseconds() - |
291 clock_->TimeInMilliseconds()), | 287 clock_->TimeInMilliseconds()), |
292 last_frame_log_ms_(clock_->TimeInMilliseconds()), | 288 last_frame_log_ms_(clock_->TimeInMilliseconds()), |
293 captured_frame_count_(0), | 289 captured_frame_count_(0), |
294 dropped_frame_count_(0), | 290 dropped_frame_count_(0), |
295 bitrate_observer_(nullptr), | 291 bitrate_observer_(nullptr), |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 if (quality_scaler_) | 653 if (quality_scaler_) |
658 quality_scaler_->ReportDroppedFrame(); | 654 quality_scaler_->ReportDroppedFrame(); |
659 }); | 655 }); |
660 } | 656 } |
661 | 657 |
662 void ViEEncoder::SendStatistics(uint32_t bit_rate, uint32_t frame_rate) { | 658 void ViEEncoder::SendStatistics(uint32_t bit_rate, uint32_t frame_rate) { |
663 RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread()); | 659 RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread()); |
664 stats_proxy_->OnEncoderStatsUpdate(frame_rate, bit_rate); | 660 stats_proxy_->OnEncoderStatsUpdate(frame_rate, bit_rate); |
665 } | 661 } |
666 | 662 |
667 // TODO(nisse): Delete. | |
668 void ViEEncoder::OnReceivedSLI(uint8_t picture_id) { | |
669 if (!encoder_queue_.IsCurrent()) { | |
670 encoder_queue_.PostTask([this, picture_id] { OnReceivedSLI(picture_id); }); | |
671 return; | |
672 } | |
673 RTC_DCHECK_RUN_ON(&encoder_queue_); | |
674 picture_id_sli_ = picture_id; | |
675 has_received_sli_ = true; | |
676 } | |
677 | |
678 // TODO(nisse): Delete. | |
679 void ViEEncoder::OnReceivedRPSI(uint64_t picture_id) { | |
680 if (!encoder_queue_.IsCurrent()) { | |
681 encoder_queue_.PostTask([this, picture_id] { OnReceivedRPSI(picture_id); }); | |
682 return; | |
683 } | |
684 RTC_DCHECK_RUN_ON(&encoder_queue_); | |
685 picture_id_rpsi_ = picture_id; | |
686 has_received_rpsi_ = true; | |
687 } | |
688 | |
689 void ViEEncoder::OnReceivedIntraFrameRequest(size_t stream_index) { | 663 void ViEEncoder::OnReceivedIntraFrameRequest(size_t stream_index) { |
690 if (!encoder_queue_.IsCurrent()) { | 664 if (!encoder_queue_.IsCurrent()) { |
691 encoder_queue_.PostTask( | 665 encoder_queue_.PostTask( |
692 [this, stream_index] { OnReceivedIntraFrameRequest(stream_index); }); | 666 [this, stream_index] { OnReceivedIntraFrameRequest(stream_index); }); |
693 return; | 667 return; |
694 } | 668 } |
695 RTC_DCHECK_RUN_ON(&encoder_queue_); | 669 RTC_DCHECK_RUN_ON(&encoder_queue_); |
696 // Key frame request from remote side, signal to VCM. | 670 // Key frame request from remote side, signal to VCM. |
697 TRACE_EVENT0("webrtc", "OnKeyFrameRequest"); | 671 TRACE_EVENT0("webrtc", "OnKeyFrameRequest"); |
698 video_sender_.IntraFrameRequest(stream_index); | 672 video_sender_.IntraFrameRequest(stream_index); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 --scale_counter_[reason]; | 777 --scale_counter_[reason]; |
804 source_proxy_->RequestHigherResolutionThan(current_pixel_count); | 778 source_proxy_->RequestHigherResolutionThan(current_pixel_count); |
805 LOG(LS_INFO) << "Scaling up resolution."; | 779 LOG(LS_INFO) << "Scaling up resolution."; |
806 for (size_t i = 0; i < kScaleReasonSize; ++i) { | 780 for (size_t i = 0; i < kScaleReasonSize; ++i) { |
807 LOG(LS_INFO) << "Scaled " << scale_counter_[i] | 781 LOG(LS_INFO) << "Scaled " << scale_counter_[i] |
808 << " times for reason: " << (i ? "cpu" : "quality"); | 782 << " times for reason: " << (i ? "cpu" : "quality"); |
809 } | 783 } |
810 } | 784 } |
811 | 785 |
812 } // namespace webrtc | 786 } // namespace webrtc |
OLD | NEW |