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

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

Issue 2451143002: Check that stats_proxy_ is non-NULL before use. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 445 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 if (stats_proxy_) { 456 if (stats_proxy_) {
457 stats_proxy_->OnEncoderReconfigured(encoder_config_, 457 stats_proxy_->OnEncoderReconfigured(encoder_config_,
458 rate_allocator_->GetPreferedBitrate()); 458 rate_allocator_->GetPreferedBitrate());
459 } 459 }
460 sink_->OnEncoderConfigurationChanged( 460 sink_->OnEncoderConfigurationChanged(
461 std::move(streams), encoder_config_.min_transmit_bitrate_bps); 461 std::move(streams), encoder_config_.min_transmit_bitrate_bps);
462 } 462 }
463 463
464 void ViEEncoder::OnFrame(const VideoFrame& video_frame) { 464 void ViEEncoder::OnFrame(const VideoFrame& video_frame) {
465 RTC_DCHECK_RUNS_SERIALIZED(&incoming_frame_race_checker_); 465 RTC_DCHECK_RUNS_SERIALIZED(&incoming_frame_race_checker_);
466 stats_proxy_->OnIncomingFrame(video_frame.width(), video_frame.height()); 466 if (stats_proxy_) {
467 467 stats_proxy_->OnIncomingFrame(video_frame.width(), video_frame.height());
468 }
468 VideoFrame incoming_frame = video_frame; 469 VideoFrame incoming_frame = video_frame;
469 470
470 // Local time in webrtc time base. 471 // Local time in webrtc time base.
471 int64_t current_time = clock_->TimeInMilliseconds(); 472 int64_t current_time = clock_->TimeInMilliseconds();
472 incoming_frame.set_render_time_ms(current_time); 473 incoming_frame.set_render_time_ms(current_time);
473 474
474 // Capture time may come from clock with an offset and drift from clock_. 475 // Capture time may come from clock with an offset and drift from clock_.
475 int64_t capture_ntp_time_ms; 476 int64_t capture_ntp_time_ms;
476 if (video_frame.ntp_time_ms() != 0) { 477 if (video_frame.ntp_time_ms() != 0) {
477 capture_ntp_time_ms = video_frame.ntp_time_ms(); 478 capture_ntp_time_ms = video_frame.ntp_time_ms();
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
704 load_observer_->OnLoadUpdate(LoadObserver::kOveruse); 705 load_observer_->OnLoadUpdate(LoadObserver::kOveruse);
705 } 706 }
706 707
707 void ViEEncoder::NormalUsage() { 708 void ViEEncoder::NormalUsage() {
708 RTC_DCHECK_RUN_ON(&encoder_queue_); 709 RTC_DCHECK_RUN_ON(&encoder_queue_);
709 if (load_observer_) 710 if (load_observer_)
710 load_observer_->OnLoadUpdate(LoadObserver::kUnderuse); 711 load_observer_->OnLoadUpdate(LoadObserver::kUnderuse);
711 } 712 }
712 713
713 } // namespace webrtc 714 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698