FFmpeg
Loading...
Searching...
No Matches
nvenc.c File Reference
#include "config.h"
#include "config_components.h"
#include "nvenc.h"
#include "hevc/sei.h"
#include "libavutil/hwcontext_cuda.h"
#include "libavutil/hwcontext.h"
#include "libavutil/cuda_check.h"
#include "libavutil/imgutils.h"
#include "libavutil/mem.h"
#include "libavutil/pixdesc.h"
#include "libavutil/timecode_internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/mastering_display_metadata.h"
#include "libavutil/stereo3d.h"
#include "libavutil/tdrdi.h"
#include "atsc_a53.h"
#include "codec_desc.h"
#include "encode.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  GUIDTuple
 

Macros

#define CHECK_CU(x)
 
#define NVENC_CAP   0x30
 
#define IS_CBR(rc)
 
#define IS_10BIT(pix_fmt)
 
#define IS_RGB(pix_fmt)
 
#define IS_YUV444(pix_fmt)
 
#define IS_YUV422(pix_fmt)
 
#define IS_HWACCEL(pix_fmt)
 
#define IS_GBRP(pix_fmt)
 
#define PRESET_ALIAS(alias, name, ...)
 
#define PRESET(name, ...)
 
#define to_nv_color_matrix(n)
 
#define to_nv_color_pri(n)
 
#define to_nv_color_trc(n)
 

Functions

static int nvenc_map_error (NVENCSTATUS err, const char **desc)
 
static int nvenc_print_error (AVCodecContext *avctx, NVENCSTATUS err, const char *error_string)
 
static void nvenc_map_preset (NvencContext *ctx)
 
static void nvenc_print_driver_requirement (AVCodecContext *avctx, int level)
 
static av_cold int nvenc_load_libraries (AVCodecContext *avctx)
 
static int nvenc_push_context (AVCodecContext *avctx)
 
static int nvenc_pop_context (AVCodecContext *avctx)
 
static av_cold int nvenc_open_session (AVCodecContext *avctx)
 
static int nvenc_check_codec_support (AVCodecContext *avctx)
 
static int nvenc_check_cap (AVCodecContext *avctx, NV_ENC_CAPS cap)
 
static int nvenc_check_capabilities (AVCodecContext *avctx)
 
static av_cold int nvenc_check_device (AVCodecContext *avctx, int idx)
 
static av_cold int nvenc_setup_device (AVCodecContext *avctx)
 
static av_cold void set_constqp (AVCodecContext *avctx)
 
static av_cold void set_vbr (AVCodecContext *avctx)
 
static av_cold void set_lossless (AVCodecContext *avctx)
 
static void nvenc_override_rate_control (AVCodecContext *avctx)
 
static av_cold int nvenc_recalc_surfaces (AVCodecContext *avctx)
 
static av_cold int nvenc_setup_rate_control (AVCodecContext *avctx)
 
static av_cold int nvenc_setup_h264_config (AVCodecContext *avctx)
 
static av_cold int nvenc_setup_hevc_config (AVCodecContext *avctx)
 
static av_cold int nvenc_setup_codec_config (AVCodecContext *avctx)
 
static void compute_dar (AVCodecContext *avctx, int *dw, int *dh)
 
static av_cold int nvenc_setup_encoder (AVCodecContext *avctx)
 
static NV_ENC_BUFFER_FORMAT nvenc_map_buffer_format (enum AVPixelFormat pix_fmt)
 
static av_cold int nvenc_alloc_surface (AVCodecContext *avctx, int idx)
 
static av_cold int nvenc_setup_surfaces (AVCodecContext *avctx)
 
static av_cold int nvenc_setup_extradata (AVCodecContext *avctx)
 
av_cold int ff_nvenc_encode_close (AVCodecContext *avctx)
 
av_cold int ff_nvenc_encode_init (AVCodecContext *avctx)
 
static NvencSurfaceget_free_frame (NvencContext *ctx)
 
