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 |
(...skipping 27 matching lines...) Expand all Loading... |
38 // subsampled, this is the highest-resolution plane. | 38 // subsampled, this is the highest-resolution plane. |
39 virtual int width() const = 0; | 39 virtual int width() const = 0; |
40 virtual int height() const = 0; | 40 virtual int height() const = 0; |
41 | 41 |
42 // Returns pointer to the pixel data for a given plane. The memory is owned by | 42 // Returns pointer to the pixel data for a given plane. The memory is owned by |
43 // the VideoFrameBuffer object and must not be freed by the caller. | 43 // the VideoFrameBuffer object and must not be freed by the caller. |
44 virtual const uint8_t* DataY() const = 0; | 44 virtual const uint8_t* DataY() const = 0; |
45 virtual const uint8_t* DataU() const = 0; | 45 virtual const uint8_t* DataU() const = 0; |
46 virtual const uint8_t* DataV() const = 0; | 46 virtual const uint8_t* DataV() const = 0; |
47 | 47 |
| 48 // TODO(nisse): Move MutableData methods to the I420Buffer subclass. |
| 49 // Non-const data access. |
| 50 virtual uint8_t* MutableDataY(); |
| 51 virtual uint8_t* MutableDataU(); |
| 52 virtual uint8_t* MutableDataV(); |
| 53 |
48 // Returns the number of bytes between successive rows for a given plane. | 54 // Returns the number of bytes between successive rows for a given plane. |
49 virtual int StrideY() const = 0; | 55 virtual int StrideY() const = 0; |
50 virtual int StrideU() const = 0; | 56 virtual int StrideU() const = 0; |
51 virtual int StrideV() const = 0; | 57 virtual int StrideV() const = 0; |
52 | 58 |
53 // 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 |
54 // frame is backed by a texture. | 60 // frame is backed by a texture. |
55 virtual void* native_handle() const = 0; | 61 virtual void* native_handle() const = 0; |
56 | 62 |
57 // 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 |
(...skipping 27 matching lines...) Expand all Loading... |
85 | 91 |
86 // Sets the frame buffer to all black. | 92 // Sets the frame buffer to all black. |
87 void SetToBlack(); | 93 void SetToBlack(); |
88 | 94 |
89 int width() const override; | 95 int width() const override; |
90 int height() const override; | 96 int height() const override; |
91 const uint8_t* DataY() const override; | 97 const uint8_t* DataY() const override; |
92 const uint8_t* DataU() const override; | 98 const uint8_t* DataU() const override; |
93 const uint8_t* DataV() const override; | 99 const uint8_t* DataV() const override; |
94 | 100 |
95 uint8_t* MutableDataY(); | 101 uint8_t* MutableDataY() override; |
96 uint8_t* MutableDataU(); | 102 uint8_t* MutableDataU() override; |
97 uint8_t* MutableDataV(); | 103 uint8_t* MutableDataV() override; |
98 int StrideY() const override; | 104 int StrideY() const override; |
99 int StrideU() const override; | 105 int StrideU() const override; |
100 int StrideV() const override; | 106 int StrideV() const override; |
101 | 107 |
102 void* native_handle() const override; | 108 void* native_handle() const override; |
103 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; | 109 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
104 | 110 |
105 // Create a new buffer and copy the pixel data. | 111 // Create a new buffer and copy the pixel data. |
106 static rtc::scoped_refptr<I420Buffer> Copy( | 112 static rtc::scoped_refptr<I420Buffer> Copy( |
107 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); | 113 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 const uint8_t* const v_plane_; | 211 const uint8_t* const v_plane_; |
206 const int y_stride_; | 212 const int y_stride_; |
207 const int u_stride_; | 213 const int u_stride_; |
208 const int v_stride_; | 214 const int v_stride_; |
209 rtc::Callback0<void> no_longer_used_cb_; | 215 rtc::Callback0<void> no_longer_used_cb_; |
210 }; | 216 }; |
211 | 217 |
212 } // namespace webrtc | 218 } // namespace webrtc |
213 | 219 |
214 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 220 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
OLD | NEW |