Index: webrtc/video/video_receive_stream.cc |
diff --git a/webrtc/video/video_receive_stream.cc b/webrtc/video/video_receive_stream.cc |
index 183f72b537fcf9e6f75afb6bfebe44eaf648275a..7835e779b0dca5aa11fe5c79f20a3976bd47b9c5 100644 |
--- a/webrtc/video/video_receive_stream.cc |
+++ b/webrtc/video/video_receive_stream.cc |
@@ -223,10 +223,7 @@ VideoReceiveStream::VideoReceiveStream( |
this, // KeyFrameRequestSender |
this, // OnCompleteFrameCallback |
timing_.get()), |
- rtp_stream_sync_(&video_receiver_, &rtp_stream_receiver_), |
- jitter_buffer_experiment_( |
- field_trial::FindFullName("WebRTC-NewVideoJitterBuffer") == |
- "Enabled") { |
+ rtp_stream_sync_(&video_receiver_, &rtp_stream_receiver_) { |
LOG(LS_INFO) << "VideoReceiveStream: " << config_.ToString(); |
RTC_DCHECK(process_thread_); |
@@ -246,11 +243,9 @@ VideoReceiveStream::VideoReceiveStream( |
video_receiver_.SetRenderDelay(config.render_delay_ms); |
- if (jitter_buffer_experiment_) { |
- jitter_estimator_.reset(new VCMJitterEstimator(clock_)); |
- frame_buffer_.reset(new video_coding::FrameBuffer( |
- clock_, jitter_estimator_.get(), timing_.get())); |
- } |
+ jitter_estimator_.reset(new VCMJitterEstimator(clock_)); |
+ frame_buffer_.reset(new video_coding::FrameBuffer( |
+ clock_, jitter_estimator_.get(), timing_.get(), &stats_proxy_)); |
process_thread_->RegisterModule(&video_receiver_); |
process_thread_->RegisterModule(&rtp_stream_sync_); |
@@ -290,15 +285,15 @@ bool VideoReceiveStream::OnRecoveredPacket(const uint8_t* packet, |
void VideoReceiveStream::Start() { |
if (decode_thread_.IsRunning()) |
return; |
- if (jitter_buffer_experiment_) { |
- frame_buffer_->Start(); |
- call_stats_->RegisterStatsObserver(&rtp_stream_receiver_); |
- if (rtp_stream_receiver_.IsRetransmissionsEnabled() && |
- rtp_stream_receiver_.IsUlpfecEnabled()) { |
- frame_buffer_->SetProtectionMode(kProtectionNackFEC); |
- } |
+ frame_buffer_->Start(); |
+ call_stats_->RegisterStatsObserver(&rtp_stream_receiver_); |
+ |
+ if (rtp_stream_receiver_.IsRetransmissionsEnabled() && |
+ rtp_stream_receiver_.IsUlpfecEnabled()) { |
+ frame_buffer_->SetProtectionMode(kProtectionNackFEC); |
} |
+ |
transport_adapter_.Enable(); |
rtc::VideoSinkInterface<VideoFrame>* renderer = nullptr; |
if (config_.renderer) { |
@@ -343,10 +338,8 @@ void VideoReceiveStream::Stop() { |
// before joining the decoder thread thread. |
video_receiver_.TriggerDecoderShutdown(); |
- if (jitter_buffer_experiment_) { |
- frame_buffer_->Stop(); |
- call_stats_->DeregisterStatsObserver(&rtp_stream_receiver_); |
- } |
+ frame_buffer_->Stop(); |
+ call_stats_->DeregisterStatsObserver(&rtp_stream_receiver_); |
if (decode_thread_.IsRunning()) { |
decode_thread_.Stop(); |
@@ -442,26 +435,21 @@ bool VideoReceiveStream::DecodeThreadFunction(void* ptr) { |
} |
void VideoReceiveStream::Decode() { |
- static const int kMaxDecodeWaitTimeMs = 50; |
- if (jitter_buffer_experiment_) { |
- static const int kMaxWaitForFrameMs = 3000; |
- std::unique_ptr<video_coding::FrameObject> frame; |
- video_coding::FrameBuffer::ReturnReason res = |
- frame_buffer_->NextFrame(kMaxWaitForFrameMs, &frame); |
- |
- if (res == video_coding::FrameBuffer::ReturnReason::kStopped) |
- return; |
- |
- if (frame) { |
- if (video_receiver_.Decode(frame.get()) == VCM_OK) |
- rtp_stream_receiver_.FrameDecoded(frame->picture_id); |
- } else { |
- LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
- << " ms, requesting keyframe."; |
- RequestKeyFrame(); |
- } |
+ static const int kMaxWaitForFrameMs = 3000; |
+ std::unique_ptr<video_coding::FrameObject> frame; |
+ video_coding::FrameBuffer::ReturnReason res = |
+ frame_buffer_->NextFrame(kMaxWaitForFrameMs, &frame); |
+ |
+ if (res == video_coding::FrameBuffer::ReturnReason::kStopped) |
+ return; |
+ |
+ if (frame) { |
+ if (video_receiver_.Decode(frame.get()) == VCM_OK) |
+ rtp_stream_receiver_.FrameDecoded(frame->picture_id); |
} else { |
- video_receiver_.Decode(kMaxDecodeWaitTimeMs); |
+ LOG(LS_WARNING) << "No decodable frame in " << kMaxWaitForFrameMs |
+ << " ms, requesting keyframe."; |
+ RequestKeyFrame(); |
} |
} |