Class AVBufferPool
Represents a pool of AVBuffer objects for efficient memory management.
Inherited Members
Namespace: FFmpeg.Collections
Assembly: FFmpeg.dll
Syntax
public sealed class AVBufferPool : IDisposable, IAVPointer<_AVBufferPool>
Remarks
This class is a wrapper around the FFmpeg AVBufferPool structure, providing a mechanism to
allocate and manage a pool of buffers. It implements IDisposable to ensure that
resources are properly released when the pool is no longer needed.
Constructors
View SourceAVBufferPool(int)
Represents a pool of AVBuffer objects for efficient memory management.
Declaration
public AVBufferPool(int size)
Parameters
| Type | Name | Description |
|---|---|---|
| int | size | The size of each buffer in the pool, in bytes. |
Remarks
This class is a wrapper around the FFmpeg AVBufferPool structure, providing a mechanism to
allocate and manage a pool of buffers. It implements IDisposable to ensure that
resources are properly released when the pool is no longer needed.
Methods
View SourceDispose()
Releases all resources used by the AVBufferPool.
Declaration
public void Dispose()
Remarks
This method is called when the pool is no longer needed, either explicitly through a call to
Dispose() or implicitly via the finalizer. It calls FFmpeg's av_buffer_pool_uninit
function to free the memory associated with the buffer pool.
~AVBufferPool()
Finalizes an instance of the AVBufferPool class.
Declaration
protected ~AVBufferPool()
Remarks
The finalizer ensures that resources are released if Dispose() is not called.
Rent()
Rents a buffer from the pool.
Declaration
public AVBuffer Rent()
Returns
| Type | Description |
|---|---|
| AVBuffer | An AVBuffer instance representing the rented buffer. |
Remarks
This method retrieves a buffer from the pool using FFmpeg's av_buffer_pool_get function.
The caller is responsible for managing the lifecycle of the returned buffer.