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

Function vaapi_encode_make_param_buffer

libavcodec/vaapi_encode.c:87–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87static int vaapi_encode_make_param_buffer(AVCodecContext *avctx,
88 VAAPIEncodePicture *pic,
89 int type, char *data, size_t len)
90{
91 VAAPIEncodeContext *ctx = avctx->priv_data;
92 VAStatus vas;
93 VABufferID *tmp;
94 VABufferID buffer;
95
96 tmp = av_realloc_array(pic->param_buffers, pic->nb_param_buffers + 1, sizeof(*tmp));
97 if (!tmp)
98 return AVERROR(ENOMEM);
99 pic->param_buffers = tmp;
100
101 vas = vaCreateBuffer(ctx->hwctx->display, ctx->va_context,
102 type, len, 1, data, &buffer);
103 if (vas != VA_STATUS_SUCCESS) {
104 av_log(avctx, AV_LOG_ERROR, "Failed to create parameter buffer "
105 "(type %d): %d (%s).\n", type, vas, vaErrorStr(vas));
106 return AVERROR(EIO);
107 }
108 pic->param_buffers[pic->nb_param_buffers++] = buffer;
109
110 av_log(avctx, AV_LOG_DEBUG, "Param buffer (%d) is %#x.\n",
111 type, buffer);
112 return 0;
113}
114
115static int vaapi_encode_make_misc_param_buffer(AVCodecContext *avctx,
116 VAAPIEncodePicture *pic,

Callers 2

vaapi_encode_issueFunction · 0.85

Calls 2

av_realloc_arrayFunction · 0.85
av_logFunction · 0.85

Tested by

no test coverage detected