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

Function ff_vaapi_decode_make_param_buffer

libavcodec/vaapi_decode.c:34–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32
33
34int ff_vaapi_decode_make_param_buffer(AVCodecContext *avctx,
35 VAAPIDecodePicture *pic,
36 int type,
37 const void *data,
38 size_t size)
39{
40 VAAPIDecodeContext *ctx = avctx->internal->hwaccel_priv_data;
41 VAStatus vas;
42
43 av_assert0(pic->nb_param_buffers <= pic->nb_param_buffers_allocated);
44 if (pic->nb_param_buffers == pic->nb_param_buffers_allocated) {
45 VABufferID *tmp =
46 av_realloc_array(pic->param_buffers,
47 pic->nb_param_buffers_allocated + 16,
48 sizeof(*pic->param_buffers));
49 if (!tmp)
50 return AVERROR(ENOMEM);
51
52 pic->param_buffers = tmp;
53 pic->nb_param_buffers_allocated += 16;
54 }
55 av_assert0(pic->nb_param_buffers + 1 <= pic->nb_param_buffers_allocated);
56
57 vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
58 type, size, 1, (void*)data,
59 &pic->param_buffers[pic->nb_param_buffers]);
60 if (vas != VA_STATUS_SUCCESS) {
61 av_log(avctx, AV_LOG_ERROR, "Failed to create parameter "
62 "buffer (type %d): %d (%s).\n",
63 type, vas, vaErrorStr(vas));
64 return AVERROR(EIO);
65 }
66
67 av_log(avctx, AV_LOG_DEBUG, "Param buffer (type %d, %zu bytes) "
68 "is %#x.\n", type, size, pic->param_buffers[pic->nb_param_buffers]);
69
70 ++pic->nb_param_buffers;
71
72 return 0;
73}
74
75int ff_vaapi_decode_make_slice_buffer(AVCodecContext *avctx,
76 VAAPIDecodePicture *pic,

Callers 11

vaapi_hevc_start_frameFunction · 0.85
vaapi_mpeg2_start_frameFunction · 0.85
vaapi_h264_start_frameFunction · 0.85
vaapi_vvc_start_frameFunction · 0.85
vaapi_vp9_start_frameFunction · 0.85
vaapi_mpeg4_start_frameFunction · 0.85
vaapi_av1_start_frameFunction · 0.85
vaapi_vc1_start_frameFunction · 0.85
vaapi_vp8_start_frameFunction · 0.85
vaapi_mjpeg_start_frameFunction · 0.85
vaapi_mjpeg_decode_sliceFunction · 0.85

Calls 2

av_realloc_arrayFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected