Chromium Code Reviews| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 87 // If this packet has been used to create a frame already. | 87 // If this packet has been used to create a frame already. |
| 88 bool frame_created = false; | 88 bool frame_created = false; |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 Clock* const clock_; | 91 Clock* const clock_; |
| 92 | 92 |
| 93 // Tries to expand the buffer. | 93 // Tries to expand the buffer. |
| 94 bool ExpandBufferSize() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 94 bool ExpandBufferSize() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| 95 | 95 |
| 96 // Test if all previous packets has arrived for the given sequence number. | 96 // Test if all previous packets has arrived for the given sequence number. |
| 97 bool IsContinuous(uint16_t seq_num) const EXCLUSIVE_LOCKS_REQUIRED(crit_); | 97 bool PotentialNewFrame(uint16_t seq_num) const |
| 98 EXCLUSIVE_LOCKS_REQUIRED(crit_); | |
| 98 | 99 |
| 99 // Test if all packets of a frame has arrived, and if so, creates a frame. | 100 // Test if all packets of a frame has arrived, and if so, creates a frame. |
| 100 // May create multiple frames per invocation. | 101 // May create multiple frames per invocation. |
| 101 void FindFrames(uint16_t seq_num) EXCLUSIVE_LOCKS_REQUIRED(crit_); | 102 void FindFrames(uint16_t seq_num) EXCLUSIVE_LOCKS_REQUIRED(crit_); |
| 102 | 103 |
| 103 // Copy the bitstream for |frame| to |destination|. | 104 // Copy the bitstream for |frame| to |destination|. |
| 104 // Virtual for testing. | 105 // Virtual for testing. |
| 105 virtual bool GetBitstream(const RtpFrameObject& frame, uint8_t* destination); | 106 virtual bool GetBitstream(const RtpFrameObject& frame, uint8_t* destination); |
| 106 | 107 |
| 107 // Get the packet with sequence number |seq_num|. | 108 // Get the packet with sequence number |seq_num|. |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 120 | 121 |
| 121 // The fist sequence number currently in the buffer. | 122 // The fist sequence number currently in the buffer. |
| 122 uint16_t first_seq_num_ GUARDED_BY(crit_); | 123 uint16_t first_seq_num_ GUARDED_BY(crit_); |
| 123 | 124 |
| 124 // The last sequence number currently in the buffer. | 125 // The last sequence number currently in the buffer. |
| 125 uint16_t last_seq_num_ GUARDED_BY(crit_); | 126 uint16_t last_seq_num_ GUARDED_BY(crit_); |
| 126 | 127 |
| 127 // If the packet buffer has received its first packet. | 128 // If the packet buffer has received its first packet. |
| 128 bool first_packet_received_ GUARDED_BY(crit_); | 129 bool first_packet_received_ GUARDED_BY(crit_); |
| 129 | 130 |
| 131 // If the buffer is cleared to a specific packet. | |
| 132 bool has_cleared_to_ GUARDED_BY(crit_); | |
|
stefan-webrtc
2016/10/18 17:57:23
I have a hard time understanding this member. What
philipel
2016/10/19 08:34:54
This variable is set to true when ClearTo() has be
danilchap
2016/10/19 09:25:10
may be name it something like
is_cleared_before_fi
| |
| 133 | |
| 130 // Buffer that holds the inserted packets. | 134 // Buffer that holds the inserted packets. |
| 131 std::vector<VCMPacket> data_buffer_ GUARDED_BY(crit_); | 135 std::vector<VCMPacket> data_buffer_ GUARDED_BY(crit_); |
| 132 | 136 |
| 133 // Buffer that holds the information about which slot that is currently in use | 137 // Buffer that holds the information about which slot that is currently in use |
| 134 // and information needed to determine the continuity between packets. | 138 // and information needed to determine the continuity between packets. |
| 135 std::vector<ContinuityInfo> sequence_buffer_ GUARDED_BY(crit_); | 139 std::vector<ContinuityInfo> sequence_buffer_ GUARDED_BY(crit_); |
| 136 | 140 |
| 137 // Called when a received frame is found. | 141 // Called when a received frame is found. |
| 138 OnReceivedFrameCallback* const received_frame_callback_; | 142 OnReceivedFrameCallback* const received_frame_callback_; |
| 139 | 143 |
| 140 mutable volatile int ref_count_ = 0; | 144 mutable volatile int ref_count_ = 0; |
| 141 }; | 145 }; |
| 142 | 146 |
| 143 } // namespace video_coding | 147 } // namespace video_coding |
| 144 } // namespace webrtc | 148 } // namespace webrtc |
| 145 | 149 |
| 146 #endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_BUFFER_H_ | 150 #endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_BUFFER_H_ |
| OLD | NEW |