FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | 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/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
 

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)
 
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)
 
static void nvdec_free_dummy (struct AVHWFramesContext *ctx)
 
static AVBufferRefnvdec_alloc_dummy (int size)
 
int ff_nvdec_frame_params (AVCodecContext *avctx, AVBufferRef *hw_frames_ctx, int dpb_size)
 
int ff_nvdec_get_ref_idx (AVFrame *frame)
 

Function Documentation

static int map_avcodec_id ( enum AVCodecID  id)
static

Definition at line 53 of file nvdec.c.

Referenced by ff_nvdec_decode_init(), and ff_nvdec_frame_params().

static int map_chroma_format ( enum AVPixelFormat  pix_fmt)
static

Definition at line 70 of file nvdec.c.

Referenced by ff_nvdec_decode_init(), and ff_nvdec_frame_params().

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

Definition at line 86 of file nvdec.c.

Referenced by nvdec_decoder_create().

static void nvdec_decoder_free ( void opaque,
uint8_t data 
)
static

Definition at line 148 of file nvdec.c.

Referenced by nvdec_decoder_create().

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

Definition at line 166 of file nvdec.c.

Referenced by ff_nvdec_decode_init().

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

Definition at line 235 of file nvdec.c.

Referenced by ff_nvdec_decode_init().

int ff_nvdec_decode_uninit ( AVCodecContext avctx)

Definition at line 252 of file nvdec.c.

Referenced by ff_nvdec_decode_init().

int ff_nvdec_decode_init ( AVCodecContext avctx)

Definition at line 270 of file nvdec.c.

static void nvdec_fdd_priv_free ( void priv)
static

Definition at line 350 of file nvdec.c.

Referenced by ff_nvdec_start_frame().

static void nvdec_unmap_mapped_frame ( void opaque,
uint8_t data 
)
static

Definition at line 363 of file nvdec.c.

static int nvdec_retrieve_data ( void logctx,
AVFrame frame 
)
static

Definition at line 389 of file nvdec.c.

Referenced by ff_nvdec_start_frame().

int ff_nvdec_start_frame ( AVCodecContext avctx,
AVFrame frame 
)
int ff_nvdec_end_frame ( AVCodecContext avctx)

Definition at line 503 of file nvdec.c.

Referenced by ff_nvdec_simple_end_frame().

int ff_nvdec_simple_end_frame ( AVCodecContext avctx)

Definition at line 537 of file nvdec.c.

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

Definition at line 545 of file nvdec.c.

Referenced by nvdec_mjpeg_start_frame(), and nvdec_mpeg4_start_frame().

static void nvdec_free_dummy ( struct AVHWFramesContext ctx)
static

Definition at line 567 of file nvdec.c.

Referenced by ff_nvdec_frame_params().

static AVBufferRef* nvdec_alloc_dummy ( int  size)
static

Definition at line 572 of file nvdec.c.

Referenced by ff_nvdec_frame_params().

int ff_nvdec_frame_params ( AVCodecContext avctx,
AVBufferRef hw_frames_ctx,
int  dpb_size 
)
int ff_nvdec_get_ref_idx ( AVFrame frame)