OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 11 #ifndef WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
12 #define WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 12 #define WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
13 | 13 |
14 #include <stdint.h> | 14 #include <stdint.h> |
15 | 15 |
16 #include <memory> | 16 #include <memory> |
17 | 17 |
18 #include "webrtc/base/callback.h" | 18 #include "webrtc/base/callback.h" |
19 #include "webrtc/base/refcount.h" | 19 #include "webrtc/base/refcount.h" |
20 #include "webrtc/base/scoped_ref_ptr.h" | 20 #include "webrtc/base/scoped_ref_ptr.h" |
21 #include "webrtc/common_video/rotation.h" | |
21 #include "webrtc/system_wrappers/include/aligned_malloc.h" | 22 #include "webrtc/system_wrappers/include/aligned_malloc.h" |
22 | 23 |
23 namespace webrtc { | 24 namespace webrtc { |
24 | 25 |
25 enum PlaneType { | 26 enum PlaneType { |
26 kYPlane = 0, | 27 kYPlane = 0, |
27 kUPlane = 1, | 28 kUPlane = 1, |
28 kVPlane = 2, | 29 kVPlane = 2, |
29 kNumOfPlanes = 3, | 30 kNumOfPlanes = 3, |
30 }; | 31 }; |
(...skipping 25 matching lines...) Expand all Loading... | |
56 virtual int StrideV() const = 0; | 57 virtual int StrideV() const = 0; |
57 | 58 |
58 // Return the handle of the underlying video frame. This is used when the | 59 // Return the handle of the underlying video frame. This is used when the |
59 // frame is backed by a texture. | 60 // frame is backed by a texture. |
60 virtual void* native_handle() const = 0; | 61 virtual void* native_handle() const = 0; |
61 | 62 |
62 // Returns a new memory-backed frame buffer converted from this buffer's | 63 // Returns a new memory-backed frame buffer converted from this buffer's |
63 // native handle. | 64 // native handle. |
64 virtual rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() = 0; | 65 virtual rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() = 0; |
65 | 66 |
67 static rtc::scoped_refptr<VideoFrameBuffer> Rotate( | |
perkj_webrtc
2016/08/26 15:22:17
I think I would prefer this to be a virtual member
nisse-webrtc
2016/08/29 09:16:50
Makes sense to me. (magjed suggested using a stati
magjed_webrtc
2016/08/30 08:11:33
Please don't add unnecessary functions to the inte
| |
68 const rtc::scoped_refptr<VideoFrameBuffer>& src, | |
69 VideoRotation rotation); | |
70 | |
66 protected: | 71 protected: |
67 virtual ~VideoFrameBuffer(); | 72 virtual ~VideoFrameBuffer(); |
68 }; | 73 }; |
69 | 74 |
70 // Plain I420 buffer in standard memory. | 75 // Plain I420 buffer in standard memory. |
71 class I420Buffer : public VideoFrameBuffer { | 76 class I420Buffer : public VideoFrameBuffer { |
72 public: | 77 public: |
73 I420Buffer(int width, int height); | 78 I420Buffer(int width, int height); |
74 I420Buffer(int width, int height, int stride_y, int stride_u, int stride_v); | 79 I420Buffer(int width, int height, int stride_y, int stride_u, int stride_v); |
75 | 80 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 const uint8_t* const v_plane_; | 208 const uint8_t* const v_plane_; |
204 const int y_stride_; | 209 const int y_stride_; |
205 const int u_stride_; | 210 const int u_stride_; |
206 const int v_stride_; | 211 const int v_stride_; |
207 rtc::Callback0<void> no_longer_used_cb_; | 212 rtc::Callback0<void> no_longer_used_cb_; |
208 }; | 213 }; |
209 | 214 |
210 } // namespace webrtc | 215 } // namespace webrtc |
211 | 216 |
212 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 217 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
OLD | NEW |