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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 virtual int height() const = 0; | 56 virtual int height() const = 0; |
57 | 57 |
58 // Returns a memory-backed frame buffer in I420 format. If the pixel data is | 58 // Returns a memory-backed frame buffer in I420 format. If the pixel data is |
59 // in another format, a conversion will take place. All implementations must | 59 // in another format, a conversion will take place. All implementations must |
60 // provide a fallback to I420 for compatibility with e.g. the internal WebRTC | 60 // provide a fallback to I420 for compatibility with e.g. the internal WebRTC |
61 // software encoders. | 61 // software encoders. |
62 virtual rtc::scoped_refptr<I420BufferInterface> ToI420(); | 62 virtual rtc::scoped_refptr<I420BufferInterface> ToI420(); |
63 | 63 |
64 // These functions should only be called if type() is of the correct type. | 64 // These functions should only be called if type() is of the correct type. |
65 // Calling with a different type will result in a crash. | 65 // Calling with a different type will result in a crash. |
| 66 // TODO(magjed): Return raw pointers for GetI420 once deprecated interface is |
| 67 // removed. |
66 rtc::scoped_refptr<I420BufferInterface> GetI420(); | 68 rtc::scoped_refptr<I420BufferInterface> GetI420(); |
67 rtc::scoped_refptr<I444BufferInterface> GetI444(); | 69 rtc::scoped_refptr<const I420BufferInterface> GetI420() const; |
| 70 I444BufferInterface* GetI444(); |
| 71 const I444BufferInterface* GetI444() const; |
68 | 72 |
69 // Deprecated - use ToI420() first instead. | 73 // Deprecated - use ToI420() first instead. |
70 // Returns pointer to the pixel data for a given plane. The memory is owned by | 74 // Returns pointer to the pixel data for a given plane. The memory is owned by |
71 // the VideoFrameBuffer object and must not be freed by the caller. | 75 // the VideoFrameBuffer object and must not be freed by the caller. |
72 virtual const uint8_t* DataY() const; | 76 virtual const uint8_t* DataY() const; |
73 virtual const uint8_t* DataU() const; | 77 virtual const uint8_t* DataU() const; |
74 virtual const uint8_t* DataV() const; | 78 virtual const uint8_t* DataV() const; |
75 // Returns the number of bytes between successive rows for a given plane. | 79 // Returns the number of bytes between successive rows for a given plane. |
76 virtual int StrideY() const; | 80 virtual int StrideY() const; |
77 virtual int StrideU() const; | 81 virtual int StrideU() const; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 137 |
134 rtc::scoped_refptr<I420BufferInterface> ToI420() final; | 138 rtc::scoped_refptr<I420BufferInterface> ToI420() final; |
135 | 139 |
136 protected: | 140 protected: |
137 ~I444BufferInterface() override {} | 141 ~I444BufferInterface() override {} |
138 }; | 142 }; |
139 | 143 |
140 } // namespace webrtc | 144 } // namespace webrtc |
141 | 145 |
142 #endif // WEBRTC_API_VIDEO_VIDEO_FRAME_BUFFER_H_ | 146 #endif // WEBRTC_API_VIDEO_VIDEO_FRAME_BUFFER_H_ |
OLD | NEW |