FFmpeg
Data Structures | Macros | Functions
nvdec.c File Reference
#include "config.h"
#include "libavutil/common.h"
#include "libavutil/error.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_cuda_internal.h"
#include "libavutil/cuda_check.h"
#include "libavutil/pixdesc.h"
#include "libavutil/pixfmt.h"
#include "avcodec.h"
#include "decode.h"
#include "nvdec.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  NVDECDecoder
 
struct  NVDECFramePool
 

Macros

#define cudaVideoSurfaceFormat_YUV444   2
 
#define cudaVideoSurfaceFormat_YUV444_16Bit   3
 
#define CHECK_CU(x)   FF_CUDA_CHECK_DL(logctx, decoder->cudl, x)
 

Functions

static int map_avcodec_id (enum AVCodecID id)
 
static int map_chroma_format (enum AVPixelFormat pix_fmt)
 
static int nvdec_test_capabilities (NVDECDecoder *decoder, CUVIDDECODECREATEINFO *params, void *logctx)
 
static void nvdec_decoder_free (void *opaque, uint8_t *data)
 
static int nvdec_decoder_create (AVBufferRef **out, AVBufferRef *hw_device_ref, CUVIDDECODECREATEINFO *params, void *logctx)
 
static AVBufferRefnvdec_decoder_frame_alloc (void *opaque, int size)
 
int ff_nvdec_decode_uninit (AVCodecContext *avctx)
 
static void nvdec_free_dummy (struct AVHWFramesContext *ctx)
 
static AVBufferRefnvdec_alloc_dummy (int size)
 
static int nvdec_init_hwframes (AVCodecContext *avctx, AVBufferRef **out_frames_ref, int dummy)
 
int ff_nvdec_decode_init (AVCodecContext *avctx)
 
static void nvdec_fdd_priv_free (void *priv)
 
static void nvdec_unmap_mapped_frame (void *opaque, uint8_t *data)
 
static int nvdec_retrieve_data (void *logctx, AVFrame *frame)
 
int ff_nvdec_start_frame (AVCodecContext *avctx, AVFrame *frame)
 
int ff_nvdec_end_frame (AVCodecContext *avctx)
 
int ff_nvdec_simple_end_frame (AVCodecContext *avctx)
 
int ff_nvdec_simple_decode_slice (AVCodecContext *avctx, const uint8_t *buffer, uint32_t size)
 
int ff_nvdec_frame_params (AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size, int supports_444)
 
int ff_nvdec_get_ref_idx (AVFrame *frame)
 

Macro Definition Documentation

◆ cudaVideoSurfaceFormat_YUV444

#define cudaVideoSurfaceFormat_YUV444   2

Definition at line 39 of file nvdec.c.

◆ cudaVideoSurfaceFormat_YUV444_16Bit

#define cudaVideoSurfaceFormat_YUV444_16Bit   3

Definition at line 40 of file nvdec.c.

◆ CHECK_CU

#define CHECK_CU (   x)    FF_CUDA_CHECK_DL(logctx, decoder->cudl, x)

Definition at line 60 of file nvdec.c.

Function Documentation

◆ map_avcodec_id()

static int map_avcodec_id ( enum AVCodecID  id)
static

Definition at line 62 of file nvdec.c.

Referenced by ff_nvdec_decode_init(), and ff_nvdec_frame_params().

◆ map_chroma_format()

static int map_chroma_format ( enum AVPixelFormat  pix_fmt)
static

Definition at line 79 of file nvdec.c.

Referenced by ff_nvdec_decode_init(), and ff_nvdec_frame_params().

◆ nvdec_test_capabilities()

static int nvdec_test_capabilities ( NVDECDecoder decoder,
CUVIDDECODECREATEINFO *  params,
void *  logctx 
)
static

Definition at line 95 of file nvdec.c.

Referenced by nvdec_decoder_create().

◆ nvdec_decoder_free()

static void nvdec_decoder_free ( void *  opaque,
uint8_t data 
)
static

Definition at line 155 of file nvdec.c.

Referenced by nvdec_decoder_create().

◆ nvdec_decoder_create()

static int nvdec_decoder_create ( AVBufferRef **  out,
AVBufferRef hw_device_ref,
CUVIDDECODECREATEINFO *  params,
void *  logctx 
)
static

Definition at line 175 of file nvdec.c.

Referenced by ff_nvdec_decode_init().

◆ nvdec_decoder_frame_alloc()

static AVBufferRef* nvdec_decoder_frame_alloc ( void *  opaque,
int  size 
)
static

Definition at line 239 of file nvdec.c.

Referenced by ff_nvdec_decode_init().

◆ ff_nvdec_decode_uninit()

int ff_nvdec_decode_uninit ( AVCodecContext avctx)

Definition at line 256 of file nvdec.c.

Referenced by ff_nvdec_decode_init().

◆ nvdec_free_dummy()

static void nvdec_free_dummy ( struct AVHWFramesContext ctx)
static

Definition at line 274 of file nvdec.c.

Referenced by nvdec_init_hwframes().

◆ nvdec_alloc_dummy()

static AVBufferRef* nvdec_alloc_dummy ( int  size)
static

Definition at line 279 of file nvdec.c.

Referenced by nvdec_init_hwframes().

◆ nvdec_init_hwframes()

static int nvdec_init_hwframes ( AVCodecContext avctx,
AVBufferRef **  out_frames_ref,
int  dummy 
)
static

Definition at line 284 of file nvdec.c.

Referenced by ff_nvdec_decode_init().

◆ ff_nvdec_decode_init()

int ff_nvdec_decode_init ( AVCodecContext avctx)

Definition at line 323 of file nvdec.c.

Referenced by nvdec_hevc_decode_init().

◆ nvdec_fdd_priv_free()

static void nvdec_fdd_priv_free ( void *  priv)
static

Definition at line 435 of file nvdec.c.

Referenced by ff_nvdec_start_frame().

◆ nvdec_unmap_mapped_frame()

static void nvdec_unmap_mapped_frame ( void *  opaque,
uint8_t data 
)
static

Definition at line 448 of file nvdec.c.

Referenced by nvdec_retrieve_data().

◆ nvdec_retrieve_data()

static int nvdec_retrieve_data ( void *  logctx,
AVFrame frame 
)
static

Definition at line 471 of file nvdec.c.

Referenced by ff_nvdec_start_frame().

◆ ff_nvdec_start_frame()

int ff_nvdec_start_frame ( AVCodecContext avctx,
AVFrame frame 
)

◆ ff_nvdec_end_frame()

int ff_nvdec_end_frame ( AVCodecContext avctx)

Definition at line 592 of file nvdec.c.

Referenced by ff_nvdec_simple_end_frame().

◆ ff_nvdec_simple_end_frame()

int ff_nvdec_simple_end_frame ( AVCodecContext avctx)

Definition at line 622 of file nvdec.c.

◆ ff_nvdec_simple_decode_slice()

int ff_nvdec_simple_decode_slice ( AVCodecContext avctx,
const uint8_t buffer,
uint32_t  size 
)

Definition at line 630 of file nvdec.c.

Referenced by nvdec_mjpeg_start_frame(), and nvdec_mpeg4_start_frame().

◆ ff_nvdec_frame_params()

int ff_nvdec_frame_params ( AVCodecContext avctx,
AVBufferRef hw_frames_ctx,
int  dpb_size,
int  supports_444 
)

◆ ff_nvdec_get_ref_idx()

int ff_nvdec_get_ref_idx ( AVFrame frame)