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

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

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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // Start the frame buffer, has no effect if the frame buffer is started. 69 // Start the frame buffer, has no effect if the frame buffer is started.
70 // The frame buffer is started upon construction. 70 // The frame buffer is started upon construction.
71 void Start(); 71 void Start();
72 72
73 // Stop the frame buffer, causing any sleeping thread in NextFrame to 73 // Stop the frame buffer, causing any sleeping thread in NextFrame to
74 // return immediately. 74 // return immediately.
75 void Stop(); 75 void Stop();
76 76
77 private: 77 private:
78 struct FrameKey { 78 struct FrameKey {
79 FrameKey() : picture_id(0), spatial_layer(0) {} 79 FrameKey() : picture_id(-1), spatial_layer(0) {}
80 FrameKey(uint16_t picture_id, uint8_t spatial_layer) 80 FrameKey(int64_t picture_id, uint8_t spatial_layer)
81 : picture_id(picture_id), spatial_layer(spatial_layer) {} 81 : picture_id(picture_id), spatial_layer(spatial_layer) {}
82 82
83 bool operator<(const FrameKey& rhs) const { 83 bool operator<(const FrameKey& rhs) const {
84 if (picture_id == rhs.picture_id) 84 if (picture_id == rhs.picture_id)
85 return spatial_layer < rhs.spatial_layer; 85 return spatial_layer < rhs.spatial_layer;
86 return AheadOf(rhs.picture_id, picture_id); 86 return picture_id < rhs.picture_id;
87 } 87 }
88 88
89 bool operator<=(const FrameKey& rhs) const { return !(rhs < *this); } 89 bool operator<=(const FrameKey& rhs) const { return !(rhs < *this); }
90 90
91 uint16_t picture_id; 91 int64_t picture_id;
92 uint8_t spatial_layer; 92 uint8_t spatial_layer;
93 }; 93 };
94 94
95 struct FrameInfo { 95 struct FrameInfo {
96 // The maximum number of frames that can depend on this frame. 96 // The maximum number of frames that can depend on this frame.
97 static constexpr size_t kMaxNumDependentFrames = 8; 97 static constexpr size_t kMaxNumDependentFrames = 8;
98 98
99 // Which other frames that have direct unfulfilled dependencies 99 // Which other frames that have direct unfulfilled dependencies
100 // on this frame. 100 // on this frame.
101 // TODO(philipel): Add simple modify/access functions to prevent adding too 101 // TODO(philipel): Add simple modify/access functions to prevent adding too
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 VCMReceiveStatisticsCallback* const stats_callback_; 180 VCMReceiveStatisticsCallback* const stats_callback_;
181 int64_t last_log_non_decoded_ms_ RTC_GUARDED_BY(crit_); 181 int64_t last_log_non_decoded_ms_ RTC_GUARDED_BY(crit_);
182 182
183 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer); 183 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer);
184 }; 184 };
185 185
186 } // namespace video_coding 186 } // namespace video_coding
187 } // namespace webrtc 187 } // namespace webrtc
188 188
189 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_BUFFER2_H_ 189 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_BUFFER2_H_
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/frame_buffer2.cc » ('j') | webrtc/modules/video_coding/frame_buffer2.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698