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

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

Issue 2842133002: Reject re-inserting already decoded frames into FrameBuffer2. (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | webrtc/modules/video_coding/frame_buffer2_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 } 203 }
204 204
205 if (frame->inter_layer_predicted && frame->spatial_layer == 0) { 205 if (frame->inter_layer_predicted && frame->spatial_layer == 0) {
206 LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id 206 LOG(LS_WARNING) << "Frame with (picture_id:spatial_id) (" << key.picture_id
207 << ":" << static_cast<int>(key.spatial_layer) 207 << ":" << static_cast<int>(key.spatial_layer)
208 << ") is marked as inter layer predicted, dropping frame."; 208 << ") is marked as inter layer predicted, dropping frame.";
209 return last_continuous_picture_id; 209 return last_continuous_picture_id;
210 } 210 }
211 211
212 if (last_decoded_frame_it_ != frames_.end() && 212 if (last_decoded_frame_it_ != frames_.end() &&
213 key < last_decoded_frame_it_->first) { 213 key <= last_decoded_frame_it_->first) {
214 if (AheadOf(frame->timestamp, last_decoded_frame_timestamp_) && 214 if (AheadOf(frame->timestamp, last_decoded_frame_timestamp_) &&
215 frame->num_references == 0) { 215 frame->num_references == 0) {
216 // If this frame has a newer timestamp but an earlier picture id then we 216 // If this frame has a newer timestamp but an earlier picture id then we
217 // assume there has been a jump in the picture id due to some encoder 217 // assume there has been a jump in the picture id due to some encoder
218 // reconfiguration or some other reason. Even though this is not according 218 // reconfiguration or some other reason. Even though this is not according
219 // to spec we can still continue to decode from this frame if it is a 219 // to spec we can still continue to decode from this frame if it is a
220 // keyframe. 220 // keyframe.
221 LOG(LS_WARNING) << "A jump in picture id was detected, clearing buffer."; 221 LOG(LS_WARNING) << "A jump in picture id was detected, clearing buffer.";
222 ClearFramesAndHistory(); 222 ClearFramesAndHistory();
223 last_continuous_picture_id = -1; 223 last_continuous_picture_id = -1;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 frames_.clear(); 440 frames_.clear();
441 last_decoded_frame_it_ = frames_.end(); 441 last_decoded_frame_it_ = frames_.end();
442 last_continuous_frame_it_ = frames_.end(); 442 last_continuous_frame_it_ = frames_.end();
443 next_frame_it_ = frames_.end(); 443 next_frame_it_ = frames_.end();
444 num_frames_history_ = 0; 444 num_frames_history_ = 0;
445 num_frames_buffered_ = 0; 445 num_frames_buffered_ = 0;
446 } 446 }
447 447
448 } // namespace video_coding 448 } // namespace video_coding
449 } // namespace webrtc 449 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/frame_buffer2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698