MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / av_buffer_pool_init2

Function av_buffer_pool_init2

libavutil/buffer.c:259–281  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259AVBufferPool *av_buffer_pool_init2(size_t size, void *opaque,
260 AVBufferRef* (*alloc)(void *opaque, size_t size),
261 void (*pool_free)(void *opaque))
262{
263 AVBufferPool *pool = av_mallocz(sizeof(*pool));
264 if (!pool)
265 return NULL;
266
267 if (ff_mutex_init(&pool->mutex, NULL)) {
268 av_free(pool);
269 return NULL;
270 }
271
272 pool->size = size;
273 pool->opaque = opaque;
274 pool->alloc2 = alloc;
275 pool->alloc = av_buffer_alloc; // fallback
276 pool->pool_free = pool_free;
277
278 atomic_init(&pool->refcount, 1);
279
280 return pool;
281}
282
283AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size))
284{

Callers 14

create_streamFunction · 0.85
amf_frames_initFunction · 0.85
vt_frames_initFunction · 0.85
vulkan_frames_initFunction · 0.85
ff_vk_get_pooled_bufferFunction · 0.85
d3d12va_frames_initFunction · 0.85
cuda_frames_initFunction · 0.85
d3d11va_frames_initFunction · 0.85
vdpau_frames_initFunction · 0.85
qsv_init_poolFunction · 0.85
vaapi_frames_initFunction · 0.85
opencl_frames_initFunction · 0.85

Calls 3

ff_mutex_initFunction · 0.85
av_malloczFunction · 0.70
av_freeFunction · 0.70

Tested by

no test coverage detected