]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vaapi_encode.c
avutil/buffer: Switch AVBuffer API to size_t
[ffmpeg] / libavcodec / vaapi_encode.c
index b3a02459f1a056f2d16bdc50e4c618b05cf82ad3..7510816ec193fe096dae66926e7adc1b2026bc17 100644 (file)
@@ -21,6 +21,7 @@
 
 #include "libavutil/avassert.h"
 #include "libavutil/common.h"
+#include "libavutil/internal.h"
 #include "libavutil/log.h"
 #include "libavutil/pixdesc.h"
 
@@ -28,7 +29,7 @@
 #include "encode.h"
 #include "avcodec.h"
 
-const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[] = {
+const AVCodecHWConfigInternal *const ff_vaapi_encode_hw_configs[] = {
     HW_CONFIG_ENCODER_FRAMES(VAAPI, VAAPI),
     NULL,
 };
@@ -649,7 +650,7 @@ static int vaapi_encode_output(AVCodecContext *avctx,
     for (buf = buf_list; buf; buf = buf->next)
         total_size += buf->size;
 
-    err = av_new_packet(pkt, total_size);
+    err = ff_get_encode_buffer(avctx, pkt, total_size, 0);
     ptr = pkt->data;
 
     if (err < 0)
@@ -2234,7 +2235,7 @@ static void vaapi_encode_free_output_buffer(void *opaque,
 }
 
 static AVBufferRef *vaapi_encode_alloc_output_buffer(void *opaque,
-                                                     int size)
+                                                     size_t size)
 {
     AVCodecContext   *avctx = opaque;
     VAAPIEncodeContext *ctx = avctx->priv_data;