vaapi_encode: Add support for codec-local options
authorMark Thompson <sw@jkqxz.net>
Tue, 12 Apr 2016 22:15:03 +0000 (23:15 +0100)
committerAnton Khirnov <anton@khirnov.net>
Fri, 15 Apr 2016 08:07:05 +0000 (10:07 +0200)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/vaapi_encode.c
libavcodec/vaapi_encode.h

index b1f0069..c80e638 100644 (file)
@@ -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) {
index 9716578..ec552da 100644 (file)
@@ -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;