Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Side by Side Diff: webrtc/common_video/i420_buffer_pool.cc

Issue 1158273010: Re-land "Convert native handles to buffers before encoding." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « talk/media/webrtc/webrtcvideoframe_unittest.cc ('k') | webrtc/common_video/i420_video_frame_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698