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:
parent
858eba0ca4
commit
5a1ff44907
@ -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,
|
||||
};
|
||||
|
@ -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 {
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
@ -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,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user