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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 default: | 87 default: |
88 RTC_NOTREACHED(); | 88 RTC_NOTREACHED(); |
89 return 0; | 89 return 0; |
90 } | 90 } |
91 } | 91 } |
92 | 92 |
93 void* I420Buffer::native_handle() const { | 93 void* I420Buffer::native_handle() const { |
94 return nullptr; | 94 return nullptr; |
95 } | 95 } |
96 | 96 |
97 TextureBuffer::TextureBuffer(void* native_handle, | 97 rtc::scoped_refptr<VideoFrameBuffer> I420Buffer::NativeToI420Buffer() { |
98 int width, | 98 RTC_NOTREACHED(); |
99 int height, | 99 return nullptr; |
100 const rtc::Callback0<void>& no_longer_used) | 100 } |
101 : native_handle_(native_handle), | 101 |
102 width_(width), | 102 NativeHandleBuffer::NativeHandleBuffer(void* native_handle, |
103 height_(height), | 103 int width, |
104 no_longer_used_cb_(no_longer_used) { | 104 int height) |
| 105 : native_handle_(native_handle), width_(width), height_(height) { |
105 DCHECK(native_handle != nullptr); | 106 DCHECK(native_handle != nullptr); |
106 DCHECK_GT(width, 0); | 107 DCHECK_GT(width, 0); |
107 DCHECK_GT(height, 0); | 108 DCHECK_GT(height, 0); |
108 } | 109 } |
109 | 110 |
110 TextureBuffer::~TextureBuffer() { | 111 int NativeHandleBuffer::width() const { |
111 no_longer_used_cb_(); | |
112 } | |
113 | |
114 int TextureBuffer::width() const { | |
115 return width_; | 112 return width_; |
116 } | 113 } |
117 | 114 |
118 int TextureBuffer::height() const { | 115 int NativeHandleBuffer::height() const { |
119 return height_; | 116 return height_; |
120 } | 117 } |
121 | 118 |
122 const uint8_t* TextureBuffer::data(PlaneType type) const { | 119 const uint8_t* NativeHandleBuffer::data(PlaneType type) const { |
123 RTC_NOTREACHED(); // Should not be called. | 120 RTC_NOTREACHED(); // Should not be called. |
124 return nullptr; | 121 return nullptr; |
125 } | 122 } |
126 | 123 |
127 uint8_t* TextureBuffer::data(PlaneType type) { | 124 uint8_t* NativeHandleBuffer::data(PlaneType type) { |
128 RTC_NOTREACHED(); // Should not be called. | 125 RTC_NOTREACHED(); // Should not be called. |
129 return nullptr; | 126 return nullptr; |
130 } | 127 } |
131 | 128 |
132 int TextureBuffer::stride(PlaneType type) const { | 129 int NativeHandleBuffer::stride(PlaneType type) const { |
133 RTC_NOTREACHED(); // Should not be called. | 130 RTC_NOTREACHED(); // Should not be called. |
134 return 0; | 131 return 0; |
135 } | 132 } |
136 | 133 |
137 void* TextureBuffer::native_handle() const { | 134 void* NativeHandleBuffer::native_handle() const { |
138 return native_handle_; | 135 return native_handle_; |
139 } | 136 } |
140 | 137 |
141 | |
142 WrappedI420Buffer::WrappedI420Buffer(int desired_width, | 138 WrappedI420Buffer::WrappedI420Buffer(int desired_width, |
143 int desired_height, | 139 int desired_height, |
144 int width, | 140 int width, |
145 int height, | 141 int height, |
146 const uint8_t* y_plane, | 142 const uint8_t* y_plane, |
147 int y_stride, | 143 int y_stride, |
148 const uint8_t* u_plane, | 144 const uint8_t* u_plane, |
149 int u_stride, | 145 int u_stride, |
150 const uint8_t* v_plane, | 146 const uint8_t* v_plane, |
151 int v_stride, | 147 int v_stride, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 default: | 209 default: |
214 RTC_NOTREACHED(); | 210 RTC_NOTREACHED(); |
215 return 0; | 211 return 0; |
216 } | 212 } |
217 } | 213 } |
218 | 214 |
219 void* WrappedI420Buffer::native_handle() const { | 215 void* WrappedI420Buffer::native_handle() const { |
220 return nullptr; | 216 return nullptr; |
221 } | 217 } |
222 | 218 |
| 219 rtc::scoped_refptr<VideoFrameBuffer> WrappedI420Buffer::NativeToI420Buffer() { |
| 220 RTC_NOTREACHED(); |
| 221 return nullptr; |
| 222 } |
| 223 |
223 } // namespace webrtc | 224 } // namespace webrtc |
OLD | NEW |