static int nvenc_copy_frame (AVCodecContext *avctx, NvencSurface *nv_surface, NV_ENC_LOCK_INPUT_BUFFER *lock_buffer_params, const AVFrame *frame)
 
static int nvenc_find_free_reg_resource (AVCodecContext *avctx)
 
static int nvenc_register_frame (AVCodecContext *avctx, const AVFrame *frame)
 
static int nvenc_upload_frame (AVCodecContext *avctx, const AVFrame *frame, NvencSurface *nvenc_frame)
 
static void nvenc_codec_specific_pic_params (AVCodecContext *avctx, const AVFrame *frame, NV_ENC_PIC_PARAMS *params, NV_ENC_SEI_PAYLOAD *sei_data, int sei_count)
 
static void timestamp_queue_enqueue (AVFifo *queue, int64_t timestamp)
 
static int64_t timestamp_queue_dequeue (AVFifo *queue)
 
static int64_t timestamp_queue_peek (AVFifo *queue, size_t index)
 
static int nvenc_set_timestamp (AVCodecContext *avctx, NV_ENC_LOCK_BITSTREAM *params, AVPacket *pkt)
 
static int nvenc_store_frame_data (AVCodecContext *avctx, NV_ENC_PIC_PARAMS *pic_params, const AVFrame *frame)
 
static int nvenc_retrieve_frame_data (AVCodecContext *avctx, NV_ENC_LOCK_BITSTREAM *lock_params, AVPacket *pkt)
 
static int process_output_surface (AVCodecContext *avctx, AVPacket *pkt, NvencSurface *tmpoutsurf)
 
static int output_ready (AVCodecContext *avctx, int flush)
 
static int prepare_sei_data_array (AVCodecContext *avctx, const AVFrame *frame)
 
static void reconfig_encoder (AVCodecContext *avctx, const AVFrame *frame)
 
static int nvenc_send_frame (AVCodecContext *avctx, const AVFrame *frame)
 
int ff_nvenc_receive_packet (AVCodecContext *avctx, AVPacket *pkt)
 
av_cold void ff_nvenc_encode_flush (AVCodecContext *avctx)
 

Variables

enum AVPixelFormat ff_nvenc_pix_fmts []
 
const AVCodecHWConfigInternal *const ff_nvenc_hw_configs []
 
struct { 
 
   NVENCSTATUS   nverr 
 
   int   averr 
 
