summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2020-04-13 16:33:17 +0100
committerMark Thompson <sw@jkqxz.net>2020-04-26 18:38:25 +0100
commit344e6c3ff1b47279ffb360aba3f5e10183bc4eb4 (patch)
tree718a1f66b445e56ef65c7831c941d00acd7644a5
parent5a1ff449071fefa7913858fbe2d084f698443e57 (diff)
lavc/vaapi_encode: Add hardware config metadata
These encoders all accept VAAPI surfaces in a hardware frames context.
-rw-r--r--libavcodec/vaapi_encode.c5
-rw-r--r--libavcodec/vaapi_encode.h3
-rw-r--r--libavcodec/vaapi_encode_h264.c1
-rw-r--r--libavcodec/vaapi_encode_h265.c1
-rw-r--r--libavcodec/vaapi_encode_mjpeg.c1
-rw-r--r--libavcodec/vaapi_encode_mpeg2.c1
-rw-r--r--libavcodec/vaapi_encode_vp8.c1
-rw-r--r--libavcodec/vaapi_encode_vp9.c1
8 files changed, 14 insertions, 0 deletions
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 8ff720e395..f551967ad6 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -27,6 +27,11 @@
#include "vaapi_encode.h"
#include "avcodec.h"
+const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[] = {
+ HW_CONFIG_ENCODER_FRAMES(VAAPI, VAAPI),
+ NULL,
+};
+
static const char * const picture_type_name[] = { "IDR", "I", "P", "B" };
static int vaapi_encode_make_packed_header(AVCodecContext *avctx,
diff --git a/libavcodec/vaapi_encode.h b/libavcodec/vaapi_encode.h
index b9a3defd72..1329f6428f 100644
--- a/libavcodec/vaapi_encode.h
+++ b/libavcodec/vaapi_encode.h
@@ -31,6 +31,7 @@
#include "libavutil/hwcontext_vaapi.h"
#include "avcodec.h"
+#include "hwconfig.h"
struct VAAPIEncodeType;
struct VAAPIEncodePicture;
@@ -44,6 +45,8 @@ enum {
MAX_PARAM_BUFFER_SIZE = 1024,
};
+extern const AVCodecHWConfigInternal *ff_vaapi_encode_hw_configs[];
+
enum {
PICTURE_TYPE_IDR = 0,
PICTURE_TYPE_I = 1,
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index f4965d8b09..67b1ecae1b 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -1361,5 +1361,6 @@ AVCodec ff_h264_vaapi_encoder = {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
+ .hw_configs = ff_vaapi_encode_hw_configs,
.wrapper_name = "vaapi",
};
diff --git a/libavcodec/vaapi_encode_h265.c b/libavcodec/vaapi_encode_h265.c
index 97dc5a7e75..e20e8cbdd0 100644
--- a/libavcodec/vaapi_encode_h265.c
+++ b/libavcodec/vaapi_encode_h265.c
@@ -1297,5 +1297,6 @@ AVCodec ff_hevc_vaapi_encoder = {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
+ .hw_configs = ff_vaapi_encode_hw_configs,
.wrapper_name = "vaapi",
};
diff --git a/libavcodec/vaapi_encode_mjpeg.c b/libavcodec/vaapi_encode_mjpeg.c
index bd029cc903..2b5d3bf4f9 100644
--- a/libavcodec/vaapi_encode_mjpeg.c
+++ b/libavcodec/vaapi_encode_mjpeg.c
@@ -570,5 +570,6 @@ AVCodec ff_mjpeg_vaapi_encoder = {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
+ .hw_configs = ff_vaapi_encode_hw_configs,
.wrapper_name = "vaapi",
};
diff --git a/libavcodec/vaapi_encode_mpeg2.c b/libavcodec/vaapi_encode_mpeg2.c
index bac9ea1fa6..0398c4cd8c 100644
--- a/libavcodec/vaapi_encode_mpeg2.c
+++ b/libavcodec/vaapi_encode_mpeg2.c
@@ -707,5 +707,6 @@ AVCodec ff_mpeg2_vaapi_encoder = {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
+ .hw_configs = ff_vaapi_encode_hw_configs,
.wrapper_name = "vaapi",
};
diff --git a/libavcodec/vaapi_encode_vp8.c b/libavcodec/vaapi_encode_vp8.c
index 6e7bf9d106..16cbcbd81c 100644
--- a/libavcodec/vaapi_encode_vp8.c
+++ b/libavcodec/vaapi_encode_vp8.c
@@ -262,5 +262,6 @@ AVCodec ff_vp8_vaapi_encoder = {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
+ .hw_configs = ff_vaapi_encode_hw_configs,
.wrapper_name = "vaapi",
};
diff --git a/libavcodec/vaapi_encode_vp9.c b/libavcodec/vaapi_encode_vp9.c
index d7f415d704..d05319ef39 100644
--- a/libavcodec/vaapi_encode_vp9.c
+++ b/libavcodec/vaapi_encode_vp9.c
@@ -296,5 +296,6 @@ AVCodec ff_vp9_vaapi_encoder = {
AV_PIX_FMT_VAAPI,
AV_PIX_FMT_NONE,
},
+ .hw_configs = ff_vaapi_encode_hw_configs,
.wrapper_name = "vaapi",
};