OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 uint32_t timestamp_; | 166 uint32_t timestamp_; |
167 int64_t ntp_time_ms_; | 167 int64_t ntp_time_ms_; |
168 int64_t render_time_ms_; | 168 int64_t render_time_ms_; |
169 VideoRotation rotation_; | 169 VideoRotation rotation_; |
170 }; | 170 }; |
171 | 171 |
172 | 172 |
173 // TODO(pbos): Rename EncodedFrame and reformat this class' members. | 173 // TODO(pbos): Rename EncodedFrame and reformat this class' members. |
174 class EncodedImage { | 174 class EncodedImage { |
175 public: | 175 public: |
| 176 static const size_t kBufferPaddingBytesH264; |
| 177 |
| 178 // Some decoders require encoded image buffers to be padded with a small |
| 179 // number of additional bytes (due to over-reading byte readers). |
| 180 static size_t GetBufferPaddingBytes(VideoCodecType codec_type); |
| 181 |
176 EncodedImage() : EncodedImage(nullptr, 0, 0) {} | 182 EncodedImage() : EncodedImage(nullptr, 0, 0) {} |
177 EncodedImage(uint8_t* buffer, size_t length, size_t size) | 183 EncodedImage(uint8_t* buffer, size_t length, size_t size) |
178 : _buffer(buffer), _length(length), _size(size) {} | 184 : _buffer(buffer), _length(length), _size(size) {} |
179 | 185 |
180 struct AdaptReason { | 186 struct AdaptReason { |
181 AdaptReason() | 187 AdaptReason() |
182 : quality_resolution_downscales(-1), | 188 : quality_resolution_downscales(-1), |
183 bw_resolutions_disabled(-1) {} | 189 bw_resolutions_disabled(-1) {} |
184 | 190 |
185 int quality_resolution_downscales; // Number of times this frame is down | 191 int quality_resolution_downscales; // Number of times this frame is down |
(...skipping 13 matching lines...) Expand all Loading... |
199 uint8_t* _buffer; | 205 uint8_t* _buffer; |
200 size_t _length; | 206 size_t _length; |
201 size_t _size; | 207 size_t _size; |
202 bool _completeFrame = false; | 208 bool _completeFrame = false; |
203 AdaptReason adapt_reason_; | 209 AdaptReason adapt_reason_; |
204 int qp_ = -1; // Quantizer value. | 210 int qp_ = -1; // Quantizer value. |
205 }; | 211 }; |
206 | 212 |
207 } // namespace webrtc | 213 } // namespace webrtc |
208 #endif // WEBRTC_VIDEO_FRAME_H_ | 214 #endif // WEBRTC_VIDEO_FRAME_H_ |
OLD | NEW |