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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 kDeltaFrame = 1, | 171 kDeltaFrame = 1, |
172 }; | 172 }; |
173 | 173 |
174 // TODO(pbos): Rename EncodedFrame and reformat this class' members. | 174 // TODO(pbos): Rename EncodedFrame and reformat this class' members. |
175 class EncodedImage { | 175 class EncodedImage { |
176 public: | 176 public: |
177 EncodedImage() : EncodedImage(nullptr, 0, 0) {} | 177 EncodedImage() : EncodedImage(nullptr, 0, 0) {} |
178 EncodedImage(uint8_t* buffer, size_t length, size_t size) | 178 EncodedImage(uint8_t* buffer, size_t length, size_t size) |
179 : _buffer(buffer), _length(length), _size(size) {} | 179 : _buffer(buffer), _length(length), _size(size) {} |
180 | 180 |
| 181 struct AdaptReason { |
| 182 AdaptReason() |
| 183 : quality_resolution_downscales(-1) {} |
| 184 |
| 185 int quality_resolution_downscales; // Number of times this frame is down |
| 186 // scaled in resolution due to quality. |
| 187 // Or -1 if information is not provided. |
| 188 }; |
181 uint32_t _encodedWidth = 0; | 189 uint32_t _encodedWidth = 0; |
182 uint32_t _encodedHeight = 0; | 190 uint32_t _encodedHeight = 0; |
183 uint32_t _timeStamp = 0; | 191 uint32_t _timeStamp = 0; |
184 // NTP time of the capture time in local timebase in milliseconds. | 192 // NTP time of the capture time in local timebase in milliseconds. |
185 int64_t ntp_time_ms_ = 0; | 193 int64_t ntp_time_ms_ = 0; |
186 int64_t capture_time_ms_ = 0; | 194 int64_t capture_time_ms_ = 0; |
187 // TODO(pbos): Use webrtc::FrameType directly (and remove VideoFrameType). | 195 // TODO(pbos): Use webrtc::FrameType directly (and remove VideoFrameType). |
188 VideoFrameType _frameType = kDeltaFrame; | 196 VideoFrameType _frameType = kDeltaFrame; |
189 uint8_t* _buffer; | 197 uint8_t* _buffer; |
190 size_t _length; | 198 size_t _length; |
191 size_t _size; | 199 size_t _size; |
192 bool _completeFrame = false; | 200 bool _completeFrame = false; |
| 201 AdaptReason adapt_reason_; |
193 }; | 202 }; |
194 | 203 |
195 } // namespace webrtc | 204 } // namespace webrtc |
196 #endif // WEBRTC_VIDEO_FRAME_H_ | 205 #endif // WEBRTC_VIDEO_FRAME_H_ |
OLD | NEW |