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