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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 // TODO(pbos): Rename EncodedFrame and reformat this class' members. | 154 // TODO(pbos): Rename EncodedFrame and reformat this class' members. |
155 class EncodedImage { | 155 class EncodedImage { |
156 public: | 156 public: |
157 static const size_t kBufferPaddingBytesH264; | 157 static const size_t kBufferPaddingBytesH264; |
158 | 158 |
159 // Some decoders require encoded image buffers to be padded with a small | 159 // Some decoders require encoded image buffers to be padded with a small |
160 // number of additional bytes (due to over-reading byte readers). | 160 // number of additional bytes (due to over-reading byte readers). |
161 static size_t GetBufferPaddingBytes(VideoCodecType codec_type); | 161 static size_t GetBufferPaddingBytes(VideoCodecType codec_type); |
162 | 162 |
163 EncodedImage() : EncodedImage(nullptr, 0, 0) {} | 163 EncodedImage() : EncodedImage(nullptr, 0, 0) {} |
| 164 |
164 EncodedImage(uint8_t* buffer, size_t length, size_t size) | 165 EncodedImage(uint8_t* buffer, size_t length, size_t size) |
165 : _buffer(buffer), _length(length), _size(size) {} | 166 : _buffer(buffer), _length(length), _size(size) {} |
166 | 167 |
167 struct AdaptReason { | 168 struct AdaptReason { |
168 AdaptReason() | 169 AdaptReason() |
169 : quality_resolution_downscales(-1), | 170 : quality_resolution_downscales(-1), |
170 bw_resolutions_disabled(-1) {} | 171 bw_resolutions_disabled(-1) {} |
171 | 172 |
172 int quality_resolution_downscales; // Number of times this frame is down | 173 int quality_resolution_downscales; // Number of times this frame is down |
173 // scaled in resolution due to quality. | 174 // scaled in resolution due to quality. |
174 // Or -1 if information is not provided. | 175 // Or -1 if information is not provided. |
175 int bw_resolutions_disabled; // Number of resolutions that are not sent | 176 int bw_resolutions_disabled; // Number of resolutions that are not sent |
176 // due to bandwidth for this frame. | 177 // due to bandwidth for this frame. |
177 // Or -1 if information is not provided. | 178 // Or -1 if information is not provided. |
178 }; | 179 }; |
179 uint32_t _encodedWidth = 0; | 180 uint32_t _encodedWidth = 0; |
180 uint32_t _encodedHeight = 0; | 181 uint32_t _encodedHeight = 0; |
181 uint32_t _timeStamp = 0; | 182 uint32_t _timeStamp = 0; |
182 // NTP time of the capture time in local timebase in milliseconds. | 183 // NTP time of the capture time in local timebase in milliseconds. |
183 int64_t ntp_time_ms_ = 0; | 184 int64_t ntp_time_ms_ = 0; |
184 int64_t capture_time_ms_ = 0; | 185 int64_t capture_time_ms_ = 0; |
185 FrameType _frameType = kVideoFrameDelta; | 186 FrameType _frameType = kVideoFrameDelta; |
186 uint8_t* _buffer; | 187 uint8_t* _buffer; |
187 size_t _length; | 188 size_t _length; |
188 size_t _size; | 189 size_t _size; |
| 190 VideoRotation rotation_ = kVideoRotation_0; |
189 bool _completeFrame = false; | 191 bool _completeFrame = false; |
190 AdaptReason adapt_reason_; | 192 AdaptReason adapt_reason_; |
191 int qp_ = -1; // Quantizer value. | 193 int qp_ = -1; // Quantizer value. |
192 }; | 194 }; |
193 | 195 |
194 } // namespace webrtc | 196 } // namespace webrtc |
195 #endif // WEBRTC_VIDEO_FRAME_H_ | 197 #endif // WEBRTC_VIDEO_FRAME_H_ |
OLD | NEW |