   const char *   desc 
 
nvenc_errors [] 
 

Macro Definition Documentation

◆ CHECK_CU

#define CHECK_CU ( x)
Value:
FF_CUDA_CHECK_DL(avctx, dl_fn->cuda_dl, x)
#define FF_CUDA_CHECK_DL(avclass, cudl, x)
Convenience wrapper for ff_cuda_check when dynamically loading cuda symbols.
Definition cuda_check.h:65

Definition at line 47 of file nvenc.c.

Referenced by ff_nvenc_encode_close(), nvenc_check_device(), nvenc_pop_context(), nvenc_push_context(), and nvenc_setup_device().

◆ NVENC_CAP

#define NVENC_CAP   0x30

Definition at line 49 of file nvenc.c.

Referenced by nvenc_check_device().

◆ IS_CBR

#define IS_CBR ( rc)
Value:
(rc == NV_ENC_PARAMS_RC_CBR)

Definition at line 51 of file nvenc.c.

Referenced by nvenc_setup_h264_config(), and nvenc_setup_hevc_config().

◆ IS_10BIT

#define IS_10BIT ( pix_fmt)
Value:
static enum AVPixelFormat pix_fmt
#define AV_PIX_FMT_P212
Definition pixfmt.h:624
#define AV_PIX_FMT_P412
Definition pixfmt.h:625
#define AV_PIX_FMT_P210
Definition pixfmt.h:622
#define AV_PIX_FMT_P012
Definition pixfmt.h:609
#define AV_PIX_FMT_P216
Definition pixfmt.h:626
#define AV_PIX_FMT_P010
Definition pixfmt.h:608
#define AV_PIX_FMT_P016
Definition pixfmt.h:610
#define AV_PIX_FMT_YUV444P12MSB
Definition pixfmt.h:561
#define AV_PIX_FMT_X2RGB10
Definition pixfmt.h:619
#define AV_PIX_FMT_P410
Definition pixfmt.h:623
#define AV_PIX_FMT_P416
Definition pixfmt.h:627
#define AV_PIX_FMT_X2BGR10
Definition pixfmt.h:620
#define AV_PIX_FMT_GBRP16
Definition pixfmt.h:567
#define AV_PIX_FMT_GBRP10MSB
Definition pixfmt.h:574
#define AV_PIX_FMT_YUV444P16
Definition pixfmt.h:558
#define AV_PIX_FMT_YUV444P10MSB
Definition pixfmt.h:560

Definition at line 105 of file nvenc.c.

Referenced by nvenc_check_capabilities(), nvenc_setup_h264_config(), and nvenc_setup_hevc_config().

◆ IS_RGB

#define IS_RGB ( pix_fmt)
Value:
#define AV_PIX_FMT_0RGB32
Definition pixfmt.h:521
#define AV_PIX_FMT_BGR32
Definition pixfmt.h:519
#define AV_PIX_FMT_0BGR32
Definition pixfmt.h:522
#define AV_PIX_FMT_RGB32
Definition pixfmt.h:517

Definition at line 122 of file nvenc.c.

Referenced by ff_nvenc_encode_init().

◆ IS_YUV444

#define IS_YUV444 ( pix_fmt)
Value:
(ctx->rgb_mode == NVENC_RGB_MODE_444 && IS_RGB(pix_fmt)))
#define IS_RGB(pix_fmt)
Definition nvenc.c:122
@ NVENC_RGB_MODE_444
Definition nvenc.h:166
@ AV_PIX_FMT_NV24
planar YUV 4:4:4, 24bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition pixfmt.h:371
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition pixfmt.h:78
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition pixfmt.h:165
static AVFormatContext * ctx
Definition movenc.c:49

Definition at line 129 of file nvenc.c.

Referenced by nvenc_check_capabilities(), nvenc_setup_h264_config(), and nvenc_setup_hevc_config().

◆ IS_YUV422

#define IS_YUV422 ( pix_fmt)
Value:
@ AV_PIX_FMT_NV16
interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition pixfmt.h:198

Definition at line 142 of file nvenc.c.

Referenced by nvenc_check_capabilities(), nvenc_setup_h264_config(), and nvenc_setup_hevc_config().

◆ IS_HWACCEL

#define IS_HWACCEL ( pix_fmt)
Value:
@ AV_PIX_FMT_CUDA
HW acceleration through CUDA.
Definition pixfmt.h:260
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
Definition pixfmt.h:336
@ AV_PIX_FMT_CUARRAY
hardware decoding through openharmony
Definition pixfmt.h:506

Definition at line 147 of file nvenc.c.

Referenced by ff_nvenc_encode_close(), ff_nvenc_encode_init(), nvenc_alloc_surface(), nvenc_setup_device(), nvenc_upload_frame(), and process_output_surface().

◆ IS_GBRP

#define IS_GBRP ( pix_fmt)

◆ PRESET_ALIAS

#define PRESET_ALIAS ( alias,
name,
... )
Value:
[PRESET_ ## alias] = { NV_ENC_PRESET_ ## name ## _GUID, __VA_ARGS__ }
const char * name
Definition qsvenc.c:142
Definition mccdec.c:79

Definition at line 225 of file nvenc.c.

Referenced by nvenc_map_preset().

◆ PRESET

#define PRESET ( name,
... )
Value:
PRESET_ALIAS(name, name, __VA_ARGS__)
#define PRESET_ALIAS(alias, name,...)
Definition nvenc.c:225

Definition at line 228 of file nvenc.c.

Referenced by nvenc_map_preset().

◆ to_nv_color_matrix

