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

Function get_frame_buffer

libavcodec/libvpxdec.c:53–78  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51
52
53static int get_frame_buffer(void *priv, size_t min_size, vpx_codec_frame_buffer_t *fb)
54{
55 VPxContext *ctx = priv;
56 AVBufferRef *buf;
57
58 if (min_size > ctx->pool_size) {
59 av_buffer_pool_uninit(&ctx->pool);
60 /* According to the libvpx docs the buffer must be zeroed out. */
61 ctx->pool = av_buffer_pool_init(min_size, av_buffer_allocz);
62 if (!ctx->pool) {
63 ctx->pool_size = 0;
64 return AVERROR(ENOMEM);
65 }
66 ctx->pool_size = min_size;
67 }
68
69 buf = av_buffer_pool_get(ctx->pool);
70 if (!buf)
71 return AVERROR(ENOMEM);
72
73 fb->priv = buf;
74 fb->size = ctx->pool_size;
75 fb->data = buf->data;
76
77 return 0;
78}
79
80static int release_frame_buffer(void *priv, vpx_codec_frame_buffer_t *fb)
81{

Callers

nothing calls this directly

Calls 3

av_buffer_pool_uninitFunction · 0.85
av_buffer_pool_initFunction · 0.85
av_buffer_pool_getFunction · 0.85

Tested by

no test coverage detected