summaryrefslogtreecommitdiff
path: root/libavcodec/vaapi_encode.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2016-04-12 23:13:31 +0100
committerAnton Khirnov <anton@khirnov.net>2016-04-15 10:07:04 +0200
commitf6b85523692b0e7d4c4efb8449fa201d313424fe (patch)
treeee84ef7e68d38e4dd1db1c3cff9f1e13d4b64b22 /libavcodec/vaapi_encode.c
parent18019f8cb9663dd1032c65aa453eaec18d641905 (diff)
vaapi_encode: Refactor slightly to allow easier setting of global options
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavcodec/vaapi_encode.c')
-rw-r--r--libavcodec/vaapi_encode.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 9f2083d1f7..b1f00695c7 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -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,