Remove dead code in IncomingVideoStream that's just causing contention.

BUG=

Review-Url: https://codereview.webrtc.org/2040763002
Cr-Commit-Position: refs/heads/master@{#13053}
This commit is contained in:
tommi 2016-06-06 12:21:12 -07:00 committed by Commit bot
parent f5f03e823c
commit ba986bfbaf
2 changed files with 1 additions and 36 deletions

View File

@ -38,12 +38,6 @@ class IncomingVideoStream : public rtc::VideoSinkInterface<VideoFrame> {
int32_t Start();
int32_t Stop();
// Clear all buffers.
int32_t Reset();
// Properties.
uint32_t IncomingRate() const;
int32_t SetExpectedRenderDelay(int32_t delay_ms);
protected:
@ -73,10 +67,6 @@ class IncomingVideoStream : public rtc::VideoSinkInterface<VideoFrame> {
GUARDED_BY(thread_critsect_);
const std::unique_ptr<VideoRenderFrames> render_buffers_
GUARDED_BY(buffer_critsect_);
uint32_t incoming_rate_ GUARDED_BY(stream_critsect_);
int64_t last_rate_calculation_time_ms_ GUARDED_BY(stream_critsect_);
uint16_t num_frames_since_last_calculation_ GUARDED_BY(stream_critsect_);
};
} // namespace webrtc

View File

@ -26,10 +26,7 @@ IncomingVideoStream::IncomingVideoStream(bool disable_prerenderer_smoothing)
deliver_buffer_event_(EventTimerWrapper::Create()),
running_(false),
external_callback_(nullptr),
render_buffers_(new VideoRenderFrames()),
incoming_rate_(0),
last_rate_calculation_time_ms_(0),
num_frames_since_last_calculation_(0) {}
render_buffers_(new VideoRenderFrames()) {}
IncomingVideoStream::~IncomingVideoStream() {
Stop();
@ -42,17 +39,6 @@ void IncomingVideoStream::OnFrame(const VideoFrame& video_frame) {
return;
}
// Rate statistics.
num_frames_since_last_calculation_++;
int64_t now_ms = rtc::TimeMillis();
if (now_ms >= last_rate_calculation_time_ms_ + kFrameRatePeriodMs) {
incoming_rate_ =
static_cast<uint32_t>(1000 * num_frames_since_last_calculation_ /
(now_ms - last_rate_calculation_time_ms_));
num_frames_since_last_calculation_ = 0;
last_rate_calculation_time_ms_ = now_ms;
}
// Hand over or insert frame.
if (disable_prerenderer_smoothing_) {
DeliverFrame(video_frame);
@ -133,17 +119,6 @@ int32_t IncomingVideoStream::Stop() {
return 0;
}
int32_t IncomingVideoStream::Reset() {
rtc::CritScope cs_buffer(&buffer_critsect_);
render_buffers_->ReleaseAllFrames();
return 0;
}
uint32_t IncomingVideoStream::IncomingRate() const {
rtc::CritScope cs(&stream_critsect_);
return incoming_rate_;
}
bool IncomingVideoStream::IncomingVideoStreamThreadFun(void* obj) {
return static_cast<IncomingVideoStream*>(obj)->IncomingVideoStreamProcess();
}