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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 Clock* const clock_; | 92 Clock* const clock_; |
93 | 93 |
94 // Tries to expand the buffer. | 94 // Tries to expand the buffer. |
95 bool ExpandBufferSize() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 95 bool ExpandBufferSize() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
96 | 96 |
97 // Test if all previous packets has arrived for the given sequence number. | 97 // Test if all previous packets has arrived for the given sequence number. |
98 bool PotentialNewFrame(uint16_t seq_num) const | 98 bool PotentialNewFrame(uint16_t seq_num) const |
99 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 99 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
100 | 100 |
101 // Test if all packets of a frame has arrived, and if so, creates a frame. | 101 // Test if all packets of a frame has arrived, and if so, creates a frame. |
102 // May create multiple frames per invocation. | 102 // Return a vector received frames. |
stefan-webrtc
2016/11/14 12:00:26
Returns a vector of received frames
philipel
2016/11/14 15:31:03
Done.
| |
103 void FindFrames(uint16_t seq_num) EXCLUSIVE_LOCKS_REQUIRED(crit_); | 103 std::vector<std::unique_ptr<RtpFrameObject>> FindFrames(uint16_t seq_num) |
104 EXCLUSIVE_LOCKS_REQUIRED(crit_); | |
104 | 105 |
105 // Copy the bitstream for |frame| to |destination|. | 106 // Copy the bitstream for |frame| to |destination|. |
106 // Virtual for testing. | 107 // Virtual for testing. |
107 virtual bool GetBitstream(const RtpFrameObject& frame, uint8_t* destination); | 108 virtual bool GetBitstream(const RtpFrameObject& frame, uint8_t* destination); |
108 | 109 |
109 // Get the packet with sequence number |seq_num|. | 110 // Get the packet with sequence number |seq_num|. |
110 // Virtual for testing. | 111 // Virtual for testing. |
111 virtual VCMPacket* GetPacket(uint16_t seq_num); | 112 virtual VCMPacket* GetPacket(uint16_t seq_num) |
113 EXCLUSIVE_LOCKS_REQUIRED(crit_); | |
112 | 114 |
113 // Mark all slots used by |frame| as not used. | 115 // Mark all slots used by |frame| as not used. |
114 // Virtual for testing. | 116 // Virtual for testing. |
115 virtual void ReturnFrame(RtpFrameObject* frame); | 117 virtual void ReturnFrame(RtpFrameObject* frame); |
116 | 118 |
117 rtc::CriticalSection crit_; | 119 rtc::CriticalSection crit_; |
118 | 120 |
119 // Buffer size_ and max_size_ must always be a power of two. | 121 // Buffer size_ and max_size_ must always be a power of two. |
120 size_t size_ GUARDED_BY(crit_); | 122 size_t size_ GUARDED_BY(crit_); |
121 const size_t max_size_; | 123 const size_t max_size_; |
(...skipping 20 matching lines...) Expand all Loading... | |
142 // Called when a received frame is found. | 144 // Called when a received frame is found. |
143 OnReceivedFrameCallback* const received_frame_callback_; | 145 OnReceivedFrameCallback* const received_frame_callback_; |
144 | 146 |
145 mutable volatile int ref_count_ = 0; | 147 mutable volatile int ref_count_ = 0; |
146 }; | 148 }; |
147 | 149 |
148 } // namespace video_coding | 150 } // namespace video_coding |
149 } // namespace webrtc | 151 } // namespace webrtc |
150 | 152 |
151 #endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_BUFFER_H_ | 153 #endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_BUFFER_H_ |
OLD | NEW |