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

Function av_buffer_pool_get

libavutil/buffer.c:390–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

388}
389
390AVBufferRef *av_buffer_pool_get(AVBufferPool *pool)
391{
392 AVBufferRef *ret;
393 BufferPoolEntry *buf;
394
395 ff_mutex_lock(&pool->mutex);
396 buf = pool->pool;
397 if (buf) {
398 memset(&buf->buffer, 0, sizeof(buf->buffer));
399 ret = buffer_create(&buf->buffer, buf->data, pool->size,
400 pool_release_buffer, buf, 0);
401 if (ret) {
402 pool->pool = buf->next;
403 buf->next = NULL;
404 buf->buffer.flags_internal |= BUFFER_FLAG_NO_FREE;
405 }
406 } else {
407 ret = pool_alloc_buffer(pool);
408 }
409 ff_mutex_unlock(&pool->mutex);
410
411 if (ret)
412 atomic_fetch_add_explicit(&pool->refcount, 1, memory_order_relaxed);
413
414 return ret;
415}
416
417void *av_buffer_pool_buffer_get_opaque(const AVBufferRef *ref)
418{

Callers 15

xcbgrab_frame_shmFunction · 0.85
buffer_pool_getFunction · 0.85
amf_get_bufferFunction · 0.85
vt_get_bufferFunction · 0.85
vulkan_get_bufferFunction · 0.85
ff_vk_get_pooled_bufferFunction · 0.85
drm_get_bufferFunction · 0.85
d3d12va_get_bufferFunction · 0.85
cuda_get_bufferFunction · 0.85
d3d11va_get_bufferFunction · 0.85
vdpau_get_bufferFunction · 0.85
qsv_get_bufferFunction · 0.85

Calls 4

ff_mutex_lockFunction · 0.85
buffer_createFunction · 0.85
pool_alloc_bufferFunction · 0.85
ff_mutex_unlockFunction · 0.85

Tested by

no test coverage detected