| 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 23 matching lines...) Expand all Loading... |
| 34 namespace video_coding { | 34 namespace video_coding { |
| 35 | 35 |
| 36 class FrameBuffer { | 36 class FrameBuffer { |
| 37 public: | 37 public: |
| 38 enum ReturnReason { kFrameFound, kTimeout, kStopped }; | 38 enum ReturnReason { kFrameFound, kTimeout, kStopped }; |
| 39 | 39 |
| 40 FrameBuffer(Clock* clock, | 40 FrameBuffer(Clock* clock, |
| 41 VCMJitterEstimator* jitter_estimator, | 41 VCMJitterEstimator* jitter_estimator, |
| 42 VCMTiming* timing); | 42 VCMTiming* timing); |
| 43 | 43 |
| 44 virtual ~FrameBuffer(); |
| 45 |
| 44 // Insert a frame into the frame buffer. Returns the picture id | 46 // Insert a frame into the frame buffer. Returns the picture id |
| 45 // of the last continuous frame or -1 if there is no continuous frame. | 47 // of the last continuous frame or -1 if there is no continuous frame. |
| 46 int InsertFrame(std::unique_ptr<FrameObject> frame); | 48 int InsertFrame(std::unique_ptr<FrameObject> frame); |
| 47 | 49 |
| 48 // Get the next frame for decoding. Will return at latest after | 50 // Get the next frame for decoding. Will return at latest after |
| 49 // |max_wait_time_ms|. | 51 // |max_wait_time_ms|. |
| 50 // - If a frame is available within |max_wait_time_ms| it will return | 52 // - If a frame is available within |max_wait_time_ms| it will return |
| 51 // kFrameFound and set |frame_out| to the resulting frame. | 53 // kFrameFound and set |frame_out| to the resulting frame. |
| 52 // - If no frame is available after |max_wait_time_ms| it will return | 54 // - If no frame is available after |max_wait_time_ms| it will return |
| 53 // kTimeout. | 55 // kTimeout. |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void AdvanceLastDecodedFrame(FrameMap::iterator decoded) | 132 void AdvanceLastDecodedFrame(FrameMap::iterator decoded) |
| 131 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 133 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| 132 | 134 |
| 133 // Update the corresponding FrameInfo of |frame| and all FrameInfos that | 135 // Update the corresponding FrameInfo of |frame| and all FrameInfos that |
| 134 // |frame| references. | 136 // |frame| references. |
| 135 // Return false if |frame| will never be decodable, true otherwise. | 137 // Return false if |frame| will never be decodable, true otherwise. |
| 136 bool UpdateFrameInfoWithIncomingFrame(const FrameObject& frame, | 138 bool UpdateFrameInfoWithIncomingFrame(const FrameObject& frame, |
| 137 FrameMap::iterator info) | 139 FrameMap::iterator info) |
| 138 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 140 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| 139 | 141 |
| 142 void UpdateHistograms() const; |
| 143 |
| 140 FrameMap frames_ GUARDED_BY(crit_); | 144 FrameMap frames_ GUARDED_BY(crit_); |
| 141 | 145 |
| 142 rtc::CriticalSection crit_; | 146 rtc::CriticalSection crit_; |
| 143 Clock* const clock_; | 147 Clock* const clock_; |
| 144 rtc::Event new_countinuous_frame_event_; | 148 rtc::Event new_countinuous_frame_event_; |
| 145 VCMJitterEstimator* const jitter_estimator_ GUARDED_BY(crit_); | 149 VCMJitterEstimator* const jitter_estimator_ GUARDED_BY(crit_); |
| 146 VCMTiming* const timing_ GUARDED_BY(crit_); | 150 VCMTiming* const timing_ GUARDED_BY(crit_); |
| 147 VCMInterFrameDelay inter_frame_delay_ GUARDED_BY(crit_); | 151 VCMInterFrameDelay inter_frame_delay_ GUARDED_BY(crit_); |
| 148 FrameMap::iterator last_decoded_frame_it_ GUARDED_BY(crit_); | 152 FrameMap::iterator last_decoded_frame_it_ GUARDED_BY(crit_); |
| 149 FrameMap::iterator last_continuous_frame_it_ GUARDED_BY(crit_); | 153 FrameMap::iterator last_continuous_frame_it_ GUARDED_BY(crit_); |
| 150 int num_frames_history_ GUARDED_BY(crit_); | 154 int num_frames_history_ GUARDED_BY(crit_); |
| 151 int num_frames_buffered_ GUARDED_BY(crit_); | 155 int num_frames_buffered_ GUARDED_BY(crit_); |
| 152 bool stopped_ GUARDED_BY(crit_); | 156 bool stopped_ GUARDED_BY(crit_); |
| 153 VCMVideoProtection protection_mode_ GUARDED_BY(crit_); | 157 VCMVideoProtection protection_mode_ GUARDED_BY(crit_); |
| 158 int num_total_frames_ GUARDED_BY(crit_); |
| 159 int num_key_frames_ GUARDED_BY(crit_); |
| 154 | 160 |
| 155 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer); | 161 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FrameBuffer); |
| 156 }; | 162 }; |
| 157 | 163 |
| 158 } // namespace video_coding | 164 } // namespace video_coding |
| 159 } // namespace webrtc | 165 } // namespace webrtc |
| 160 | 166 |
| 161 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_BUFFER2_H_ | 167 #endif // WEBRTC_MODULES_VIDEO_CODING_FRAME_BUFFER2_H_ |
| OLD | NEW |