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