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. | |
97 void InitializeData(); | 90 void InitializeData(); |
98 | 91 |
99 // Sets the frame buffer to all black. | |
100 void SetToBlack(); | |
101 | |
102 int width() const override; | 92 int width() const override; |
103 int height() const override; | 93 int height() const override; |
104 const uint8_t* DataY() const override; | 94 const uint8_t* DataY() const override; |
105 const uint8_t* DataU() const override; | 95 const uint8_t* DataU() const override; |
106 const uint8_t* DataV() const override; | 96 const uint8_t* DataV() const override; |
107 | 97 |
108 uint8_t* MutableDataY() override; | 98 uint8_t* MutableDataY() override; |
109 uint8_t* MutableDataU() override; | 99 uint8_t* MutableDataU() override; |
110 uint8_t* MutableDataV() override; | 100 uint8_t* MutableDataV() override; |
111 int StrideY() const override; | 101 int StrideY() const override; |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 // Helper function to crop |buffer| without making a deep copy. May only be used | 189 // Helper function to crop |buffer| without making a deep copy. May only be used |
200 // for non-native frames. | 190 // for non-native frames. |
201 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( | 191 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( |
202 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 192 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
203 int cropped_width, | 193 int cropped_width, |
204 int cropped_height); | 194 int cropped_height); |
205 | 195 |
206 } // namespace webrtc | 196 } // namespace webrtc |
207 | 197 |
208 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 198 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
OLD | NEW |