Index: webrtc/modules/video_coding/video_sender.cc |
diff --git a/webrtc/modules/video_coding/video_sender.cc b/webrtc/modules/video_coding/video_sender.cc |
index c202d34e859819dabad29201dba1bef82b46d28d..4068fdb7f86e312fb488f5a324d36cd75fbcaaa5 100644 |
--- a/webrtc/modules/video_coding/video_sender.cc |
+++ b/webrtc/modules/video_coding/video_sender.cc |
@@ -37,9 +37,10 @@ VideoSender::VideoSender(Clock* clock, |
send_stats_callback_(send_stats_callback), |
_codecDataBase(&_encodedFrameCallback), |
frame_dropper_enabled_(true), |
- _sendStatsTimer(1000, clock_), |
+ _sendStatsTimer(VCMProcessTimer::kDefaultProcessIntervalMs, clock_), |
current_codec_(), |
encoder_params_({BitrateAllocation(), 0, 0, 0}), |
+ has_received_frame_(false), |
encoder_has_internal_source_(false), |
next_frame_types_(1, kVideoFrameDelta) { |
_mediaOpt.Reset(); |
@@ -126,6 +127,7 @@ int32_t VideoSender::RegisterSendCodec(const VideoCodec* sendCodec, |
next_frame_types_.clear(); |
next_frame_types_.resize(VCM_MAX(sendCodec->numberOfSimulcastStreams, 1), |
kVideoFrameKey); |
+ has_received_frame_ = false; |
// Cache InternalSource() to have this available from IntraFrameRequest() |
// without having to acquire encoder_crit_ (avoid blocking on encoder use). |
encoder_has_internal_source_ = _encoder->InternalSource(); |
@@ -199,6 +201,12 @@ EncoderParameters VideoSender::UpdateEncoderParameters( |
uint32_t video_target_rate_bps = _mediaOpt.SetTargetRates( |
target_bitrate_bps, params.loss_rate, params.rtt); |
uint32_t input_frame_rate = _mediaOpt.InputFrameRate(); |
+ if (input_frame_rate > 0) { |
+ has_received_frame_ = true; |
danilchap
2016/11/21 12:45:42
variable name make impression it should be set to
sprang_webrtc
2016/11/21 13:01:20
Ack, but removed instead.
|
+ } else if (input_frame_rate == 0 && !has_received_frame_) { |
danilchap
2016/11/21 12:45:42
This mean input_frame_rate ~= 0 mid call is a vali
sprang_webrtc
2016/11/21 13:01:20
My impression was that 0 could be a valid framerat
|
+ input_frame_rate = current_codec_.maxFramerate; |
+ } |
+ |
BitrateAllocation bitrate_allocation; |
if (bitrate_allocator) { |
bitrate_allocation = bitrate_allocator->GetAllocation(video_target_rate_bps, |
@@ -230,13 +238,13 @@ int32_t VideoSender::SetChannelParameters( |
EncoderParameters encoder_params; |
encoder_params.loss_rate = lossRate; |
encoder_params.rtt = rtt; |
- encoder_params = UpdateEncoderParameters(encoder_params, bitrate_allocator, |
- target_bitrate_bps); |
bool encoder_has_internal_source; |
{ |
rtc::CritScope cs(¶ms_crit_); |
- encoder_params_ = encoder_params; |
+ encoder_params_ = UpdateEncoderParameters(encoder_params, bitrate_allocator, |
+ target_bitrate_bps); |
+ encoder_params = encoder_params_; |
danilchap
2016/11/21 12:45:42
may be other way around make slightly more sense:
sprang_webrtc
2016/11/21 13:01:20
Ack, but reverted instead.
|
encoder_has_internal_source = encoder_has_internal_source_; |
} |