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

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

Issue 2122743003: Fix stats for encoder target bitrate when target rate is zero. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Removed bad logging. Created 4 years, 5 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 unified diff | Download patch
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | 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 17 matching lines...) Expand all
28 namespace webrtc { 28 namespace webrtc {
29 29
30 ViEEncoder::ViEEncoder(uint32_t number_of_cores, 30 ViEEncoder::ViEEncoder(uint32_t number_of_cores,
31 ProcessThread* module_process_thread, 31 ProcessThread* module_process_thread,
32 SendStatisticsProxy* stats_proxy, 32 SendStatisticsProxy* stats_proxy,
33 OveruseFrameDetector* overuse_detector, 33 OveruseFrameDetector* overuse_detector,
34 EncodedImageCallback* sink) 34 EncodedImageCallback* sink)
35 : number_of_cores_(number_of_cores), 35 : number_of_cores_(number_of_cores),
36 sink_(sink), 36 sink_(sink),
37 vp_(VideoProcessing::Create()), 37 vp_(VideoProcessing::Create()),
38 video_sender_(Clock::GetRealTimeClock(), this, this, this), 38 video_sender_(Clock::GetRealTimeClock(), this, this),
39 stats_proxy_(stats_proxy), 39 stats_proxy_(stats_proxy),
40 overuse_detector_(overuse_detector), 40 overuse_detector_(overuse_detector),
41 time_of_last_frame_activity_ms_(std::numeric_limits<int64_t>::max()), 41 time_of_last_frame_activity_ms_(std::numeric_limits<int64_t>::max()),
42 encoder_config_(), 42 encoder_config_(),
43 last_observed_bitrate_bps_(0), 43 last_observed_bitrate_bps_(0),
44 encoder_paused_and_dropped_frame_(false), 44 encoder_paused_and_dropped_frame_(false),
45 module_process_thread_(module_process_thread), 45 module_process_thread_(module_process_thread),
46 has_received_sli_(false), 46 has_received_sli_(false),
47 picture_id_sli_(0), 47 picture_id_sli_(0),
48 has_received_rpsi_(false), 48 has_received_rpsi_(false),
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 186
187 void ViEEncoder::SendKeyFrame() { 187 void ViEEncoder::SendKeyFrame() {
188 video_sender_.IntraFrameRequest(0); 188 video_sender_.IntraFrameRequest(0);
189 } 189 }
190 190
191 int64_t ViEEncoder::time_of_last_frame_activity_ms() { 191 int64_t ViEEncoder::time_of_last_frame_activity_ms() {
192 rtc::CritScope lock(&data_cs_); 192 rtc::CritScope lock(&data_cs_);
193 return time_of_last_frame_activity_ms_; 193 return time_of_last_frame_activity_ms_;
194 } 194 }
195 195
196 void ViEEncoder::OnSetRates(uint32_t bitrate_bps, int framerate) {
197 if (stats_proxy_)
198 stats_proxy_->OnSetRates(bitrate_bps, framerate);
199 }
200
201 int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image, 196 int32_t ViEEncoder::Encoded(const EncodedImage& encoded_image,
202 const CodecSpecificInfo* codec_specific_info, 197 const CodecSpecificInfo* codec_specific_info,
203 const RTPFragmentationHeader* fragmentation) { 198 const RTPFragmentationHeader* fragmentation) {
204 { 199 {
205 rtc::CritScope lock(&data_cs_); 200 rtc::CritScope lock(&data_cs_);
206 time_of_last_frame_activity_ms_ = rtc::TimeMillis(); 201 time_of_last_frame_activity_ms_ = rtc::TimeMillis();
207 } 202 }
208 if (stats_proxy_) { 203 if (stats_proxy_) {
209 stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info); 204 stats_proxy_->OnSendEncodedImage(encoded_image, codec_specific_info);
210 } 205 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 264 }
270 265
271 if (stats_proxy_ && video_suspension_changed) { 266 if (stats_proxy_ && video_suspension_changed) {
272 LOG(LS_INFO) << "Video suspend state changed to: " 267 LOG(LS_INFO) << "Video suspend state changed to: "
273 << (video_is_suspended ? "suspended" : "not suspended"); 268 << (video_is_suspended ? "suspended" : "not suspended");
274 stats_proxy_->OnSuspendChange(video_is_suspended); 269 stats_proxy_->OnSuspendChange(video_is_suspended);
275 } 270 }
276 } 271 }
277 272
278 } // namespace webrtc 273 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/vie_encoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698