| 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 | 80 |
| 81 protected: | 81 protected: |
| 82 virtual ~VideoFrameBuffer(); | 82 virtual ~VideoFrameBuffer(); |
| 83 }; | 83 }; |
| 84 | 84 |
| 85 // Plain I420 buffer in standard memory. | 85 // Plain I420 buffer in standard memory. |
| 86 class I420Buffer : public VideoFrameBuffer { | 86 class I420Buffer : public VideoFrameBuffer { |
| 87 public: | 87 public: |
| 88 I420Buffer(int width, int height); | 88 I420Buffer(int width, int height); |
| 89 I420Buffer(int width, int height, int stride_y, int stride_u, int stride_v); | 89 I420Buffer(int width, int height, int stride_y, int stride_u, int stride_v); |
| 90 |
| 91 // Sets all three planes to all zeros. Used to work around for |
| 92 // quirks in memory checkers |
| 93 // (https://bugs.chromium.org/p/libyuv/issues/detail?id=377) and |
| 94 // ffmpeg (http://crbug.com/390941). |
| 95 // TODO(nisse): Should be deleted if/when those issues are resolved |
| 96 // in a better way. |
| 90 void InitializeData(); | 97 void InitializeData(); |
| 91 | 98 |
| 99 // Sets the frame buffer to all black. |
| 100 void SetToBlack(); |
| 101 |
| 92 int width() const override; | 102 int width() const override; |
| 93 int height() const override; | 103 int height() const override; |
| 94 const uint8_t* DataY() const override; | 104 const uint8_t* DataY() const override; |
| 95 const uint8_t* DataU() const override; | 105 const uint8_t* DataU() const override; |
| 96 const uint8_t* DataV() const override; | 106 const uint8_t* DataV() const override; |
| 97 | 107 |
| 98 uint8_t* MutableDataY() override; | 108 uint8_t* MutableDataY() override; |
| 99 uint8_t* MutableDataU() override; | 109 uint8_t* MutableDataU() override; |
| 100 uint8_t* MutableDataV() override; | 110 uint8_t* MutableDataV() override; |
| 101 int StrideY() const override; | 111 int StrideY() const override; |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 // Helper function to crop |buffer| without making a deep copy. May only be used | 199 // Helper function to crop |buffer| without making a deep copy. May only be used |
| 190 // for non-native frames. | 200 // for non-native frames. |
| 191 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( | 201 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( |
| 192 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 202 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
| 193 int cropped_width, | 203 int cropped_width, |
| 194 int cropped_height); | 204 int cropped_height); |
| 195 | 205 |
| 196 } // namespace webrtc | 206 } // namespace webrtc |
| 197 | 207 |
| 198 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 208 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
| OLD | NEW |