#define to_nv_color_matrix ( n)
Value:
(uint32_t)(n)

Definition at line 298 of file nvenc.c.

Referenced by nvenc_setup_h264_config(), and nvenc_setup_hevc_config().

◆ to_nv_color_pri

#define to_nv_color_pri ( n)
Value:
(uint32_t)(n)

Definition at line 299 of file nvenc.c.

Referenced by nvenc_setup_h264_config(), and nvenc_setup_hevc_config().

◆ to_nv_color_trc

#define to_nv_color_trc ( n)
Value:
(uint32_t)(n)

Definition at line 300 of file nvenc.c.

Referenced by nvenc_setup_h264_config(), and nvenc_setup_hevc_config().

Function Documentation

◆ nvenc_map_error()

static int nvenc_map_error ( NVENCSTATUS err,
const char ** desc )
static

Definition at line 188 of file nvenc.c.

Referenced by nvenc_print_error().

◆ nvenc_print_error()

◆ nvenc_map_preset()

static void nvenc_map_preset ( NvencContext * ctx)
static

Definition at line 230 of file nvenc.c.

Referenced by nvenc_setup_device().

◆ nvenc_print_driver_requirement()

static void nvenc_print_driver_requirement ( AVCodecContext * avctx,
int level )
static

Definition at line 257 of file nvenc.c.

Referenced by nvenc_load_libraries().

◆ nvenc_load_libraries()

static av_cold int nvenc_load_libraries ( AVCodecContext * avctx)
static

Definition at line 303 of file nvenc.c.

Referenced by ff_nvenc_encode_init().

◆ nvenc_push_context()

static int nvenc_push_context ( AVCodecContext * avctx)
static

◆ nvenc_pop_context()

static int nvenc_pop_context ( AVCodecContext * avctx)
static

◆ nvenc_open_session()

static av_cold int nvenc_open_session ( AVCodecContext * avctx)
static

Definition at line 370 of file nvenc.c.

Referenced by nvenc_check_device(), and nvenc_setup_device().

◆ nvenc_check_codec_support()

static int nvenc_check_codec_support ( AVCodecContext * avctx)
static

Definition at line 396 of file nvenc.c.

Referenced by nvenc_check_capabilities().

◆ nvenc_check_cap()

static int nvenc_check_cap ( AVCodecContext * avctx,
NV_ENC_CAPS cap )
static

Definition at line 432 of file nvenc.c.

Referenced by nvenc_check_capabilities().

◆ nvenc_check_capabilities()

static int nvenc_check_capabilities ( AVCodecContext * avctx)
static

Definition at line 449 of file nvenc.c.

Referenced by nvenc_check_device(), and nvenc_setup_device().

◆ nvenc_check_device()

static av_cold int nvenc_check_device ( AVCodecContext * avctx,
int idx )
static

Definition at line 638 of file nvenc.c.

Referenced by nvenc_setup_device().

◆ nvenc_setup_device()

static av_cold int nvenc_setup_device ( AVCodecContext * avctx)
static

Definition at line 713 of file nvenc.c.

Referenced by ff_nvenc_encode_init().

◆ set_constqp()

static av_cold void set_constqp ( AVCodecContext * avctx)
static

Definition at line 827 of file nvenc.c.

Referenced by nvenc_override_rate_control().

◆ set_vbr()

static av_cold void set_vbr ( AVCodecContext * avctx)
static

Definition at line 865 of file nvenc.c.

Referenced by nvenc_override_rate_control(), and nvenc_setup_rate_control().

◆ set_lossless()

static av_cold void set_lossless ( AVCodecContext * avctx)
static

Definition at line 942 of file nvenc.c.

Referenced by nvenc_setup_rate_control().

◆ nvenc_override_rate_control()

static void nvenc_override_rate_control ( AVCodecContext * avctx)
static

Definition at line 956 of file nvenc.c.

Referenced by nvenc_setup_rate_control().

◆ nvenc_recalc_surfaces()

static av_cold int nvenc_recalc_surfaces ( AVCodecContext * avctx)
static

