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

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

Issue 2304723004: Added ClearTo(seq_num) to RtpFrameReferenceFinder. (Closed)
Patch Set: Added comments. Created 4 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 22 matching lines...) Expand all
33 // references are known. 33 // references are known.
34 class OnCompleteFrameCallback { 34 class OnCompleteFrameCallback {
35 public: 35 public:
36 virtual ~OnCompleteFrameCallback() {} 36 virtual ~OnCompleteFrameCallback() {}
37 virtual void OnCompleteFrame(std::unique_ptr<FrameObject> frame) = 0; 37 virtual void OnCompleteFrame(std::unique_ptr<FrameObject> frame) = 0;
38 }; 38 };
39 39
40 class RtpFrameReferenceFinder { 40 class RtpFrameReferenceFinder {
41 public: 41 public:
42 explicit RtpFrameReferenceFinder(OnCompleteFrameCallback* frame_callback); 42 explicit RtpFrameReferenceFinder(OnCompleteFrameCallback* frame_callback);
43
44 // Find all references for this frame.
stefan-webrtc 2016/09/07 13:29:57 Maybe the method should be called that in stead of
philipel 2016/09/08 11:27:19 Updated the comment the better reflect what Manage
43 void ManageFrame(std::unique_ptr<RtpFrameObject> frame); 45 void ManageFrame(std::unique_ptr<RtpFrameObject> frame);
46
47 // Notifies that padding has been received, which the reference finder
48 // might need to calculate the references of a frame.
44 void PaddingReceived(uint16_t seq_num); 49 void PaddingReceived(uint16_t seq_num);
45 50
51 // Clear all stashed frames that include packets older than |seq_num|.
52 void ClearTo(uint16_t seq_num);
53
46 private: 54 private:
47 static const uint16_t kPicIdLength = 1 << 7; 55 static const uint16_t kPicIdLength = 1 << 7;
48 static const uint8_t kMaxTemporalLayers = 5; 56 static const uint8_t kMaxTemporalLayers = 5;
49 static const int kMaxLayerInfo = 10; 57 static const int kMaxLayerInfo = 10;
50 static const int kMaxStashedFrames = 10; 58 static const int kMaxStashedFrames = 10;
51 static const int kMaxNotYetReceivedFrames = 20; 59 static const int kMaxNotYetReceivedFrames = 20;
52 static const int kMaxGofSaved = 15; 60 static const int kMaxGofSaved = 15;
53 static const int kMaxPaddingAge = 100; 61 static const int kMaxPaddingAge = 100;
54 62
55 63
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Keep track of which picture id and which temporal layer that had the 178 // Keep track of which picture id and which temporal layer that had the
171 // up switch flag set. 179 // up switch flag set.
172 std::map<uint16_t, uint8_t, DescendingSeqNumComp<uint16_t, kPicIdLength>> 180 std::map<uint16_t, uint8_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>
173 up_switch_ GUARDED_BY(crit_); 181 up_switch_ GUARDED_BY(crit_);
174 182
175 // For every temporal layer, keep a set of which frames that are missing. 183 // For every temporal layer, keep a set of which frames that are missing.
176 std::array<std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>, 184 std::array<std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>,
177 kMaxTemporalLayers> 185 kMaxTemporalLayers>
178 missing_frames_for_layer_ GUARDED_BY(crit_); 186 missing_frames_for_layer_ GUARDED_BY(crit_);
179 187
188 // How far frames have been cleared by sequence number. A frame will be
189 // cleared if it contains a packet with a sequence number older than
190 // |cleared_to_seq_num_|.
191 int cleared_to_seq_num_ GUARDED_BY(crit_);
192
180 OnCompleteFrameCallback* frame_callback_; 193 OnCompleteFrameCallback* frame_callback_;
181 }; 194 };
182 195
183 } // namespace video_coding 196 } // namespace video_coding
184 } // namespace webrtc 197 } // namespace webrtc
185 198
186 #endif // WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ 199 #endif // WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698