| 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 |
| 11 #ifndef WEBRTC_VIDEO_FRAME_H_ | 11 #ifndef WEBRTC_VIDEO_FRAME_H_ |
| 12 #define WEBRTC_VIDEO_FRAME_H_ | 12 #define WEBRTC_VIDEO_FRAME_H_ |
| 13 | 13 |
| 14 #include "webrtc/base/scoped_ref_ptr.h" | 14 #include "webrtc/base/scoped_ref_ptr.h" |
| 15 #include "webrtc/common_types.h" |
| 15 #include "webrtc/common_video/interface/video_frame_buffer.h" | 16 #include "webrtc/common_video/interface/video_frame_buffer.h" |
| 16 #include "webrtc/common_video/rotation.h" | 17 #include "webrtc/common_video/rotation.h" |
| 17 #include "webrtc/typedefs.h" | 18 #include "webrtc/typedefs.h" |
| 18 | 19 |
| 19 namespace webrtc { | 20 namespace webrtc { |
| 20 | 21 |
| 21 class VideoFrame { | 22 class VideoFrame { |
| 22 public: | 23 public: |
| 23 VideoFrame(); | 24 VideoFrame(); |
| 24 VideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, | 25 VideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 160 |
| 160 private: | 161 private: |
| 161 // An opaque reference counted handle that stores the pixel data. | 162 // An opaque reference counted handle that stores the pixel data. |
| 162 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; | 163 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; |
| 163 uint32_t timestamp_; | 164 uint32_t timestamp_; |
| 164 int64_t ntp_time_ms_; | 165 int64_t ntp_time_ms_; |
| 165 int64_t render_time_ms_; | 166 int64_t render_time_ms_; |
| 166 VideoRotation rotation_; | 167 VideoRotation rotation_; |
| 167 }; | 168 }; |
| 168 | 169 |
| 169 enum VideoFrameType { | |
| 170 kKeyFrame = 0, | |
| 171 kDeltaFrame = 1, | |
| 172 }; | |
| 173 | |
| 174 // TODO(pbos): Rename EncodedFrame and reformat this class' members. | 170 // TODO(pbos): Rename EncodedFrame and reformat this class' members. |
| 175 class EncodedImage { | 171 class EncodedImage { |
| 176 public: | 172 public: |
| 177 EncodedImage() : EncodedImage(nullptr, 0, 0) {} | 173 EncodedImage() : EncodedImage(nullptr, 0, 0) {} |
| 178 EncodedImage(uint8_t* buffer, size_t length, size_t size) | 174 EncodedImage(uint8_t* buffer, size_t length, size_t size) |
| 179 : _buffer(buffer), _length(length), _size(size) {} | 175 : _buffer(buffer), _length(length), _size(size) {} |
| 180 | 176 |
| 181 uint32_t _encodedWidth = 0; | 177 uint32_t _encodedWidth = 0; |
| 182 uint32_t _encodedHeight = 0; | 178 uint32_t _encodedHeight = 0; |
| 183 uint32_t _timeStamp = 0; | 179 uint32_t _timeStamp = 0; |
| 184 // NTP time of the capture time in local timebase in milliseconds. | 180 // NTP time of the capture time in local timebase in milliseconds. |
| 185 int64_t ntp_time_ms_ = 0; | 181 int64_t ntp_time_ms_ = 0; |
| 186 int64_t capture_time_ms_ = 0; | 182 int64_t capture_time_ms_ = 0; |
| 187 // TODO(pbos): Use webrtc::FrameType directly (and remove VideoFrameType). | 183 FrameType _frameType = kDeltaFrame; |
| 188 VideoFrameType _frameType = kDeltaFrame; | |
| 189 uint8_t* _buffer; | 184 uint8_t* _buffer; |
| 190 size_t _length; | 185 size_t _length; |
| 191 size_t _size; | 186 size_t _size; |
| 192 bool _completeFrame = false; | 187 bool _completeFrame = false; |
| 193 }; | 188 }; |
| 194 | 189 |
| 195 } // namespace webrtc | 190 } // namespace webrtc |
| 196 #endif // WEBRTC_VIDEO_FRAME_H_ | 191 #endif // WEBRTC_VIDEO_FRAME_H_ |
| OLD | NEW |