summaryrefslogtreecommitdiff
path: root/chromium/media/capture/video/mac/pixel_buffer_pool_mac.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/media/capture/video/mac/pixel_buffer_pool_mac.h')
-rw-r--r--chromium/media/capture/video/mac/pixel_buffer_pool_mac.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/chromium/media/capture/video/mac/pixel_buffer_pool_mac.h b/chromium/media/capture/video/mac/pixel_buffer_pool_mac.h
index 3e9c7cfdda1..162204b6706 100644
--- a/chromium/media/capture/video/mac/pixel_buffer_pool_mac.h
+++ b/chromium/media/capture/video/mac/pixel_buffer_pool_mac.h
@@ -32,11 +32,18 @@ class CAPTURE_EXPORT PixelBufferPool {
// Creates a new buffer from the pool, or returns null if |max_buffers_| would
// be exceeded. The underlying buffers may be recycled.
//
- // The caller owns the returned buffer and is responsible for calling
- // CFRelease() after they are done using it. This returns the underlying
- // buffer to the pool. In order to free memory, you must both release all
- // buffers and call Flush() or delete the pool. It is safe for a buffer to
- // outlive its pool.
+ // Freeing all buffer references returns the underlying buffer to the pool. In
+ // order to free memory, you must both release all buffers and call Flush() or
+ // delete the pool. It is safe for a buffer to outlive its pool.
+ //
+ // Retaining a pixel buffer and preventing it from returning to the pool can
+ // be done either by keeping a reference directly to the CVPixelBuffer, e.g.
+ // with a base::ScopedCFTypeRef<CVPixelBufferRef>, or by incrementing the use
+ // count of the IOSurface, i.e. with IOSurfaceIncrementUseCount().
+ //
+ // WARNING: Retaining references to the pixel buffer's IOSurface (e.g. with
+ // base::ScopedCFTypeRef<IOSurfaceRef>) without incrementing its use count
+ // does NOT prevent it from being recycled!
base::ScopedCFTypeRef<CVPixelBufferRef> CreateBuffer();
// Frees the memory of any released buffers returned to the pool.