blob: fcd523820f0ef7825b7edaacb63b7e33460e8d2c [file] [log] [blame]
philipelbe7a9e52016-05-19 12:19:35 +02001/*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#include "webrtc/modules/video_coding/frame_buffer2.h"
12
13#include <algorithm>
philipele0b2f152016-09-28 10:23:49 +020014#include <cstring>
15#include <queue>
philipelbe7a9e52016-05-19 12:19:35 +020016
17#include "webrtc/base/checks.h"
philipele0b2f152016-09-28 10:23:49 +020018#include "webrtc/base/logging.h"
tommidb23ea62017-03-03 07:21:18 -080019#include "webrtc/base/trace_event.h"
philipela45102f2017-02-22 05:30:39 -080020#include "webrtc/modules/video_coding/include/video_coding_defines.h"
philipelbe7a9e52016-05-19 12:19:35 +020021#include "webrtc/modules/video_coding/jitter_estimator.h"
philipelbe7a9e52016-05-19 12:19:35 +020022#include "webrtc/modules/video_coding/timing.h"
23#include "webrtc/system_wrappers/include/clock.h"
philipel266f0a42016-11-28 08:49:07 -080024#include "webrtc/system_wrappers/include/metrics.h"
philipelbe7a9e52016-05-19 12:19:35 +020025
26namespace webrtc {
27namespace video_coding {
28
29namespace {
philipele0b2f152016-09-28 10:23:49 +020030// Max number of frames the buffer will hold.
31constexpr int kMaxFramesBuffered = 600;
philipelbe7a9e52016-05-19 12:19:35 +020032
philipele0b2f152016-09-28 10:23:49 +020033// Max number of decoded frame info that will be saved.
philipelfd5a20f2016-11-15 00:57:57 -080034constexpr int kMaxFramesHistory = 50;
philipelbe7a9e52016-05-19 12:19:35 +020035} // namespace
36
philipelbe7a9e52016-05-19 12:19:35 +020037FrameBuffer::FrameBuffer(Clock* clock,
38 VCMJitterEstimator* jitter_estimator,
philipela45102f2017-02-22 05:30:39 -080039 VCMTiming* timing,
40 VCMReceiveStatisticsCallback* stats_callback)
philipelbe7a9e52016-05-19 12:19:35 +020041 : clock_(clock),
tommi0a735642017-03-14 06:23:57 -070042 new_continuous_frame_event_(false, false),
philipelbe7a9e52016-05-19 12:19:35 +020043 jitter_estimator_(jitter_estimator),
44 timing_(timing),
philipel4f6cd6a2016-08-03 10:59:32 +020045 inter_frame_delay_(clock_->TimeInMilliseconds()),
philipele0b2f152016-09-28 10:23:49 +020046 last_decoded_frame_it_(frames_.end()),
47 last_continuous_frame_it_(frames_.end()),
48 num_frames_history_(0),
49 num_frames_buffered_(0),
philipel29f730e2017-03-15 08:10:08 -070050 stopped_(false),
philipela45102f2017-02-22 05:30:39 -080051 protection_mode_(kProtectionNack),
52 stats_callback_(stats_callback) {}
philipel266f0a42016-11-28 08:49:07 -080053
philipela45102f2017-02-22 05:30:39 -080054FrameBuffer::~FrameBuffer() {}
philipelbe7a9e52016-05-19 12:19:35 +020055
philipel75562822016-09-05 10:57:41 +020056FrameBuffer::ReturnReason FrameBuffer::NextFrame(
57 int64_t max_wait_time_ms,
58 std::unique_ptr<FrameObject>* frame_out) {
tommidb23ea62017-03-03 07:21:18 -080059 TRACE_EVENT0("webrtc", "FrameBuffer::NextFrame");
philipel1c056252017-01-31 09:53:12 -080060 int64_t latest_return_time_ms =
61 clock_->TimeInMilliseconds() + max_wait_time_ms;
philipel504c47d2016-06-30 17:33:02 +020062 int64_t wait_ms = max_wait_time_ms;
philipel29f730e2017-03-15 08:10:08 -070063 int64_t now_ms = 0;
philipele0b2f152016-09-28 10:23:49 +020064
65 do {
philipel29f730e2017-03-15 08:10:08 -070066 now_ms = clock_->TimeInMilliseconds();
philipel504c47d2016-06-30 17:33:02 +020067 {
68 rtc::CritScope lock(&crit_);
tommi0a735642017-03-14 06:23:57 -070069 new_continuous_frame_event_.Reset();
philipel29f730e2017-03-15 08:10:08 -070070 if (stopped_)
71 return kStopped;
72
73 wait_ms = max_wait_time_ms;
74
philipele0b2f152016-09-28 10:23:49 +020075 // Need to hold |crit_| in order to use |frames_|, therefore we
76 // set it here in the loop instead of outside the loop in order to not
77 // acquire the lock unnecesserily.
philipel1c056252017-01-31 09:53:12 -080078 next_frame_it_ = frames_.end();
philipelbe7a9e52016-05-19 12:19:35 +020079
philipele0b2f152016-09-28 10:23:49 +020080 // |frame_it| points to the first frame after the
81 // |last_decoded_frame_it_|.
82 auto frame_it = frames_.end();
83 if (last_decoded_frame_it_ == frames_.end()) {
84 frame_it = frames_.begin();
philipelbe7a9e52016-05-19 12:19:35 +020085 } else {
philipele0b2f152016-09-28 10:23:49 +020086 frame_it = last_decoded_frame_it_;
87 ++frame_it;
philipelbe7a9e52016-05-19 12:19:35 +020088 }
philipele0b2f152016-09-28 10:23:49 +020089
90 // |continuous_end_it| points to the first frame after the
91 // |last_continuous_frame_it_|.
92 auto continuous_end_it = last_continuous_frame_it_;
93 if (continuous_end_it != frames_.end())
94 ++continuous_end_it;
95
96 for (; frame_it != continuous_end_it; ++frame_it) {
philipel93e451b2016-10-06 12:25:13 +020097 if (!frame_it->second.continuous ||
98 frame_it->second.num_missing_decodable > 0) {
philipele0b2f152016-09-28 10:23:49 +020099 continue;
philipel93e451b2016-10-06 12:25:13 +0200100 }
philipele0b2f152016-09-28 10:23:49 +0200101
102 FrameObject* frame = frame_it->second.frame.get();
philipel1c056252017-01-31 09:53:12 -0800103 next_frame_it_ = frame_it;
philipele0b2f152016-09-28 10:23:49 +0200104 if (frame->RenderTime() == -1)
105 frame->SetRenderTime(timing_->RenderTimeMs(frame->timestamp, now_ms));
106 wait_ms = timing_->MaxWaitingTime(frame->RenderTime(), now_ms);
107
108 // This will cause the frame buffer to prefer high framerate rather
109 // than high resolution in the case of the decoder not decoding fast
110 // enough and the stream has multiple spatial and temporal layers.
111 if (wait_ms == 0)
112 continue;
113
114 break;
115 }
116 } // rtc::Critscope lock(&crit_);
117
philipel1c056252017-01-31 09:53:12 -0800118 wait_ms = std::min<int64_t>(wait_ms, latest_return_time_ms - now_ms);
philipele0b2f152016-09-28 10:23:49 +0200119 wait_ms = std::max<int64_t>(wait_ms, 0);
tommi0a735642017-03-14 06:23:57 -0700120 } while (new_continuous_frame_event_.Wait(wait_ms));
philipele0b2f152016-09-28 10:23:49 +0200121
philipel29f730e2017-03-15 08:10:08 -0700122 {
123 rtc::CritScope lock(&crit_);
124 now_ms = clock_->TimeInMilliseconds();
125 if (next_frame_it_ != frames_.end()) {
126 std::unique_ptr<FrameObject> frame =
127 std::move(next_frame_it_->second.frame);
philipele0b2f152016-09-28 10:23:49 +0200128
philipel29f730e2017-03-15 08:10:08 -0700129 if (!frame->delayed_by_retransmission()) {
130 int64_t frame_delay;
philipele0754302017-01-25 08:56:23 -0800131
philipel29f730e2017-03-15 08:10:08 -0700132 if (inter_frame_delay_.CalculateDelay(frame->timestamp, &frame_delay,
133 frame->ReceivedTime())) {
134 jitter_estimator_->UpdateEstimate(frame_delay, frame->size());
135 }
136
137 float rtt_mult = protection_mode_ == kProtectionNackFEC ? 0.0 : 1.0;
138 timing_->SetJitterDelay(jitter_estimator_->GetJitterEstimate(rtt_mult));
139 timing_->UpdateCurrentDelay(frame->RenderTime(), now_ms);
philipele0754302017-01-25 08:56:23 -0800140 }
141
philipel29f730e2017-03-15 08:10:08 -0700142 UpdateJitterDelay();
143
144 PropagateDecodability(next_frame_it_->second);
145 AdvanceLastDecodedFrame(next_frame_it_);
146 last_decoded_frame_timestamp_ = frame->timestamp;
147 *frame_out = std::move(frame);
148 return kFrameFound;
philipelbe7a9e52016-05-19 12:19:35 +0200149 }
tommi0a735642017-03-14 06:23:57 -0700150 }
151
152 if (latest_return_time_ms - now_ms > 0) {
philipel1c056252017-01-31 09:53:12 -0800153 // If |next_frame_it_ == frames_.end()| and there is still time left, it
154 // means that the frame buffer was cleared as the thread in this function
155 // was waiting to acquire |crit_| in order to return. Wait for the
156 // remaining time and then return.
157 return NextFrame(latest_return_time_ms - now_ms, frame_out);
philipelbe7a9e52016-05-19 12:19:35 +0200158 }
tommi0a735642017-03-14 06:23:57 -0700159
160 return kTimeout;
philipelbe7a9e52016-05-19 12:19:35 +0200161}
162
philipel4f6cd6a2016-08-03 10:59:32 +0200163void FrameBuffer::SetProtectionMode(VCMVideoProtection mode) {
tommidb23ea62017-03-03 07:21:18 -0800164 TRACE_EVENT0("webrtc", "FrameBuffer::SetProtectionMode");
philipel4f6cd6a2016-08-03 10:59:32 +0200165 rtc::CritScope lock(&crit_);
166 protection_mode_ = mode;
167}
168
philipel504c47d2016-06-30 17:33:02 +0200169void FrameBuffer::Start() {
tommidb23ea62017-03-03 07:21:18 -0800170 TRACE_EVENT0("webrtc", "FrameBuffer::Start");
philipel29f730e2017-03-15 08:10:08 -0700171 rtc::CritScope lock(&crit_);
172 stopped_ = false;
philipel504c47d2016-06-30 17:33:02 +0200173}
174
175void FrameBuffer::Stop() {
tommidb23ea62017-03-03 07:21:18 -0800176 TRACE_EVENT0("webrtc", "FrameBuffer::Stop");
philipel29f730e2017-03-15 08:10:08 -0700177 rtc::CritScope lock(&crit_);
178 stopped_ = true;
tommi0a735642017-03-14 06:23:57 -0700179 new_continuous_frame_event_.Set();
philipel504c47d2016-06-30 17:33:02 +0200180}
181
philipele0b2f152016-09-28 10:23:49 +0200182int FrameBuffer::InsertFrame(std::unique_ptr<FrameObject> frame) {
tommidb23ea62017-03-03 07:21:18 -0800183 TRACE_EVENT0("webrtc", "FrameBuffer::InsertFrame");
philipel93e451b2016-10-06 12:25:13 +0200184 RTC_DCHECK(frame);
philipela45102f2017-02-22 05:30:39 -0800185 if (stats_callback_)
186 stats_callback_->OnCompleteFrame(frame->num_references == 0, frame->size());
philipelbe7a9e52016-05-19 12:19:35 +0200187 FrameKey key(frame->picture_id, frame->spatial_layer);
tommi0a735642017-03-14 06:23:57 -0700188
189 rtc::CritScope lock(&crit_);
philipel29f730e2017-03-15 08:10:08 -0700190
philipele0b2f152016-09-28 10:23:49 +0200191 int last_continuous_picture_id =
192 last_continuous_frame_it_ == frames_.end()
193 ? -1
194 : last_continuous_frame_it_->first.picture_id;
195
196 if (num_frames_buffered_ >= kMaxFramesBuffered) {
197 LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id
198 << ":" << static_cast<int>(key.spatial_layer)
199 << ") could not be inserted due to the frame "
200 << "buffer being full, dropping frame.";
201 return last_continuous_picture_id;
202 }
203
204 if (frame->inter_layer_predicted && frame->spatial_layer == 0) {
205 LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id
206 << ":" << static_cast<int>(key.spatial_layer)
207 << ") is marked as inter layer predicted, dropping frame.";
208 return last_continuous_picture_id;
209 }
210
211 if (last_decoded_frame_it_ != frames_.end() &&
212 key < last_decoded_frame_it_->first) {
philipelfcc60062017-01-18 05:35:20 -0800213 if (AheadOf(frame->timestamp, last_decoded_frame_timestamp_) &&
214 frame->num_references == 0) {
215 // If this frame has a newer timestamp but an earlier picture id then we
216 // assume there has been a jump in the picture id due to some encoder
217 // reconfiguration or some other reason. Even though this is not according
218 // to spec we can still continue to decode from this frame if it is a
219 // keyframe.
220 LOG(LS_WARNING) << "A jump in picture id was detected, clearing buffer.";
221 ClearFramesAndHistory();
222 last_continuous_picture_id = -1;
223 } else {
224 LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
225 << key.picture_id << ":"
226 << static_cast<int>(key.spatial_layer)
227 << ") inserted after frame ("
228 << last_decoded_frame_it_->first.picture_id << ":"
229 << static_cast<int>(
230 last_decoded_frame_it_->first.spatial_layer)
231 << ") was handed off for decoding, dropping frame.";
232 return last_continuous_picture_id;
233 }
philipele0b2f152016-09-28 10:23:49 +0200234 }
235
236 auto info = frames_.insert(std::make_pair(key, FrameInfo())).first;
237
philipel93e451b2016-10-06 12:25:13 +0200238 if (info->second.frame) {
239 LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id
240 << ":" << static_cast<int>(key.spatial_layer)
241 << ") already inserted, dropping frame.";
philipele0b2f152016-09-28 10:23:49 +0200242 return last_continuous_picture_id;
243 }
244
philipel93e451b2016-10-06 12:25:13 +0200245 if (!UpdateFrameInfoWithIncomingFrame(*frame, info))
246 return last_continuous_picture_id;
247
philipele0b2f152016-09-28 10:23:49 +0200248 info->second.frame = std::move(frame);
249 ++num_frames_buffered_;
250
251 if (info->second.num_missing_continuous == 0) {
252 info->second.continuous = true;
253 PropagateContinuity(info);
254 last_continuous_picture_id = last_continuous_frame_it_->first.picture_id;
255
256 // Since we now have new continuous frames there might be a better frame
257 // to return from NextFrame. Signal that thread so that it again can choose
258 // which frame to return.
tommi0a735642017-03-14 06:23:57 -0700259 new_continuous_frame_event_.Set();
philipele0b2f152016-09-28 10:23:49 +0200260 }
261
262 return last_continuous_picture_id;
philipelbe7a9e52016-05-19 12:19:35 +0200263}
264
philipele0b2f152016-09-28 10:23:49 +0200265void FrameBuffer::PropagateContinuity(FrameMap::iterator start) {
tommidb23ea62017-03-03 07:21:18 -0800266 TRACE_EVENT0("webrtc", "FrameBuffer::PropagateContinuity");
philipele0b2f152016-09-28 10:23:49 +0200267 RTC_DCHECK(start->second.continuous);
268 if (last_continuous_frame_it_ == frames_.end())
269 last_continuous_frame_it_ = start;
270
271 std::queue<FrameMap::iterator> continuous_frames;
272 continuous_frames.push(start);
273
274 // A simple BFS to traverse continuous frames.
275 while (!continuous_frames.empty()) {
276 auto frame = continuous_frames.front();
277 continuous_frames.pop();
278
279 if (last_continuous_frame_it_->first < frame->first)
280 last_continuous_frame_it_ = frame;
281
282 // Loop through all dependent frames, and if that frame no longer has
283 // any unfulfilled dependencies then that frame is continuous as well.
284 for (size_t d = 0; d < frame->second.num_dependent_frames; ++d) {
285 auto frame_ref = frames_.find(frame->second.dependent_frames[d]);
286 --frame_ref->second.num_missing_continuous;
287
288 if (frame_ref->second.num_missing_continuous == 0) {
289 frame_ref->second.continuous = true;
290 continuous_frames.push(frame_ref);
291 }
292 }
293 }
294}
295
296void FrameBuffer::PropagateDecodability(const FrameInfo& info) {
tommidb23ea62017-03-03 07:21:18 -0800297 TRACE_EVENT0("webrtc", "FrameBuffer::PropagateDecodability");
philipele0b2f152016-09-28 10:23:49 +0200298 for (size_t d = 0; d < info.num_dependent_frames; ++d) {
299 auto ref_info = frames_.find(info.dependent_frames[d]);
philipel93e451b2016-10-06 12:25:13 +0200300 RTC_DCHECK(ref_info != frames_.end());
philipele0b2f152016-09-28 10:23:49 +0200301 RTC_DCHECK_GT(ref_info->second.num_missing_decodable, 0U);
302 --ref_info->second.num_missing_decodable;
303 }
304}
305
306void FrameBuffer::AdvanceLastDecodedFrame(FrameMap::iterator decoded) {
tommidb23ea62017-03-03 07:21:18 -0800307 TRACE_EVENT0("webrtc", "FrameBuffer::AdvanceLastDecodedFrame");
philipele0b2f152016-09-28 10:23:49 +0200308 if (last_decoded_frame_it_ == frames_.end()) {
309 last_decoded_frame_it_ = frames_.begin();
310 } else {
311 RTC_DCHECK(last_decoded_frame_it_->first < decoded->first);
312 ++last_decoded_frame_it_;
313 }
314 --num_frames_buffered_;
315 ++num_frames_history_;
316
317 // First, delete non-decoded frames from the history.
318 while (last_decoded_frame_it_ != decoded) {
319 if (last_decoded_frame_it_->second.frame)
320 --num_frames_buffered_;
321 last_decoded_frame_it_ = frames_.erase(last_decoded_frame_it_);
philipelbe7a9e52016-05-19 12:19:35 +0200322 }
323
philipele0b2f152016-09-28 10:23:49 +0200324 // Then remove old history if we have too much history saved.
325 if (num_frames_history_ > kMaxFramesHistory) {
326 frames_.erase(frames_.begin());
327 --num_frames_history_;
328 }
329}
330
331bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const FrameObject& frame,
332 FrameMap::iterator info) {
tommidb23ea62017-03-03 07:21:18 -0800333 TRACE_EVENT0("webrtc", "FrameBuffer::UpdateFrameInfoWithIncomingFrame");
philipele0b2f152016-09-28 10:23:49 +0200334 FrameKey key(frame.picture_id, frame.spatial_layer);
335 info->second.num_missing_continuous = frame.num_references;
336 info->second.num_missing_decodable = frame.num_references;
337
338 RTC_DCHECK(last_decoded_frame_it_ == frames_.end() ||
339 last_decoded_frame_it_->first < info->first);
340
341 // Check how many dependencies that have already been fulfilled.
342 for (size_t i = 0; i < frame.num_references; ++i) {
343 FrameKey ref_key(frame.references[i], frame.spatial_layer);
344 auto ref_info = frames_.find(ref_key);
345
346 // Does |frame| depend on a frame earlier than the last decoded frame?
347 if (last_decoded_frame_it_ != frames_.end() &&
348 ref_key <= last_decoded_frame_it_->first) {
349 if (ref_info == frames_.end()) {
350 LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) ("
351 << key.picture_id << ":"
352 << static_cast<int>(key.spatial_layer)
353 << " depends on a non-decoded frame more previous than "
354 << "the last decoded frame, dropping frame.";
355 return false;
356 }
357
358 --info->second.num_missing_continuous;
359 --info->second.num_missing_decodable;
360 } else {
361 if (ref_info == frames_.end())
362 ref_info = frames_.insert(std::make_pair(ref_key, FrameInfo())).first;
363
364 if (ref_info->second.continuous)
365 --info->second.num_missing_continuous;
366
367 // Add backwards reference so |frame| can be updated when new
368 // frames are inserted or decoded.
369 ref_info->second.dependent_frames[ref_info->second.num_dependent_frames] =
370 key;
371 ++ref_info->second.num_dependent_frames;
372 }
philipel93e451b2016-10-06 12:25:13 +0200373 RTC_DCHECK_LE(ref_info->second.num_missing_continuous,
374 ref_info->second.num_missing_decodable);
philipelbe7a9e52016-05-19 12:19:35 +0200375 }
376
philipele0b2f152016-09-28 10:23:49 +0200377 // Check if we have the lower spatial layer frame.
philipelbe7a9e52016-05-19 12:19:35 +0200378 if (frame.inter_layer_predicted) {
philipele0b2f152016-09-28 10:23:49 +0200379 ++info->second.num_missing_continuous;
380 ++info->second.num_missing_decodable;
381
philipelbe7a9e52016-05-19 12:19:35 +0200382 FrameKey ref_key(frame.picture_id, frame.spatial_layer - 1);
philipele0b2f152016-09-28 10:23:49 +0200383 // Gets or create the FrameInfo for the referenced frame.
384 auto ref_info = frames_.insert(std::make_pair(ref_key, FrameInfo())).first;
385 if (ref_info->second.continuous)
386 --info->second.num_missing_continuous;
387
388 if (ref_info == last_decoded_frame_it_) {
389 --info->second.num_missing_decodable;
390 } else {
391 ref_info->second.dependent_frames[ref_info->second.num_dependent_frames] =
392 key;
393 ++ref_info->second.num_dependent_frames;
394 }
philipel93e451b2016-10-06 12:25:13 +0200395 RTC_DCHECK_LE(ref_info->second.num_missing_continuous,
396 ref_info->second.num_missing_decodable);
philipelbe7a9e52016-05-19 12:19:35 +0200397 }
398
philipel93e451b2016-10-06 12:25:13 +0200399 RTC_DCHECK_LE(info->second.num_missing_continuous,
400 info->second.num_missing_decodable);
401
philipelbe7a9e52016-05-19 12:19:35 +0200402 return true;
403}
404
philipelbe742702016-11-30 01:31:40 -0800405void FrameBuffer::UpdateJitterDelay() {
tommidb23ea62017-03-03 07:21:18 -0800406 TRACE_EVENT0("webrtc", "FrameBuffer::UpdateJitterDelay");
philipela45102f2017-02-22 05:30:39 -0800407 if (!stats_callback_)
408 return;
philipelbe742702016-11-30 01:31:40 -0800409
philipela45102f2017-02-22 05:30:39 -0800410 int decode_ms;
411 int max_decode_ms;
412 int current_delay_ms;
413 int target_delay_ms;
414 int jitter_buffer_ms;
415 int min_playout_delay_ms;
416 int render_delay_ms;
417 if (timing_->GetTimings(&decode_ms, &max_decode_ms, &current_delay_ms,
418 &target_delay_ms, &jitter_buffer_ms,
419 &min_playout_delay_ms, &render_delay_ms)) {
420 stats_callback_->OnFrameBufferTimingsUpdated(
421 decode_ms, max_decode_ms, current_delay_ms, target_delay_ms,
422 jitter_buffer_ms, min_playout_delay_ms, render_delay_ms);
philipelbe742702016-11-30 01:31:40 -0800423 }
philipel266f0a42016-11-28 08:49:07 -0800424}
425
philipelfcc60062017-01-18 05:35:20 -0800426void FrameBuffer::ClearFramesAndHistory() {
tommidb23ea62017-03-03 07:21:18 -0800427 TRACE_EVENT0("webrtc", "FrameBuffer::UpdateJitterDelay");
philipelfcc60062017-01-18 05:35:20 -0800428 frames_.clear();
429 last_decoded_frame_it_ = frames_.end();
430 last_continuous_frame_it_ = frames_.end();
philipel1c056252017-01-31 09:53:12 -0800431 next_frame_it_ = frames_.end();
philipelfcc60062017-01-18 05:35:20 -0800432 num_frames_history_ = 0;
433 num_frames_buffered_ = 0;
434}
435
philipelbe7a9e52016-05-19 12:19:35 +0200436} // namespace video_coding
437} // namespace webrtc