vaapi_encode: Refactor slightly to allow easier setting of global options

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Mark Thompson
2016-04-12 23:13:31 +01:00
committed by Anton Khirnov
parent 18019f8cb9
commit f6b8552369
5 changed files with 73 additions and 42 deletions

View File

@@ -202,6 +202,19 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
pic->nb_param_buffers = 0;
if (pic->encode_order == 0) {
// Global parameter buffers are set on the first picture only.
for (i = 0; i < ctx->nb_global_params; i++) {
err = vaapi_encode_make_param_buffer(avctx, pic,
VAEncMiscParameterBufferType,
(char*)ctx->global_params[i],
ctx->global_params_size[i]);
if (err < 0)
goto fail;
}
}
if (pic->type == PICTURE_TYPE_IDR && ctx->codec->init_sequence_params) {
err = vaapi_encode_make_param_buffer(avctx, pic,
VAEncSequenceParameterBufferType,