Definition at line 975 of file nvenc.c.

Referenced by nvenc_setup_encoder().

◆ nvenc_setup_rate_control()

static av_cold int nvenc_setup_rate_control ( AVCodecContext * avctx)
static

Definition at line 1018 of file nvenc.c.

Referenced by nvenc_setup_encoder().

◆ nvenc_setup_h264_config()

static av_cold int nvenc_setup_h264_config ( AVCodecContext * avctx)
static

Definition at line 1160 of file nvenc.c.

Referenced by nvenc_setup_codec_config().

◆ nvenc_setup_hevc_config()

static av_cold int nvenc_setup_hevc_config ( AVCodecContext * avctx)
static

Definition at line 1339 of file nvenc.c.

Referenced by nvenc_setup_codec_config().

◆ nvenc_setup_codec_config()

static av_cold int nvenc_setup_codec_config ( AVCodecContext * avctx)
static

Definition at line 1639 of file nvenc.c.

Referenced by nvenc_setup_encoder().

◆ compute_dar()

static void compute_dar ( AVCodecContext * avctx,
int * dw,
int * dh )
static

Definition at line 1656 of file nvenc.c.

Referenced by nvenc_setup_encoder(), and reconfig_encoder().

◆ nvenc_setup_encoder()

static av_cold int nvenc_setup_encoder ( AVCodecContext * avctx)
static

Definition at line 1689 of file nvenc.c.

Referenced by ff_nvenc_encode_init().

◆ nvenc_map_buffer_format()

static NV_ENC_BUFFER_FORMAT nvenc_map_buffer_format ( enum AVPixelFormat pix_fmt)
static

Definition at line 1854 of file nvenc.c.

Referenced by nvenc_alloc_surface(), and nvenc_register_frame().

◆ nvenc_alloc_surface()

static av_cold int nvenc_alloc_surface ( AVCodecContext * avctx,
int idx )
static

Definition at line 1897 of file nvenc.c.

Referenced by nvenc_setup_surfaces().

◆ nvenc_setup_surfaces()

static av_cold int nvenc_setup_surfaces ( AVCodecContext * avctx)
static

Definition at line 1953 of file nvenc.c.

Referenced by ff_nvenc_encode_init().

◆ nvenc_setup_extradata()

static av_cold int nvenc_setup_extradata ( AVCodecContext * avctx)
static

Definition at line 1999 of file nvenc.c.

Referenced by ff_nvenc_encode_init().

◆ ff_nvenc_encode_close()

av_cold int ff_nvenc_encode_close ( AVCodecContext * avctx)

Definition at line 2033 of file nvenc.c.

◆ ff_nvenc_encode_init()

av_cold int ff_nvenc_encode_init ( AVCodecContext * avctx)

Definition at line 2118 of file nvenc.c.

◆ get_free_frame()

static NvencSurface * get_free_frame ( NvencContext * ctx)
static

Definition at line 2170 of file nvenc.c.

Referenced by nvenc_send_frame().

◆ nvenc_copy_frame()

static int nvenc_copy_frame ( AVCodecContext * avctx,
NvencSurface * nv_surface,
NV_ENC_LOCK_INPUT_BUFFER * lock_buffer_params,
const AVFrame * frame )
static

Definition at line 2181 of file nvenc.c.

Referenced by nvenc_upload_frame().

◆ nvenc_find_free_reg_resource()

static int nvenc_find_free_reg_resource ( AVCodecContext * avctx)
static

Definition at line 2211 of file nvenc.c.

Referenced by nvenc_register_frame().

◆ nvenc_register_frame()

static int nvenc_register_frame ( AVCodecContext * avctx,
const AVFrame * frame )
static

Definition at line 2245 of file nvenc.c.

Referenced by nvenc_upload_frame().

◆ nvenc_upload_frame()

static int nvenc_upload_frame ( AVCodecContext * avctx,
const AVFrame * frame,
NvencSurface * nvenc_frame )
static

