Chromium Code Reviews| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 74 int width() const override; | 74 int width() const override; |
| 75 int height() const override; | 75 int height() const override; |
| 76 const uint8_t* data(PlaneType type) const override; | 76 const uint8_t* data(PlaneType type) const override; |
| 77 // Non-const data access is only allowed if HasOneRef() is true to protect | 77 // Non-const data access is only allowed if HasOneRef() is true to protect |
| 78 // against unexpected overwrites. | 78 // against unexpected overwrites. |
| 79 uint8_t* MutableData(PlaneType type) override; | 79 uint8_t* MutableData(PlaneType type) override; |
| 80 int stride(PlaneType type) const override; | 80 int stride(PlaneType type) const override; |
| 81 void* native_handle() const override; | 81 void* native_handle() const override; |
| 82 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; | 82 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
| 83 | 83 |
| 84 virtual rtc::scoped_refptr<I420Buffer> Copy(); | |
|
perkj_webrtc
2016/03/23 14:38:09
Can we move this to be a helper method. ie. Move t
nisse-webrtc
2016/03/24 12:52:52
For my intended usecase, it's desirable that the r
perkj_webrtc
2016/03/24 13:18:42
that is fine. But add a helper function instead of
| |
| 85 | |
| 84 protected: | 86 protected: |
| 85 ~I420Buffer() override; | 87 ~I420Buffer() override; |
| 86 | 88 |
| 87 private: | 89 private: |
| 88 const int width_; | 90 const int width_; |
| 89 const int height_; | 91 const int height_; |
| 90 const int stride_y_; | 92 const int stride_y_; |
| 91 const int stride_u_; | 93 const int stride_u_; |
| 92 const int stride_v_; | 94 const int stride_v_; |
| 93 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; | 95 const std::unique_ptr<uint8_t, AlignedFreeDeleter> data_; |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 // Helper function to crop |buffer| without making a deep copy. May only be used | 154 // Helper function to crop |buffer| without making a deep copy. May only be used |
| 153 // for non-native frames. | 155 // for non-native frames. |
| 154 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( | 156 rtc::scoped_refptr<VideoFrameBuffer> ShallowCenterCrop( |
| 155 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, | 157 const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
| 156 int cropped_width, | 158 int cropped_width, |
| 157 int cropped_height); | 159 int cropped_height); |
| 158 | 160 |
| 159 } // namespace webrtc | 161 } // namespace webrtc |
| 160 | 162 |
| 161 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ | 163 #endif // WEBRTC_COMMON_VIDEO_INCLUDE_VIDEO_FRAME_BUFFER_H_ |
| OLD | NEW |