| 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 | |
| 54 // Returns the number of bytes between successive rows for a given plane. | 48 // Returns the number of bytes between successive rows for a given plane. |
| 55 virtual int StrideY() const = 0; | 49 virtual int StrideY() const = 0; |
| 56 virtual int StrideU() const = 0; | 50 virtual int StrideU() const = 0; |
| 57 virtual int StrideV() const = 0; | 51 virtual int StrideV() const = 0; |
| 58 | 52 |
| 59 // Return the handle of the underlying video frame. This is used when the | 53 // Return the handle of the underlying video frame. This is used when the |
| 60 // frame is backed by a texture. | 54 // frame is backed by a texture. |
| 61 virtual void* native_handle() const = 0; | 55 virtual void* native_handle() const = 0; |
| 62 | 56 |
| 63 // Returns a new memory-backed frame buffer converted from this buffer's | 57 // Returns a new memory-backed frame buffer converted from this buffer's |
| (...skipping 27 matching lines...) Expand all Loading... |
| 91 | 85 |
| 92 // Sets the frame buffer to all black. | 86 // Sets the frame buffer to all black. |
| 93 void SetToBlack(); | 87 void SetToBlack(); |
| 94 | 88 |
| 95 int width() const override; | 89 int width() const override; |
| 96 int height() const override; | 90 int height() const override; |
| 97 const uint8_t* DataY() const override; | 91 const uint8_t* DataY() const override; |
| 98 const uint8_t* DataU() const override; | 92 const uint8_t* DataU() const override; |
| 99 const uint8_t* DataV() const override; | 93 const uint8_t* DataV() const override; |
| 100 | 94 |
| 101 uint8_t* MutableDataY() override; | 95 uint8_t* MutableDataY(); |
| 102 uint8_t* MutableDataU() override; | 96 uint8_t* MutableDataU(); |
| 103 uint8_t* MutableDataV() override; | 97 uint8_t* MutableDataV(); |
| 104 int StrideY() const override; | 98 int StrideY() const override; |
| 105 int StrideU() const override; | 99 int StrideU() const override; |
| 106 int StrideV() const override; | 100 int StrideV() const override; |
| 107 | 101 |
| 108 void* native_handle() const override; | 102 void* native_handle() const override; |
| 109 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; | 103 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
| 110 | 104 |
| 111 // Create a new buffer and copy the pixel data. | 105 // Create a new buffer and copy the pixel data. |
| 112 static rtc::scoped_refptr<I420Buffer> Copy( | 106 static rtc::scoped_refptr<I420Buffer> Copy( |
| 113 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); | 107 const rtc::scoped_refptr<VideoFrameBuffer>& buffer); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 const uint8_t* const v_plane_; | 205 const uint8_t* const v_plane_; |
| 212 const int y_stride_; | 206 const int y_stride_; |
| 213 const int u_stride_; | 207 const int u_stride_; |
| 214 const int v_stride_; | 208 const int v_stride_; |
| 215 rtc::Callback0<void> no_longer_used_cb_; | 209 rtc::Callback0<void> no_longer_used_cb_; |
| 216 }; | 210 }; |
| 217 | 211 |
| 218 } // namespace webrtc | 212 } // namespace webrtc |
| 219 | 213 |
| 220 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 214 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
| OLD | NEW |