diff options
author | Mark Thompson <sw@jkqxz.net> | 2016-04-12 23:15:03 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-04-15 10:07:05 +0200 |
commit | 69b06ed42809432b5892e29cfc496a77e60b7765 (patch) | |
tree | e6e56984553578d7e3f4c55f152eb240ae97bc7d | |
parent | 6e8f66fc932b9351055ff44ecb2bb328197099c1 (diff) | |
download | ffmpeg-69b06ed42809432b5892e29cfc496a77e60b7765.tar.gz |
vaapi_encode: Add support for codec-local options
Signed-off-by: Anton Khirnov <anton@khirnov.net>
-rw-r--r-- | libavcodec/vaapi_encode.c | 1 | ||||
-rw-r--r-- | libavcodec/vaapi_encode.h | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c index b1f00695c7..c80e638cad 100644 --- a/libavcodec/vaapi_encode.c +++ b/libavcodec/vaapi_encode.c @@ -905,6 +905,7 @@ av_cold int ff_vaapi_encode_init(AVCodecContext *avctx, } ctx->codec = type; + ctx->codec_options = ctx->codec_options_data; ctx->priv_data = av_mallocz(type->priv_data_size); if (!ctx->priv_data) { diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h index 9716578e5a..ec552dad0a 100644 --- a/libavcodec/vaapi_encode.h +++ b/libavcodec/vaapi_encode.h @@ -172,6 +172,11 @@ typedef struct VAAPIEncodeContext { int p_counter; int end_of_stream; + // Codec-local options are allocated to follow this structure in + // memory (in the AVCodec definition, set priv_data_size to + // sizeof(VAAPIEncodeContext) + sizeof(VAAPIEncodeFooOptions)). + void *codec_options; + char codec_options_data[0]; } VAAPIEncodeContext; |