Definition at line 2325 of file nvenc.c.

Referenced by nvenc_send_frame().

◆ nvenc_codec_specific_pic_params()

static void nvenc_codec_specific_pic_params ( AVCodecContext * avctx,
const AVFrame * frame,
NV_ENC_PIC_PARAMS * params,
NV_ENC_SEI_PAYLOAD * sei_data,
int sei_count )
static

Definition at line 2437 of file nvenc.c.

Referenced by nvenc_send_frame().

◆ timestamp_queue_enqueue()

static void timestamp_queue_enqueue ( AVFifo * queue,
int64_t timestamp )
inlinestatic

Definition at line 2488 of file nvenc.c.

Referenced by nvenc_send_frame().

◆ timestamp_queue_dequeue()

static int64_t timestamp_queue_dequeue ( AVFifo * queue)
inlinestatic

Definition at line 2493 of file nvenc.c.

Referenced by nvenc_set_timestamp(), and process_output_surface().

◆ timestamp_queue_peek()

static int64_t timestamp_queue_peek ( AVFifo * queue,
size_t index )
inlinestatic

Definition at line 2502 of file nvenc.c.

Referenced by nvenc_set_timestamp().

◆ nvenc_set_timestamp()

static int nvenc_set_timestamp ( AVCodecContext * avctx,
NV_ENC_LOCK_BITSTREAM * params,
AVPacket * pkt )
static

Definition at line 2510 of file nvenc.c.

Referenced by process_output_surface().

◆ nvenc_store_frame_data()

static int nvenc_store_frame_data ( AVCodecContext * avctx,
NV_ENC_PIC_PARAMS * pic_params,
const AVFrame * frame )
static

Definition at line 2567 of file nvenc.c.

Referenced by nvenc_send_frame().

◆ nvenc_retrieve_frame_data()

static int nvenc_retrieve_frame_data ( AVCodecContext * avctx,
NV_ENC_LOCK_BITSTREAM * lock_params,
AVPacket * pkt )
static

Definition at line 2593 of file nvenc.c.

Referenced by process_output_surface().

◆ process_output_surface()

static int process_output_surface ( AVCodecContext * avctx,
AVPacket * pkt,
NvencSurface * tmpoutsurf )
static

Definition at line 2614 of file nvenc.c.

Referenced by ff_nvenc_receive_packet().

◆ output_ready()

static int output_ready ( AVCodecContext * avctx,
int flush )
static

Definition at line 2714 of file nvenc.c.

Referenced by ff_nvenc_receive_packet().

◆ prepare_sei_data_array()

static int prepare_sei_data_array ( AVCodecContext * avctx,
const AVFrame * frame )
static

Definition at line 2726 of file nvenc.c.

Referenced by nvenc_send_frame().

◆ reconfig_encoder()

static void reconfig_encoder ( AVCodecContext * avctx,
const AVFrame * frame )
static

Definition at line 2840 of file nvenc.c.

Referenced by nvenc_send_frame().

◆ nvenc_send_frame()

static int nvenc_send_frame ( AVCodecContext * avctx,
const AVFrame * frame )
static

Definition at line 3004 of file nvenc.c.

Referenced by ff_nvenc_encode_flush(), and ff_nvenc_receive_packet().

◆ ff_nvenc_receive_packet()

int ff_nvenc_receive_packet ( AVCodecContext * avctx,
AVPacket * pkt )

Definition at line 3177 of file nvenc.c.

◆ ff_nvenc_encode_flush()

av_cold void ff_nvenc_encode_flush ( AVCodecContext * avctx)

Definition at line 3228 of file nvenc.c.

Variable Documentation

◆ ff_nvenc_pix_fmts

enum AVPixelFormat ff_nvenc_pix_fmts[]

Definition at line 53 of file nvenc.c.

◆ ff_nvenc_hw_configs

