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

Side by Side Diff: webrtc/modules/video_coding/frame_buffer.cc

Issue 2007743003: Add sender controlled playout delay limits (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@cleanup_rtp_hdr_extensions
Patch Set: Rename OnReceivedRtcpReport to OnReceivedRtcpReportBlocks Created 4 years, 6 months 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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 _sessionInfo.UpdateDataPointers(prevBuffer, _buffer); 122 _sessionInfo.UpdateDataPointers(prevBuffer, _buffer);
123 } 123 }
124 124
125 if (packet.width > 0 && packet.height > 0) { 125 if (packet.width > 0 && packet.height > 0) {
126 _encodedWidth = packet.width; 126 _encodedWidth = packet.width;
127 _encodedHeight = packet.height; 127 _encodedHeight = packet.height;
128 } 128 }
129 129
130 // Don't copy payload specific data for empty packets (e.g padding packets). 130 // Don't copy payload specific data for empty packets (e.g padding packets).
131 if (packet.sizeBytes > 0) 131 if (packet.sizeBytes > 0)
132 CopyCodecSpecific(&packet.codecSpecificHeader); 132 CopyCodecSpecific(&packet.video_header);
133 133
134 int retVal = 134 int retVal =
135 _sessionInfo.InsertPacket(packet, _buffer, decode_error_mode, frame_data); 135 _sessionInfo.InsertPacket(packet, _buffer, decode_error_mode, frame_data);
136 if (retVal == -1) { 136 if (retVal == -1) {
137 return kSizeError; 137 return kSizeError;
138 } else if (retVal == -2) { 138 } else if (retVal == -2) {
139 return kDuplicatePacket; 139 return kDuplicatePacket;
140 } else if (retVal == -3) { 140 } else if (retVal == -3) {
141 return kOutOfBoundsPacket; 141 return kOutOfBoundsPacket;
142 } 142 }
143 // update length 143 // update length
144 _length = Length() + static_cast<uint32_t>(retVal); 144 _length = Length() + static_cast<uint32_t>(retVal);
145 145
146 _latestPacketTimeMs = timeInMs; 146 _latestPacketTimeMs = timeInMs;
147 147
148 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/ 148 // http://www.etsi.org/deliver/etsi_ts/126100_126199/126114/12.07.00_60/
149 // ts_126114v120700p.pdf Section 7.4.5. 149 // ts_126114v120700p.pdf Section 7.4.5.
150 // The MTSI client shall add the payload bytes as defined in this clause 150 // The MTSI client shall add the payload bytes as defined in this clause
151 // onto the last RTP packet in each group of packets which make up a key 151 // onto the last RTP packet in each group of packets which make up a key
152 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265 152 // frame (I-frame or IDR frame in H.264 (AVC), or an IRAP picture in H.265
153 // (HEVC)). 153 // (HEVC)).
154 if (packet.markerBit) { 154 if (packet.markerBit) {
155 RTC_DCHECK(!_rotation_set); 155 RTC_DCHECK(!_rotation_set);
156 _rotation = packet.codecSpecificHeader.rotation; 156 _rotation = packet.video_header.rotation;
157 _rotation_set = true; 157 _rotation_set = true;
158 } 158 }
159 159
160 if (packet.isFirstPacket) {
161 playout_delay_ = packet.video_header.playout_delay;
162 }
163
160 if (_sessionInfo.complete()) { 164 if (_sessionInfo.complete()) {
161 SetState(kStateComplete); 165 SetState(kStateComplete);
162 return kCompleteSession; 166 return kCompleteSession;
163 } else if (_sessionInfo.decodable()) { 167 } else if (_sessionInfo.decodable()) {
164 SetState(kStateDecodable); 168 SetState(kStateDecodable);
165 return kDecodableSession; 169 return kDecodableSession;
166 } 170 }
167 return kIncomplete; 171 return kIncomplete;
168 } 172 }
169 173
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 _length -= bytes_removed; 266 _length -= bytes_removed;
263 #endif 267 #endif
264 // Transfer frame information to EncodedFrame and create any codec 268 // Transfer frame information to EncodedFrame and create any codec
265 // specific information. 269 // specific information.
266 _frameType = _sessionInfo.FrameType(); 270 _frameType = _sessionInfo.FrameType();
267 _completeFrame = _sessionInfo.complete(); 271 _completeFrame = _sessionInfo.complete();
268 _missingFrame = !continuous; 272 _missingFrame = !continuous;
269 } 273 }
270 274
271 } // namespace webrtc 275 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698