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

Function ff_hwaccel_frame_priv_alloc

libavcodec/decode.c:2299–2326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2297}
2298
2299int ff_hwaccel_frame_priv_alloc(AVCodecContext *avctx, void **hwaccel_picture_private)
2300{
2301 const FFHWAccel *hwaccel = ffhwaccel(avctx->hwaccel);
2302
2303 if (!hwaccel || !hwaccel->frame_priv_data_size)
2304 return 0;
2305
2306 av_assert0(!*hwaccel_picture_private);
2307
2308 if (hwaccel->free_frame_priv) {
2309 AVHWFramesContext *frames_ctx;
2310
2311 if (!avctx->hw_frames_ctx)
2312 return AVERROR(EINVAL);
2313
2314 frames_ctx = (AVHWFramesContext *) avctx->hw_frames_ctx->data;
2315 *hwaccel_picture_private = av_refstruct_alloc_ext(hwaccel->frame_priv_data_size, 0,
2316 frames_ctx->device_ctx,
2317 hwaccel->free_frame_priv);
2318 } else {
2319 *hwaccel_picture_private = av_refstruct_allocz(hwaccel->frame_priv_data_size);
2320 }
2321
2322 if (!*hwaccel_picture_private)
2323 return AVERROR(ENOMEM);
2324
2325 return 0;
2326}
2327
2328av_cold void ff_decode_flush_buffers(AVCodecContext *avctx)
2329{

Callers 11

alloc_pictureFunction · 0.85
alloc_pictureFunction · 0.85
vp8_alloc_frameFunction · 0.85
decode_frameFunction · 0.85
decode_frameFunction · 0.85
av1_frame_allocFunction · 0.85
decode_frameFunction · 0.85
vp9_frame_allocFunction · 0.85
decode_frameFunction · 0.85
alloc_frameFunction · 0.85
alloc_frameFunction · 0.85

Calls 3

ffhwaccelFunction · 0.85
av_refstruct_alloc_extFunction · 0.85
av_refstruct_alloczFunction · 0.85

Tested by

no test coverage detected