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

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

Issue 3012883002: Don't treat picture ids as wrapping in the FrameBuffer2 class. (Closed)
Patch Set: . Created 3 years, 3 months 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 } 241 }
242 242
243 void FrameBuffer::Stop() { 243 void FrameBuffer::Stop() {
244 TRACE_EVENT0("webrtc", "FrameBuffer::Stop"); 244 TRACE_EVENT0("webrtc", "FrameBuffer::Stop");
245 rtc::CritScope lock(&crit_); 245 rtc::CritScope lock(&crit_);
246 stopped_ = true; 246 stopped_ = true;
247 new_continuous_frame_event_.Set(); 247 new_continuous_frame_event_.Set();
248 } 248 }
249 249
250 bool FrameBuffer::ValidReferences(const FrameObject& frame) const { 250 bool FrameBuffer::ValidReferences(const FrameObject& frame) const {
251 if (frame.picture_id < 0)
terelius 2017/09/11 16:10:22 What does it mean if we get frame with negative pi
252 return false;
253
251 for (size_t i = 0; i < frame.num_references; ++i) { 254 for (size_t i = 0; i < frame.num_references; ++i) {
252 if (AheadOrAt<uint16_t>(frame.references[i], frame.picture_id)) 255 if (frame.references[i] < 0 || frame.references[i] >= frame.picture_id)
253 return false; 256 return false;
257
254 for (size_t j = i + 1; j < frame.num_references; ++j) { 258 for (size_t j = i + 1; j < frame.num_references; ++j) {
255 if (frame.references[i] == frame.references[j]) 259 if (frame.references[i] == frame.references[j])
256 return false; 260 return false;
257 } 261 }
258 } 262 }
259 263
260 if (frame.inter_layer_predicted && frame.spatial_layer == 0) 264 if (frame.inter_layer_predicted && frame.spatial_layer == 0)
261 return false; 265 return false;
262 266
263 return true; 267 return true;
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 frames_.clear(); 564 frames_.clear();
561 last_decoded_frame_it_ = frames_.end(); 565 last_decoded_frame_it_ = frames_.end();
562 last_continuous_frame_it_ = frames_.end(); 566 last_continuous_frame_it_ = frames_.end();
563 next_frame_it_ = frames_.end(); 567 next_frame_it_ = frames_.end();
564 num_frames_history_ = 0; 568 num_frames_history_ = 0;
565 num_frames_buffered_ = 0; 569 num_frames_buffered_ = 0;
566 } 570 }
567 571
568 } // namespace video_coding 572 } // namespace video_coding
569 } // namespace webrtc 573 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698