aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Thompson2020-04-13 16:33:16 +0100
committerMark Thompson2020-04-26 18:38:25 +0100
commit5a1ff449071fefa7913858fbe2d084f698443e57 (patch)
tree5b19e1dca6bdebc5cfe9abef2441fd868beef74e
parent858eba0ca4b680ce23c4eebd1460db333989b0a4 (diff)
lavc/qsvenc: Add hardware config metadata
All of these encoders can accept libmfx surfaces directly in a hardware frames context, or they can accept software frames if a suitable device is supplied to use.
-rw-r--r--libavcodec/qsvenc.c7
-rw-r--r--libavcodec/qsvenc.h3
-rw-r--r--libavcodec/qsvenc_h264.c1
-rw-r--r--libavcodec/qsvenc_hevc.c1
-rw-r--r--libavcodec/qsvenc_jpeg.c1
-rw-r--r--libavcodec/qsvenc_mpeg2.c1
-rw-r--r--libavcodec/qsvenc_vp9.c1
7 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index afab8fd715..9ec0636dde 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -1652,3 +1652,10 @@ int ff_qsv_enc_close(AVCodecContext *avctx, QSVEncContext *q)
return 0;
}
+
+const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[] = {
+ HW_CONFIG_ENCODER_FRAMES(QSV, QSV),
+ HW_CONFIG_ENCODER_DEVICE(NV12, QSV),
+ HW_CONFIG_ENCODER_DEVICE(P010, QSV),
+ NULL,
+};
diff --git a/libavcodec/qsvenc.h b/libavcodec/qsvenc.h
index 6609171af3..4f579d1db1 100644
--- a/libavcodec/qsvenc.h
+++ b/libavcodec/qsvenc.h
@@ -32,6 +32,7 @@
#include "libavutil/fifo.h"
#include "avcodec.h"
+#include "hwconfig.h"
#include "qsv_internal.h"
#define QSV_HAVE_CO2 QSV_VERSION_ATLEAST(1, 6)
@@ -97,6 +98,8 @@
{ "forced_idr", "Forcing I frames as IDR frames", OFFSET(qsv.forced_idr), AV_OPT_TYPE_BOOL,{ .i64 = 0 }, 0, 1, VE }, \
{ "low_power", "enable low power mode(experimental: many limitations by mfx version, BRC modes, etc.)", OFFSET(qsv.low_power), AV_OPT_TYPE_BOOL, { .i64 = 0}, 0, 1, VE},\
+extern const AVCodecHWConfigInternal *ff_qsv_enc_hw_configs[];
+
typedef int SetEncodeCtrlCB (AVCodecContext *avctx,
const AVFrame *frame, mfxEncodeCtrl* enc_ctrl);
typedef struct QSVEncContext {
diff --git a/libavcodec/qsvenc_h264.c b/libavcodec/qsvenc_h264.c
index 27f36b9f7b..364975bea5 100644
--- a/libavcodec/qsvenc_h264.c
+++ b/libavcodec/qsvenc_h264.c
@@ -197,4 +197,5 @@ AVCodec ff_h264_qsv_encoder = {
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
+ .hw_configs = ff_qsv_enc_hw_configs,
};
diff --git a/libavcodec/qsvenc_hevc.c b/libavcodec/qsvenc_hevc.c
index 27e2232a9f..36e5ef6052 100644
--- a/libavcodec/qsvenc_hevc.c
+++ b/libavcodec/qsvenc_hevc.c
@@ -288,4 +288,5 @@ AVCodec ff_hevc_qsv_encoder = {
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
+ .hw_configs = ff_qsv_enc_hw_configs,
};
diff --git a/libavcodec/qsvenc_jpeg.c b/libavcodec/qsvenc_jpeg.c
index 1619a335c7..f76af9486b 100644
--- a/libavcodec/qsvenc_jpeg.c
+++ b/libavcodec/qsvenc_jpeg.c
@@ -95,4 +95,5 @@ AVCodec ff_mjpeg_qsv_encoder = {
.priv_class = &class,
.defaults = qsv_enc_defaults,
.wrapper_name = "qsv",
+ .hw_configs = ff_qsv_enc_hw_configs,
};
diff --git a/libavcodec/qsvenc_mpeg2.c b/libavcodec/qsvenc_mpeg2.c
index e4ade56d62..0e34bb75dc 100644
--- a/libavcodec/qsvenc_mpeg2.c
+++ b/libavcodec/qsvenc_mpeg2.c
@@ -112,4 +112,5 @@ AVCodec ff_mpeg2_qsv_encoder = {
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
+ .hw_configs = ff_qsv_enc_hw_configs,
};
diff --git a/libavcodec/qsvenc_vp9.c b/libavcodec/qsvenc_vp9.c
index 9402f806b1..ce44c09397 100644
--- a/libavcodec/qsvenc_vp9.c
+++ b/libavcodec/qsvenc_vp9.c
@@ -110,4 +110,5 @@ AVCodec ff_vp9_qsv_encoder = {
.defaults = qsv_enc_defaults,
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
.wrapper_name = "qsv",
+ .hw_configs = ff_qsv_enc_hw_configs,
};