OLD | NEW |
---|---|
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 21 matching lines...) Expand all Loading... | |
32 // A complete frame is a frame which has received all its packets and all its | 32 // A complete frame is a frame which has received all its packets and all its |
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); |
brandtr
2016/09/05 11:20:32
Perhaps it would be good to comment the public int
philipel
2016/09/05 12:11:01
Done.
| |
43 void ManageFrame(std::unique_ptr<RtpFrameObject> frame); | 43 void ManageFrame(std::unique_ptr<RtpFrameObject> frame); |
44 void PaddingReceived(uint16_t seq_num); | 44 void PaddingReceived(uint16_t seq_num); |
45 void ClearTo(uint16_t seq_num); | |
45 | 46 |
46 private: | 47 private: |
47 static const uint16_t kPicIdLength = 1 << 7; | 48 static const uint16_t kPicIdLength = 1 << 7; |
48 static const uint8_t kMaxTemporalLayers = 5; | 49 static const uint8_t kMaxTemporalLayers = 5; |
49 static const int kMaxLayerInfo = 10; | 50 static const int kMaxLayerInfo = 10; |
50 static const int kMaxStashedFrames = 10; | 51 static const int kMaxStashedFrames = 10; |
51 static const int kMaxNotYetReceivedFrames = 20; | 52 static const int kMaxNotYetReceivedFrames = 20; |
52 static const int kMaxGofSaved = 15; | 53 static const int kMaxGofSaved = 15; |
53 static const int kMaxPaddingAge = 100; | 54 static const int kMaxPaddingAge = 100; |
54 | 55 |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 // Keep track of which picture id and which temporal layer that had the | 171 // Keep track of which picture id and which temporal layer that had the |
171 // up switch flag set. | 172 // up switch flag set. |
172 std::map<uint16_t, uint8_t, DescendingSeqNumComp<uint16_t, kPicIdLength>> | 173 std::map<uint16_t, uint8_t, DescendingSeqNumComp<uint16_t, kPicIdLength>> |
173 up_switch_ GUARDED_BY(crit_); | 174 up_switch_ GUARDED_BY(crit_); |
174 | 175 |
175 // For every temporal layer, keep a set of which frames that are missing. | 176 // For every temporal layer, keep a set of which frames that are missing. |
176 std::array<std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>, | 177 std::array<std::set<uint16_t, DescendingSeqNumComp<uint16_t, kPicIdLength>>, |
177 kMaxTemporalLayers> | 178 kMaxTemporalLayers> |
178 missing_frames_for_layer_ GUARDED_BY(crit_); | 179 missing_frames_for_layer_ GUARDED_BY(crit_); |
179 | 180 |
181 // How far frames have been cleared by sequence number. A frame will be | |
182 // cleared if it contains a packet with a sequence number older than | |
183 // |cleared_to_seq_num_|. | |
184 int cleared_to_seq_num_ GUARDED_BY(crit_); | |
185 | |
180 OnCompleteFrameCallback* frame_callback_; | 186 OnCompleteFrameCallback* frame_callback_; |
181 }; | 187 }; |
182 | 188 |
183 } // namespace video_coding | 189 } // namespace video_coding |
184 } // namespace webrtc | 190 } // namespace webrtc |
185 | 191 |
186 #endif // WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ | 192 #endif // WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ |
OLD | NEW |