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

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

Issue 1645543003: H264: Improve FFmpeg decoder performance by using I420BufferPool. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments Created 4 years, 11 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 5ab1510689b265b086be62df19bea4d71c925004..5c9ab06a097f1afbd0013cc5c6439d7b62890552 100644
--- a/webrtc/common_video/include/i420_buffer_pool.h
+++ b/webrtc/common_video/include/i420_buffer_pool.h
@@ -25,7 +25,9 @@ namespace webrtc {
// changes, old buffers will be purged from the pool.
class I420BufferPool {
public:
- I420BufferPool();
+ I420BufferPool() : I420BufferPool(false) {}
+ explicit I420BufferPool(bool zero_initialize);
+
// 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);
@@ -36,6 +38,12 @@ class I420BufferPool {
private:
rtc::ThreadChecker thread_checker_;
std::list<rtc::scoped_refptr<I420Buffer>> 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
+ // initial allocation (as shown by FFmpeg's own buffer allocation code). It
+ // has to do with "Use-of-uninitialized-value" on "Linux_msan_chrome".
+ bool zero_initialize_;
};
} // namespace webrtc

Powered by Google App Engine
This is Rietveld 408576698