| 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 |
| 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ |
| 12 #define WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ |
| 13 | 13 |
| 14 #include <array> | 14 #include <array> |
| 15 #include <map> | 15 #include <map> |
| 16 #include <memory> | 16 #include <memory> |
| 17 #include <queue> | 17 #include <queue> |
| 18 #include <set> | 18 #include <set> |
| 19 #include <utility> | 19 #include <utility> |
| 20 | 20 |
| 21 #include "webrtc/base/criticalsection.h" | 21 #include "webrtc/base/criticalsection.h" |
| 22 #include "webrtc/base/thread_annotations.h" | 22 #include "webrtc/base/thread_annotations.h" |
| 23 #include "webrtc/modules/include/module_common_types.h" | 23 #include "webrtc/modules/include/module_common_types.h" |
| 24 #include "webrtc/modules/video_coding/sequence_number_util.h" | 24 #include "webrtc/modules/video_coding/sequence_number_util.h" |
| 25 | 25 |
| 26 namespace webrtc { | 26 namespace webrtc { |
| 27 namespace video_coding { | 27 namespace video_coding { |
| 28 | 28 |
| 29 class FrameObject; |
| 29 class RtpFrameObject; | 30 class RtpFrameObject; |
| 30 class OnCompleteFrameCallback; | 31 |
| 32 // A complete frame is a frame which has received all its packets and all its |
| 33 // references are known. |
| 34 class OnCompleteFrameCallback { |
| 35 public: |
| 36 virtual ~OnCompleteFrameCallback() {} |
| 37 virtual void OnCompleteFrame(std::unique_ptr<FrameObject> frame) = 0; |
| 38 }; |
| 31 | 39 |
| 32 class RtpFrameReferenceFinder { | 40 class RtpFrameReferenceFinder { |
| 33 public: | 41 public: |
| 34 explicit RtpFrameReferenceFinder(OnCompleteFrameCallback* frame_callback); | 42 explicit RtpFrameReferenceFinder(OnCompleteFrameCallback* frame_callback); |
| 35 void ManageFrame(std::unique_ptr<RtpFrameObject> frame); | 43 void ManageFrame(std::unique_ptr<RtpFrameObject> frame); |
| 36 void PaddingReceived(uint16_t seq_num); | 44 void PaddingReceived(uint16_t seq_num); |
| 37 | 45 |
| 38 private: | 46 private: |
| 39 static const uint16_t kPicIdLength = 1 << 7; | 47 static const uint16_t kPicIdLength = 1 << 7; |
| 40 static const uint8_t kMaxTemporalLayers = 5; | 48 static const uint8_t kMaxTemporalLayers = 5; |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 kMaxTemporalLayers> | 177 kMaxTemporalLayers> |
| 170 missing_frames_for_layer_ GUARDED_BY(crit_); | 178 missing_frames_for_layer_ GUARDED_BY(crit_); |
| 171 | 179 |
| 172 OnCompleteFrameCallback* frame_callback_; | 180 OnCompleteFrameCallback* frame_callback_; |
| 173 }; | 181 }; |
| 174 | 182 |
| 175 } // namespace video_coding | 183 } // namespace video_coding |
| 176 } // namespace webrtc | 184 } // namespace webrtc |
| 177 | 185 |
| 178 #endif // WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ | 186 #endif // WEBRTC_MODULES_VIDEO_CODING_RTP_FRAME_REFERENCE_FINDER_H_ |
| OLD | NEW |