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 22 matching lines...) Expand all Loading... |
33 uint8_t* data(webrtc::PlaneType type) { | 33 uint8_t* data(webrtc::PlaneType type) { |
34 DCHECK(HasOneRef()); | 34 DCHECK(HasOneRef()); |
35 const webrtc::I420Buffer* cbuffer = buffer_.get(); | 35 const webrtc::I420Buffer* cbuffer = buffer_.get(); |
36 return const_cast<uint8_t*>(cbuffer->data(type)); | 36 return const_cast<uint8_t*>(cbuffer->data(type)); |
37 } | 37 } |
38 int stride(webrtc::PlaneType type) const override { | 38 int stride(webrtc::PlaneType type) const override { |
39 return buffer_->stride(type); | 39 return buffer_->stride(type); |
40 } | 40 } |
41 void* native_handle() const override { return nullptr; } | 41 void* native_handle() const override { return nullptr; } |
42 | 42 |
| 43 rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override { |
| 44 RTC_NOTREACHED(); |
| 45 return nullptr; |
| 46 } |
| 47 |
43 friend class rtc::RefCountedObject<PooledI420Buffer>; | 48 friend class rtc::RefCountedObject<PooledI420Buffer>; |
44 rtc::scoped_refptr<webrtc::I420Buffer> buffer_; | 49 rtc::scoped_refptr<webrtc::I420Buffer> buffer_; |
45 }; | 50 }; |
46 | 51 |
47 } // namespace | 52 } // namespace |
48 | 53 |
49 namespace webrtc { | 54 namespace webrtc { |
50 | 55 |
51 I420BufferPool::I420BufferPool() { | 56 I420BufferPool::I420BufferPool() { |
52 Release(); | 57 Release(); |
(...skipping 23 matching lines...) Expand all Loading... |
76 // and it's safe to reuse. | 81 // and it's safe to reuse. |
77 if (buffer->HasOneRef()) | 82 if (buffer->HasOneRef()) |
78 return new rtc::RefCountedObject<PooledI420Buffer>(buffer); | 83 return new rtc::RefCountedObject<PooledI420Buffer>(buffer); |
79 } | 84 } |
80 // Allocate new buffer. | 85 // Allocate new buffer. |
81 buffers_.push_back(new rtc::RefCountedObject<I420Buffer>(width, height)); | 86 buffers_.push_back(new rtc::RefCountedObject<I420Buffer>(width, height)); |
82 return new rtc::RefCountedObject<PooledI420Buffer>(buffers_.back()); | 87 return new rtc::RefCountedObject<PooledI420Buffer>(buffers_.back()); |
83 } | 88 } |
84 | 89 |
85 } // namespace webrtc | 90 } // namespace webrtc |
OLD | NEW |