| 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 #include "webrtc/common_video/include/video_frame_buffer.h" | 10 #include "webrtc/common_video/include/video_frame_buffer.h" |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 NativeHandleBuffer::NativeHandleBuffer(void* native_handle, | 24 NativeHandleBuffer::NativeHandleBuffer(void* native_handle, |
| 25 int width, | 25 int width, |
| 26 int height) | 26 int height) |
| 27 : native_handle_(native_handle), width_(width), height_(height) { | 27 : native_handle_(native_handle), width_(width), height_(height) { |
| 28 RTC_DCHECK(native_handle != nullptr); | 28 RTC_DCHECK(native_handle != nullptr); |
| 29 RTC_DCHECK_GT(width, 0); | 29 RTC_DCHECK_GT(width, 0); |
| 30 RTC_DCHECK_GT(height, 0); | 30 RTC_DCHECK_GT(height, 0); |
| 31 } | 31 } |
| 32 | 32 |
| 33 VideoFrameBuffer::Type NativeHandleBuffer::type() const { |
| 34 return Type::kNative; |
| 35 } |
| 36 |
| 33 int NativeHandleBuffer::width() const { | 37 int NativeHandleBuffer::width() const { |
| 34 return width_; | 38 return width_; |
| 35 } | 39 } |
| 36 | 40 |
| 37 int NativeHandleBuffer::height() const { | 41 int NativeHandleBuffer::height() const { |
| 38 return height_; | 42 return height_; |
| 39 } | 43 } |
| 40 | 44 |
| 41 const uint8_t* NativeHandleBuffer::DataY() const { | 45 const uint8_t* NativeHandleBuffer::DataY() const { |
| 42 RTC_NOTREACHED(); // Should not be called. | 46 RTC_NOTREACHED(); // Should not be called. |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 y_stride_(y_stride), | 89 y_stride_(y_stride), |
| 86 u_stride_(u_stride), | 90 u_stride_(u_stride), |
| 87 v_stride_(v_stride), | 91 v_stride_(v_stride), |
| 88 no_longer_used_cb_(no_longer_used) { | 92 no_longer_used_cb_(no_longer_used) { |
| 89 } | 93 } |
| 90 | 94 |
| 91 WrappedI420Buffer::~WrappedI420Buffer() { | 95 WrappedI420Buffer::~WrappedI420Buffer() { |
| 92 no_longer_used_cb_(); | 96 no_longer_used_cb_(); |
| 93 } | 97 } |
| 94 | 98 |
| 99 VideoFrameBuffer::Type WrappedI420Buffer::type() const { |
| 100 return Type::kI420; |
| 101 } |
| 102 |
| 95 int WrappedI420Buffer::width() const { | 103 int WrappedI420Buffer::width() const { |
| 96 return width_; | 104 return width_; |
| 97 } | 105 } |
| 98 | 106 |
| 99 int WrappedI420Buffer::height() const { | 107 int WrappedI420Buffer::height() const { |
| 100 return height_; | 108 return height_; |
| 101 } | 109 } |
| 102 | 110 |
| 103 const uint8_t* WrappedI420Buffer::DataY() const { | 111 const uint8_t* WrappedI420Buffer::DataY() const { |
| 104 return y_plane_; | 112 return y_plane_; |
| 105 } | 113 } |
| 106 const uint8_t* WrappedI420Buffer::DataU() const { | 114 const uint8_t* WrappedI420Buffer::DataU() const { |
| 107 return u_plane_; | 115 return u_plane_; |
| 108 } | 116 } |
| 109 const uint8_t* WrappedI420Buffer::DataV() const { | 117 const uint8_t* WrappedI420Buffer::DataV() const { |
| 110 return v_plane_; | 118 return v_plane_; |
| 111 } | 119 } |
| 112 | 120 |
| 113 int WrappedI420Buffer::StrideY() const { | 121 int WrappedI420Buffer::StrideY() const { |
| 114 return y_stride_; | 122 return y_stride_; |
| 115 } | 123 } |
| 116 int WrappedI420Buffer::StrideU() const { | 124 int WrappedI420Buffer::StrideU() const { |
| 117 return u_stride_; | 125 return u_stride_; |
| 118 } | 126 } |
| 119 int WrappedI420Buffer::StrideV() const { | 127 int WrappedI420Buffer::StrideV() const { |
| 120 return v_stride_; | 128 return v_stride_; |
| 121 } | 129 } |
| 122 | 130 |
| 123 void* WrappedI420Buffer::native_handle() const { | |
| 124 return nullptr; | |
| 125 } | |
| 126 | |
| 127 rtc::scoped_refptr<VideoFrameBuffer> WrappedI420Buffer::NativeToI420Buffer() { | |
| 128 RTC_NOTREACHED(); | |
| 129 return nullptr; | |
| 130 } | |
| 131 | |
| 132 } // namespace webrtc | 131 } // namespace webrtc |
| OLD | NEW |