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_video/interface/video_frame_buffer.h" | 15 #include "webrtc/common_video/interface/video_frame_buffer.h" |
16 #include "webrtc/common_video/rotation.h" | 16 #include "webrtc/common_video/rotation.h" |
17 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
18 | 18 |
19 namespace webrtc { | 19 namespace webrtc { |
20 | 20 |
21 class VideoFrame { | 21 class VideoFrame { |
22 public: | 22 public: |
23 VideoFrame(); | 23 VideoFrame(); |
24 VideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, | 24 VideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, |
25 uint32_t timestamp, | 25 uint32_t timestamp, |
26 int64_t render_time_ms, | 26 int64_t render_time_ms, |
27 VideoRotation rotation); | 27 VideoRotation rotation); |
28 | 28 |
29 // TODO(pbos): Make all create/copy functions void, they should not be able to | 29 // TODO(pbos): Make all create/copy functions void, they should not be able to |
30 // fail (which should be DCHECK/CHECKed instead). | 30 // fail (which should be RTC_DCHECK/CHECKed instead). |
31 | 31 |
32 // CreateEmptyFrame: Sets frame dimensions and allocates buffers based | 32 // CreateEmptyFrame: Sets frame dimensions and allocates buffers based |
33 // on set dimensions - height and plane stride. | 33 // on set dimensions - height and plane stride. |
34 // If required size is bigger than the allocated one, new buffers of adequate | 34 // If required size is bigger than the allocated one, new buffers of adequate |
35 // size will be allocated. | 35 // size will be allocated. |
36 // Return value: 0 on success, -1 on error. | 36 // Return value: 0 on success, -1 on error. |
37 int CreateEmptyFrame(int width, | 37 int CreateEmptyFrame(int width, |
38 int height, | 38 int height, |
39 int stride_y, | 39 int stride_y, |
40 int stride_u, | 40 int stride_u, |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // TODO(pbos): Use webrtc::FrameType directly (and remove VideoFrameType). | 190 // TODO(pbos): Use webrtc::FrameType directly (and remove VideoFrameType). |
191 VideoFrameType _frameType = kDeltaFrame; | 191 VideoFrameType _frameType = kDeltaFrame; |
192 uint8_t* _buffer; | 192 uint8_t* _buffer; |
193 size_t _length; | 193 size_t _length; |
194 size_t _size; | 194 size_t _size; |
195 bool _completeFrame = false; | 195 bool _completeFrame = false; |
196 }; | 196 }; |
197 | 197 |
198 } // namespace webrtc | 198 } // namespace webrtc |
199 #endif // WEBRTC_VIDEO_FRAME_H_ | 199 #endif // WEBRTC_VIDEO_FRAME_H_ |
OLD | NEW |