You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
avcodec/nvenc: add hardware config metadata
Signed-off-by: Timo Rothenpieler <timo@rothenpieler.org>
This commit is contained in:
committed by
Timo Rothenpieler
parent
1128aa8753
commit
1dff97b7bc
@@ -55,6 +55,16 @@ const enum AVPixelFormat ff_nvenc_pix_fmts[] = {
|
|||||||
AV_PIX_FMT_NONE
|
AV_PIX_FMT_NONE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const AVCodecHWConfigInternal *ff_nvenc_hw_configs[] = {
|
||||||
|
HW_CONFIG_ENCODER_FRAMES(CUDA, CUDA),
|
||||||
|
HW_CONFIG_ENCODER_DEVICE(NONE, CUDA),
|
||||||
|
#if CONFIG_D3D11VA
|
||||||
|
HW_CONFIG_ENCODER_FRAMES(D3D11, D3D11VA),
|
||||||
|
HW_CONFIG_ENCODER_DEVICE(NONE, D3D11VA),
|
||||||
|
#endif
|
||||||
|
NULL,
|
||||||
|
};
|
||||||
|
|
||||||
#define IS_10BIT(pix_fmt) (pix_fmt == AV_PIX_FMT_P010 || \
|
#define IS_10BIT(pix_fmt) (pix_fmt == AV_PIX_FMT_P010 || \
|
||||||
pix_fmt == AV_PIX_FMT_P016 || \
|
pix_fmt == AV_PIX_FMT_P016 || \
|
||||||
pix_fmt == AV_PIX_FMT_YUV444P16)
|
pix_fmt == AV_PIX_FMT_YUV444P16)
|
||||||
|
@@ -33,6 +33,7 @@ typedef void ID3D11Device;
|
|||||||
#include "compat/cuda/dynlink_loader.h"
|
#include "compat/cuda/dynlink_loader.h"
|
||||||
#include "libavutil/fifo.h"
|
#include "libavutil/fifo.h"
|
||||||
#include "libavutil/opt.h"
|
#include "libavutil/opt.h"
|
||||||
|
#include "hwconfig.h"
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
|
|
||||||
@@ -217,5 +218,6 @@ int ff_nvenc_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
void ff_nvenc_encode_flush(AVCodecContext *avctx);
|
void ff_nvenc_encode_flush(AVCodecContext *avctx);
|
||||||
|
|
||||||
extern const enum AVPixelFormat ff_nvenc_pix_fmts[];
|
extern const enum AVPixelFormat ff_nvenc_pix_fmts[];
|
||||||
|
extern const AVCodecHWConfigInternal *ff_nvenc_hw_configs[];
|
||||||
|
|
||||||
#endif /* AVCODEC_NVENC_H */
|
#endif /* AVCODEC_NVENC_H */
|
||||||
|
@@ -191,6 +191,7 @@ AVCodec ff_nvenc_encoder = {
|
|||||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
.pix_fmts = ff_nvenc_pix_fmts,
|
.pix_fmts = ff_nvenc_pix_fmts,
|
||||||
.wrapper_name = "nvenc",
|
.wrapper_name = "nvenc",
|
||||||
|
.hw_configs = ff_nvenc_hw_configs,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -222,6 +223,7 @@ AVCodec ff_nvenc_h264_encoder = {
|
|||||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
.pix_fmts = ff_nvenc_pix_fmts,
|
.pix_fmts = ff_nvenc_pix_fmts,
|
||||||
.wrapper_name = "nvenc",
|
.wrapper_name = "nvenc",
|
||||||
|
.hw_configs = ff_nvenc_hw_configs,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -253,4 +255,5 @@ AVCodec ff_h264_nvenc_encoder = {
|
|||||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
.pix_fmts = ff_nvenc_pix_fmts,
|
.pix_fmts = ff_nvenc_pix_fmts,
|
||||||
.wrapper_name = "nvenc",
|
.wrapper_name = "nvenc",
|
||||||
|
.hw_configs = ff_nvenc_hw_configs,
|
||||||
};
|
};
|
||||||
|
@@ -178,6 +178,7 @@ AVCodec ff_nvenc_hevc_encoder = {
|
|||||||
AV_CODEC_CAP_ENCODER_FLUSH,
|
AV_CODEC_CAP_ENCODER_FLUSH,
|
||||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
.wrapper_name = "nvenc",
|
.wrapper_name = "nvenc",
|
||||||
|
.hw_configs = ff_nvenc_hw_configs,
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -208,4 +209,5 @@ AVCodec ff_hevc_nvenc_encoder = {
|
|||||||
AV_CODEC_CAP_ENCODER_FLUSH,
|
AV_CODEC_CAP_ENCODER_FLUSH,
|
||||||
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
.caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
|
||||||
.wrapper_name = "nvenc",
|
.wrapper_name = "nvenc",
|
||||||
|
.hw_configs = ff_nvenc_hw_configs,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user