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

Unified Diff: webrtc/video/vie_encoder.cc

Issue 2695643002: Make SendStatisticsProxy paramter mandatory in ViEEncoder ctor. (Closed)
Patch Set: oopsie Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/video/encoder_rtcp_feedback_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/vie_encoder.cc
diff --git a/webrtc/video/vie_encoder.cc b/webrtc/video/vie_encoder.cc
index 73e4207109961a66b1db59d567338d2d3bb8390e..038c7b06e9a31d70516503025979cf054f52b53e 100644
--- a/webrtc/video/vie_encoder.cc
+++ b/webrtc/video/vie_encoder.cc
@@ -293,6 +293,7 @@ ViEEncoder::ViEEncoder(uint32_t number_of_cores,
dropped_frame_count_(0),
bitrate_observer_(nullptr),
encoder_queue_("EncoderQueue") {
+ RTC_DCHECK(stats_proxy);
encoder_queue_.PostTask([this] {
RTC_DCHECK_RUN_ON(&encoder_queue_);
overuse_detector_.StartCheckForOveruse();
@@ -442,13 +443,11 @@ void ViEEncoder::ReconfigureEncoder() {
video_sender_.UpdateChannelParemeters(rate_allocator_.get(),
bitrate_observer_);
- if (stats_proxy_) {
- int framerate = stats_proxy_->GetSendFrameRate();
- if (framerate == 0)
- framerate = codec.maxFramerate;
- stats_proxy_->OnEncoderReconfigured(
- encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate));
- }
+ int framerate = stats_proxy_->GetSendFrameRate();
+ if (framerate == 0)
+ framerate = codec.maxFramerate;
+ stats_proxy_->OnEncoderReconfigured(
+ encoder_config_, rate_allocator_->GetPreferredBitrateBps(framerate));
pending_encoder_reconfiguration_ = false;
@@ -640,8 +639,7 @@ EncodedImageCallback::Result ViEEncoder::OnEncodedImage(
// Encoded is called on whatever thread the real encoder implementation run
// on. In the case of hardware encoders, there might be several encoders
// running in parallel on different threads.
- if (stats_proxy_)
- stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info);
+ stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info);
EncodedImageCallback::Result result =
sink_->OnEncodedImage(encoded_image, codec_specific_info, fragmentation);
@@ -669,8 +667,7 @@ void ViEEncoder::OnDroppedFrame() {
void ViEEncoder::SendStatistics(uint32_t bit_rate, uint32_t frame_rate) {
RTC_DCHECK(module_process_thread_checker_.CalledOnValidThread());
- if (stats_proxy_)
- stats_proxy_->OnEncoderStatsUpdate(frame_rate, bit_rate);
+ stats_proxy_->OnEncoderStatsUpdate(frame_rate, bit_rate);
}
void ViEEncoder::OnReceivedSLI(uint8_t picture_id) {
@@ -732,7 +729,7 @@ void ViEEncoder::OnBitrateUpdated(uint32_t bitrate_bps,
bool video_suspension_changed = video_is_suspended != EncoderPaused();
last_observed_bitrate_bps_ = bitrate_bps;
- if (stats_proxy_ && video_suspension_changed) {
+ if (video_suspension_changed) {
LOG(LS_INFO) << "Video suspend state changed to: "
<< (video_is_suspended ? "suspended" : "not suspended");
stats_proxy_->OnSuspendChange(video_is_suspended);
« no previous file with comments | « webrtc/video/encoder_rtcp_feedback_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698