| 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_API_VIDEO_I420_BUFFER_H_ | 11 #ifndef WEBRTC_API_VIDEO_I420_BUFFER_H_ |
| 12 #define WEBRTC_API_VIDEO_I420_BUFFER_H_ | 12 #define WEBRTC_API_VIDEO_I420_BUFFER_H_ |
| 13 | 13 |
| 14 #include <memory> | 14 #include <memory> |
| 15 | 15 |
| 16 #include "webrtc/api/video/video_rotation.h" | 16 #include "webrtc/api/video/video_rotation.h" |
| 17 #include "webrtc/api/video/video_frame_buffer.h" | 17 #include "webrtc/api/video/video_frame_buffer.h" |
| 18 #include "webrtc/system_wrappers/include/aligned_malloc.h" | 18 #include "webrtc/system_wrappers/include/aligned_malloc.h" |
| 19 | 19 |
| 20 namespace webrtc { | 20 namespace webrtc { |
| 21 | 21 |
| 22 // Plain I420 buffer in standard memory. | 22 // Plain I420 buffer in standard memory. |
| 23 class I420Buffer : public PlanarYuvBuffer { | 23 class I420Buffer : public I420BufferInterface { |
| 24 public: | 24 public: |
| 25 static rtc::scoped_refptr<I420Buffer> Create(int width, int height); | 25 static rtc::scoped_refptr<I420Buffer> Create(int width, int height); |
| 26 static rtc::scoped_refptr<I420Buffer> Create(int width, | 26 static rtc::scoped_refptr<I420Buffer> Create(int width, |
| 27 int height, | 27 int height, |
| 28 int stride_y, | 28 int stride_y, |
| 29 int stride_u, | 29 int stride_u, |
| 30 int stride_v); | 30 int stride_v); |
| 31 | 31 |
| 32 // Create a new buffer and copy the pixel data. | 32 // Create a new buffer and copy the pixel data. |
| 33 static rtc::scoped_refptr<I420Buffer> Copy(const VideoFrameBuffer& buffer); | 33 static rtc::scoped_refptr<I420Buffer> Copy(const VideoFrameBuffer& buffer); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 46 static void SetBlack(I420Buffer* buffer); | 46 static void SetBlack(I420Buffer* buffer); |
| 47 | 47 |
| 48 // Sets all three planes to all zeros. Used to work around for | 48 // Sets all three planes to all zeros. Used to work around for |
| 49 // quirks in memory checkers | 49 // quirks in memory checkers |
| 50 // (https://bugs.chromium.org/p/libyuv/issues/detail?id=377) and | 50 // (https://bugs.chromium.org/p/libyuv/issues/detail?id=377) and |
| 51 // ffmpeg (http://crbug.com/390941). | 51 // ffmpeg (http://crbug.com/390941). |
| 52 // TODO(nisse): Deprecated. Should be deleted if/when those issues | 52 // TODO(nisse): Deprecated. Should be deleted if/when those issues |
| 53 // are resolved in a better way. Or in the mean time, use SetBlack. | 53 // are resolved in a better way. Or in the mean time, use SetBlack. |
| 54 void InitializeData(); | 54 void InitializeData(); |
| 55 | 55 |
| 56 Type type() const override; | |
| 57 int width() const override; | 56 int width() const override; |
| 58 int height() const override; | 57 int height() const override; |
| 59 const uint8_t* DataY() const override; | 58 const uint8_t* DataY() const override; |
| 60 const uint8_t* DataU() const override; | 59 const uint8_t* DataU() const override; |
| 61 const uint8_t* DataV() const override; | 60 const uint8_t* DataV() const override; |
| 62 | 61 |
| 63 int StrideY() const override; | 62 int StrideY() const override; |
| 64 int StrideU() const override; | 63 int StrideU() const override; |
| 65 int StrideV() const override; | 64 int StrideV() const override; |
| 66 | 65 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 94 const int height_; | 93 const int height_; |
| 95 const int stride_y_; | 94 const int stride_y_; |
| 96 const int stride_u_; | 95 const int stride_u_; |
| 97 const int stride_v_; | 96 const int stride_v_; |
| 98 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; | 97 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; |
| 99 }; | 98 }; |
| 100 | 99 |
| 101 } // namespace webrtc | 100 } // namespace webrtc |
| 102 | 101 |
| 103 #endif // WEBRTC_API_VIDEO_I420_BUFFER_H_ | 102 #endif // WEBRTC_API_VIDEO_I420_BUFFER_H_ |
| OLD | NEW |