| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 // Some decoders require encoded image buffers to be padded with a small | 143 // Some decoders require encoded image buffers to be padded with a small |
| 144 // number of additional bytes (due to over-reading byte readers). | 144 // number of additional bytes (due to over-reading byte readers). |
| 145 static size_t GetBufferPaddingBytes(VideoCodecType codec_type); | 145 static size_t GetBufferPaddingBytes(VideoCodecType codec_type); |
| 146 | 146 |
| 147 EncodedImage() : EncodedImage(nullptr, 0, 0) {} | 147 EncodedImage() : EncodedImage(nullptr, 0, 0) {} |
| 148 | 148 |
| 149 EncodedImage(uint8_t* buffer, size_t length, size_t size) | 149 EncodedImage(uint8_t* buffer, size_t length, size_t size) |
| 150 : _buffer(buffer), _length(length), _size(size) {} | 150 : _buffer(buffer), _length(length), _size(size) {} |
| 151 | 151 |
| 152 // TODO(kthelgason): get rid of this struct as it only has a single member |
| 153 // remaining. |
| 152 struct AdaptReason { | 154 struct AdaptReason { |
| 153 AdaptReason() | 155 AdaptReason() : bw_resolutions_disabled(-1) {} |
| 154 : quality_resolution_downscales(-1), | |
| 155 bw_resolutions_disabled(-1) {} | |
| 156 | |
| 157 int quality_resolution_downscales; // Number of times this frame is down | |
| 158 // scaled in resolution due to quality. | |
| 159 // Or -1 if information is not provided. | |
| 160 int bw_resolutions_disabled; // Number of resolutions that are not sent | 156 int bw_resolutions_disabled; // Number of resolutions that are not sent |
| 161 // due to bandwidth for this frame. | 157 // due to bandwidth for this frame. |
| 162 // Or -1 if information is not provided. | 158 // Or -1 if information is not provided. |
| 163 }; | 159 }; |
| 164 uint32_t _encodedWidth = 0; | 160 uint32_t _encodedWidth = 0; |
| 165 uint32_t _encodedHeight = 0; | 161 uint32_t _encodedHeight = 0; |
| 166 uint32_t _timeStamp = 0; | 162 uint32_t _timeStamp = 0; |
| 167 // NTP time of the capture time in local timebase in milliseconds. | 163 // NTP time of the capture time in local timebase in milliseconds. |
| 168 int64_t ntp_time_ms_ = 0; | 164 int64_t ntp_time_ms_ = 0; |
| 169 int64_t capture_time_ms_ = 0; | 165 int64_t capture_time_ms_ = 0; |
| 170 FrameType _frameType = kVideoFrameDelta; | 166 FrameType _frameType = kVideoFrameDelta; |
| 171 uint8_t* _buffer; | 167 uint8_t* _buffer; |
| 172 size_t _length; | 168 size_t _length; |
| 173 size_t _size; | 169 size_t _size; |
| 174 VideoRotation rotation_ = kVideoRotation_0; | 170 VideoRotation rotation_ = kVideoRotation_0; |
| 175 bool _completeFrame = false; | 171 bool _completeFrame = false; |
| 176 AdaptReason adapt_reason_; | 172 AdaptReason adapt_reason_; |
| 177 int qp_ = -1; // Quantizer value. | 173 int qp_ = -1; // Quantizer value. |
| 178 | 174 |
| 179 // When an application indicates non-zero values here, it is taken as an | 175 // When an application indicates non-zero values here, it is taken as an |
| 180 // indication that all future frames will be constrained with those limits | 176 // indication that all future frames will be constrained with those limits |
| 181 // until the application indicates a change again. | 177 // until the application indicates a change again. |
| 182 PlayoutDelay playout_delay_ = {-1, -1}; | 178 PlayoutDelay playout_delay_ = {-1, -1}; |
| 183 }; | 179 }; |
| 184 | 180 |
| 185 } // namespace webrtc | 181 } // namespace webrtc |
| 186 #endif // WEBRTC_VIDEO_FRAME_H_ | 182 #endif // WEBRTC_VIDEO_FRAME_H_ |
| OLD | NEW |