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

Side by Side Diff: webrtc/modules/video_coding/video_sender.cc

Issue 2398963003: Move usage of QualityScaler to ViEEncoder. (Closed)
Patch Set: Report dropped frames to ViEEncoder Created 4 years 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 16 matching lines...) Expand all
27 namespace webrtc { 27 namespace webrtc {
28 namespace vcm { 28 namespace vcm {
29 29
30 VideoSender::VideoSender(Clock* clock, 30 VideoSender::VideoSender(Clock* clock,
31 EncodedImageCallback* post_encode_callback, 31 EncodedImageCallback* post_encode_callback,
32 VCMSendStatisticsCallback* send_stats_callback) 32 VCMSendStatisticsCallback* send_stats_callback)
33 : clock_(clock), 33 : clock_(clock),
34 _encoder(nullptr), 34 _encoder(nullptr),
35 _mediaOpt(clock_), 35 _mediaOpt(clock_),
36 _encodedFrameCallback(post_encode_callback, &_mediaOpt), 36 _encodedFrameCallback(post_encode_callback, &_mediaOpt),
37 post_encode_callback_(post_encode_callback),
37 send_stats_callback_(send_stats_callback), 38 send_stats_callback_(send_stats_callback),
38 _codecDataBase(&_encodedFrameCallback), 39 _codecDataBase(&_encodedFrameCallback),
39 frame_dropper_enabled_(true), 40 frame_dropper_enabled_(true),
40 _sendStatsTimer(1000, clock_), 41 _sendStatsTimer(1000, clock_),
41 current_codec_(), 42 current_codec_(),
42 encoder_params_({BitrateAllocation(), 0, 0, 0}), 43 encoder_params_({BitrateAllocation(), 0, 0, 0}),
43 encoder_has_internal_source_(false), 44 encoder_has_internal_source_(false),
44 next_frame_types_(1, kVideoFrameDelta) { 45 next_frame_types_(1, kVideoFrameDelta) {
45 _mediaOpt.Reset(); 46 _mediaOpt.Reset();
46 // Allow VideoSender to be created on one thread but used on another, post 47 // Allow VideoSender to be created on one thread but used on another, post
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 if (_encoder == nullptr) 301 if (_encoder == nullptr)
301 return VCM_UNINITIALIZED; 302 return VCM_UNINITIALIZED;
302 SetEncoderParameters(encoder_params, encoder_has_internal_source); 303 SetEncoderParameters(encoder_params, encoder_has_internal_source);
303 if (_mediaOpt.DropFrame()) { 304 if (_mediaOpt.DropFrame()) {
304 LOG(LS_VERBOSE) << "Drop Frame " 305 LOG(LS_VERBOSE) << "Drop Frame "
305 << "target bitrate " 306 << "target bitrate "
306 << encoder_params.target_bitrate.get_sum_bps() 307 << encoder_params.target_bitrate.get_sum_bps()
307 << " loss rate " << encoder_params.loss_rate << " rtt " 308 << " loss rate " << encoder_params.loss_rate << " rtt "
308 << encoder_params.rtt << " input frame rate " 309 << encoder_params.rtt << " input frame rate "
309 << encoder_params.input_frame_rate; 310 << encoder_params.input_frame_rate;
310 _encoder->OnDroppedFrame(); 311 post_encode_callback_->OnDroppedFrame();
311 return VCM_OK; 312 return VCM_OK;
312 } 313 }
313 // TODO(pbos): Make sure setting send codec is synchronized with video 314 // TODO(pbos): Make sure setting send codec is synchronized with video
314 // processing so frame size always matches. 315 // processing so frame size always matches.
315 if (!_codecDataBase.MatchesCurrentResolution(videoFrame.width(), 316 if (!_codecDataBase.MatchesCurrentResolution(videoFrame.width(),
316 videoFrame.height())) { 317 videoFrame.height())) {
317 LOG(LS_ERROR) << "Incoming frame doesn't match set resolution. Dropping."; 318 LOG(LS_ERROR) << "Incoming frame doesn't match set resolution. Dropping.";
318 return VCM_PARAMETER_ERROR; 319 return VCM_PARAMETER_ERROR;
319 } 320 }
320 VideoFrame converted_frame = videoFrame; 321 VideoFrame converted_frame = videoFrame;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 } 386 }
386 387
387 int32_t VideoSender::EnableFrameDropper(bool enable) { 388 int32_t VideoSender::EnableFrameDropper(bool enable) {
388 rtc::CritScope lock(&encoder_crit_); 389 rtc::CritScope lock(&encoder_crit_);
389 frame_dropper_enabled_ = enable; 390 frame_dropper_enabled_ = enable;
390 _mediaOpt.EnableFrameDropper(enable); 391 _mediaOpt.EnableFrameDropper(enable);
391 return VCM_OK; 392 return VCM_OK;
392 } 393 }
393 } // namespace vcm 394 } // namespace vcm
394 } // namespace webrtc 395 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698