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

Unified Diff: webrtc/common_video/include/i420_buffer_pool.h

Issue 2009193002: Delete IsMutable and IsExclusive methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Address tommi's comments. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/common_video/include/i420_buffer_pool.h
diff --git a/webrtc/common_video/include/i420_buffer_pool.h b/webrtc/common_video/include/i420_buffer_pool.h
index 5c9ab06a097f1afbd0013cc5c6439d7b62890552..834aa4f7c8cbe863f5af4cfdb8dd3ea6538cb975 100644
--- a/webrtc/common_video/include/i420_buffer_pool.h
+++ b/webrtc/common_video/include/i420_buffer_pool.h
@@ -30,14 +30,22 @@ class I420BufferPool {
// Returns a buffer from the pool, or creates a new buffer if no suitable
// buffer exists in the pool.
- rtc::scoped_refptr<VideoFrameBuffer> CreateBuffer(int width, int height);
+ rtc::scoped_refptr<I420Buffer> CreateBuffer(int width, int height);
// Clears buffers_ and detaches the thread checker so that it can be reused
// later from another thread.
void Release();
private:
+ class PooledI420Buffer : public webrtc::I420Buffer {
magjed_webrtc 2016/05/25 13:17:01 I don't see the need for this class, why not just
nisse-webrtc 2016/05/25 13:39:47 To use I420Buffer directly, I have to include HasO
magjed_webrtc 2016/05/25 14:56:07 HasOneRef is already part of the VideoFrameBuffer
pbos-webrtc 2016/05/25 15:26:07 Can you use a rtc::RefCountedObject<I420Buffer> ?
nisse-webrtc 2016/05/26 07:44:42 This cl deletes it from the interface. I don't thi
+ public:
+ PooledI420Buffer(int width, int height) : I420Buffer(width, height) {}
+
+ // Underlying refcount access, used by the pool to check exclusive access.
+ virtual bool HasOneRef() const = 0;
+ };
+
rtc::ThreadChecker thread_checker_;
- std::list<rtc::scoped_refptr<I420Buffer>> buffers_;
+ std::list<rtc::scoped_refptr<PooledI420Buffer>> buffers_;
// If true, newly allocated buffers are zero-initialized. Note that recycled
// buffers are not zero'd before reuse. This is required of buffers used by
// FFmpeg according to http://crbug.com/390941, which only requires it for the

Powered by Google App Engine
This is Rietveld 408576698