]> git.sesse.net Git - ffmpeg/commitdiff
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 b1f00695c7240c3bb0b165f8c080b152dd9834ed..c80e638cad6400269feef7a42247b97e71fa9a8f 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 9716578e5a62d5ad0c873c9be0bbcc7dfde8dccc..ec552dad0a4c06a68a07ec36a9a9f0d956597d84 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;