Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1288)

Side by Side Diff: webrtc/modules/video_coding/packet_buffer.h

Issue 2480293002: New jitter buffer experiment. (Closed)
Patch Set: Feedback Fixes. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // May create multiple frames per invocation.
103 void FindFrames(uint16_t seq_num) EXCLUSIVE_LOCKS_REQUIRED(crit_); 103 void FindFrames(uint16_t seq_num);
104 104
105 // Copy the bitstream for |frame| to |destination|. 105 // Copy the bitstream for |frame| to |destination|.
106 // Virtual for testing. 106 // Virtual for testing.
107 virtual bool GetBitstream(const RtpFrameObject& frame, uint8_t* destination); 107 virtual bool GetBitstream(const RtpFrameObject& frame, uint8_t* destination);
108 108
109 // Get the packet with sequence number |seq_num|. 109 // Get the packet with sequence number |seq_num|.
110 // Virtual for testing. 110 // Virtual for testing.
111 virtual VCMPacket* GetPacket(uint16_t seq_num); 111 virtual VCMPacket* GetPacket(uint16_t seq_num)
112 EXCLUSIVE_LOCKS_REQUIRED(crit_);
112 113
113 // Mark all slots used by |frame| as not used. 114 // Mark all slots used by |frame| as not used.
114 // Virtual for testing. 115 // Virtual for testing.
115 virtual void ReturnFrame(RtpFrameObject* frame); 116 virtual void ReturnFrame(RtpFrameObject* frame);
116 117
117 rtc::CriticalSection crit_; 118 rtc::CriticalSection crit_;
118 119
119 // Buffer size_ and max_size_ must always be a power of two. 120 // Buffer size_ and max_size_ must always be a power of two.
120 size_t size_ GUARDED_BY(crit_); 121 size_t size_ GUARDED_BY(crit_);
121 const size_t max_size_; 122 const size_t max_size_;
(...skipping 20 matching lines...) Expand all
142 // Called when a received frame is found. 143 // Called when a received frame is found.
143 OnReceivedFrameCallback* const received_frame_callback_; 144 OnReceivedFrameCallback* const received_frame_callback_;
144 145
145 mutable volatile int ref_count_ = 0; 146 mutable volatile int ref_count_ = 0;
146 }; 147 };
147 148
148 } // namespace video_coding 149 } // namespace video_coding
149 } // namespace webrtc 150 } // namespace webrtc
150 151
151 #endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_BUFFER_H_ 152 #endif // WEBRTC_MODULES_VIDEO_CODING_PACKET_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698