1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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.
This commit is contained in:
Mark Thompson 2020-04-13 16:33:16 +01:00
parent 858eba0ca4
commit 5a1ff44907
7 changed files with 15 additions and 0 deletions

View File

@ -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,
};

View File

@ -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 {

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};

View File

@ -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,
};