const AVCodecHWConfigInternal* const ff_nvenc_hw_configs[]
Initial value:
= {
}
#define NULL
Definition coverity.c:32
#define HW_CONFIG_ENCODER_DEVICE(format, device_type_)
Definition hwconfig.h:97
#define HW_CONFIG_ENCODER_FRAMES(format, device_type_)
Definition hwconfig.h:100
#define NONE
Definition vf_drawvg.c:262

Definition at line 92 of file nvenc.c.

◆ nverr

NVENCSTATUS nverr

Definition at line 156 of file nvenc.c.

Referenced by nvenc_map_error().

◆ averr

int averr

Definition at line 157 of file nvenc.c.

Referenced by print_ssl_error().

◆ desc

const char* desc

Definition at line 158 of file nvenc.c.

◆ [struct]

const struct { ... } nvenc_errors[]
Initial value:
= {
{ NV_ENC_SUCCESS, 0, "success" },
{ NV_ENC_ERR_NO_ENCODE_DEVICE, AVERROR(ENOENT), "no encode device" },
{ NV_ENC_ERR_UNSUPPORTED_DEVICE, AVERROR(ENOSYS), "unsupported device" },
{ NV_ENC_ERR_INVALID_ENCODERDEVICE, AVERROR(EINVAL), "invalid encoder device" },
{ NV_ENC_ERR_INVALID_DEVICE, AVERROR(EINVAL), "invalid device" },
{ NV_ENC_ERR_DEVICE_NOT_EXIST, AVERROR(EIO), "device does not exist" },
{ NV_ENC_ERR_INVALID_PTR, AVERROR(EFAULT), "invalid ptr" },
{ NV_ENC_ERR_INVALID_EVENT, AVERROR(EINVAL), "invalid event" },
{ NV_ENC_ERR_INVALID_PARAM, AVERROR(EINVAL), "invalid param" },
{ NV_ENC_ERR_INVALID_CALL, AVERROR(EINVAL), "invalid call" },
{ NV_ENC_ERR_OUT_OF_MEMORY, AVERROR(ENOMEM), "out of memory" },
{ NV_ENC_ERR_ENCODER_NOT_INITIALIZED, AVERROR(EINVAL), "encoder not initialized" },
{ NV_ENC_ERR_UNSUPPORTED_PARAM, AVERROR(ENOSYS), "unsupported param" },
{ NV_ENC_ERR_LOCK_BUSY, AVERROR(EAGAIN), "lock busy" },
{ NV_ENC_ERR_NOT_ENOUGH_BUFFER, AVERROR_BUFFER_TOO_SMALL, "not enough buffer"},
{ NV_ENC_ERR_INVALID_VERSION, AVERROR(EINVAL), "invalid version" },
{ NV_ENC_ERR_MAP_FAILED, AVERROR(EIO), "map failed" },
{ NV_ENC_ERR_NEED_MORE_INPUT, AVERROR(EAGAIN), "need more input" },
{ NV_ENC_ERR_ENCODER_BUSY, AVERROR(EAGAIN), "encoder busy" },
{ NV_ENC_ERR_EVENT_NOT_REGISTERD, AVERROR(EBADF), "event not registered" },
{ NV_ENC_ERR_GENERIC, AVERROR_UNKNOWN, "generic error" },
{ NV_ENC_ERR_INCOMPATIBLE_CLIENT_KEY, AVERROR(EINVAL), "incompatible client key" },
{ NV_ENC_ERR_UNIMPLEMENTED, AVERROR(ENOSYS), "unimplemented" },
{ NV_ENC_ERR_RESOURCE_REGISTER_FAILED, AVERROR(EIO), "resource register failed" },
{ NV_ENC_ERR_RESOURCE_NOT_REGISTERED, AVERROR(EBADF), "resource not registered" },
{ NV_ENC_ERR_RESOURCE_NOT_MAPPED, AVERROR(EBADF), "resource not mapped" },
}
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
Definition error.h:73
#define AVERROR_BUFFER_TOO_SMALL
Buffer too small.
Definition error.h:53
#define AVERROR(e)
Definition error.h:45

Referenced by nvenc_map_error().