FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
cuvid.c File Reference
#include "compat/cuda/dynlink_loader.h"
#include "libavutil/buffer.h"
#include "libavutil/mathematics.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_cuda_internal.h"
#include "libavutil/fifo.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "decode.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  CuvidContext
 
struct  CuvidParsedFrame
 

Macros

#define CHECK_CU(x)   check_cu(avctx, (x), #x)
 
#define OFFSET(x)   offsetof(CuvidContext, x)
 
#define VD   AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM
 
#define DEFINE_CUVID_CODEC(x, X)
 

Functions

static int check_cu (AVCodecContext *avctx, CUresult err, const char *func)
 
static int CUDAAPI cuvid_handle_video_sequence (void *opaque, CUVIDEOFORMAT *format)
 
static int CUDAAPI cuvid_handle_picture_decode (void *opaque, CUVIDPICPARAMS *picparams)
 
static int CUDAAPI cuvid_handle_picture_display (void *opaque, CUVIDPARSERDISPINFO *dispinfo)
 
static int cuvid_is_buffer_full (AVCodecContext *avctx)
 
static int cuvid_decode_packet (AVCodecContext *avctx, const AVPacket *avpkt)
 
static int cuvid_output_frame (AVCodecContext *avctx, AVFrame *frame)
 
static int cuvid_decode_frame (AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
 
static av_cold int cuvid_decode_end (AVCodecContext *avctx)
 
static int cuvid_test_capabilities (AVCodecContext *avctx, const CUVIDPARSERPARAMS *cuparseinfo, int probed_width, int probed_height, int bit_depth)
 
static av_cold int cuvid_decode_init (AVCodecContext *avctx)
 
static void cuvid_flush (AVCodecContext *avctx)
 

Variables

static const AVOption options []
 

Macro Definition Documentation

#define CHECK_CU (   x)    check_cu(avctx, (x), #x)
#define OFFSET (   x)    offsetof(CuvidContext, x)

Definition at line 1082 of file cuvid.c.

Definition at line 1083 of file cuvid.c.

#define DEFINE_CUVID_CODEC (   x,
 
)

Definition at line 1097 of file cuvid.c.

Function Documentation

static int check_cu ( AVCodecContext avctx,
CUresult  err,
const char *  func 
)
static

Definition at line 95 of file cuvid.c.

static int CUDAAPI cuvid_handle_video_sequence ( void opaque,
CUVIDEOFORMAT format 
)
static

Definition at line 119 of file cuvid.c.

Referenced by cuvid_decode_init().

static int CUDAAPI cuvid_handle_picture_decode ( void opaque,
CUVIDPICPARAMS picparams 
)
static

Definition at line 335 of file cuvid.c.

Referenced by cuvid_decode_init().

static int CUDAAPI cuvid_handle_picture_display ( void opaque,
CUVIDPARSERDISPINFO dispinfo 
)
static

Definition at line 349 of file cuvid.c.

Referenced by cuvid_decode_init().

static int cuvid_is_buffer_full ( AVCodecContext avctx)
static

Definition at line 372 of file cuvid.c.

Referenced by cuvid_output_frame().

static int cuvid_decode_packet ( AVCodecContext avctx,
const AVPacket avpkt 
)
static

Definition at line 379 of file cuvid.c.

Referenced by cuvid_decode_frame(), and cuvid_output_frame().

static int cuvid_output_frame ( AVCodecContext avctx,
AVFrame frame 
)
static

Definition at line 469 of file cuvid.c.

Referenced by cuvid_decode_frame().

static int cuvid_decode_frame ( AVCodecContext avctx,
void data,
int got_frame,
AVPacket avpkt 
)
static

Definition at line 644 of file cuvid.c.

static av_cold int cuvid_decode_end ( AVCodecContext avctx)
static

Definition at line 675 of file cuvid.c.

Referenced by cuvid_decode_init().

static int cuvid_test_capabilities ( AVCodecContext avctx,
const CUVIDPARSERPARAMS cuparseinfo,
int  probed_width,
int  probed_height,
int  bit_depth 
)
static

Definition at line 700 of file cuvid.c.

Referenced by cuvid_decode_init().

static av_cold int cuvid_decode_init ( AVCodecContext avctx)
static

Definition at line 788 of file cuvid.c.

static void cuvid_flush ( AVCodecContext avctx)
static

Definition at line 1026 of file cuvid.c.

Variable Documentation

const AVOption options[]
static
Initial value:
= {
{ "deint", "Set deinterlacing mode", OFFSET(deint_mode), AV_OPT_TYPE_INT, { .i64 = cudaVideoDeinterlaceMode_Weave }, cudaVideoDeinterlaceMode_Weave, cudaVideoDeinterlaceMode_Adaptive, VD, "deint" },
{ "weave", "Weave deinterlacing (do nothing)", 0, AV_OPT_TYPE_CONST, { .i64 = cudaVideoDeinterlaceMode_Weave }, 0, 0, VD, "deint" },
{ "bob", "Bob deinterlacing", 0, AV_OPT_TYPE_CONST, { .i64 = cudaVideoDeinterlaceMode_Bob }, 0, 0, VD, "deint" },
{ "adaptive", "Adaptive deinterlacing", 0, AV_OPT_TYPE_CONST, { .i64 = cudaVideoDeinterlaceMode_Adaptive }, 0, 0, VD, "deint" },
{ "gpu", "GPU to be used for decoding", OFFSET(cu_gpu), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VD },
{ "surfaces", "Maximum surfaces to be used for decoding", OFFSET(nb_surfaces), AV_OPT_TYPE_INT, { .i64 = 25 }, 0, INT_MAX, VD },
{ "drop_second_field", "Drop second field when deinterlacing", OFFSET(drop_second_field), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
{ "crop", "Crop (top)x(bottom)x(left)x(right)", OFFSET(crop_expr), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VD },
{ "resize", "Resize (width)x(height)", OFFSET(resize_expr), AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, VD },
{ NULL }
}
#define NULL
Definition: coverity.c:32
#define VD
Definition: cuvid.c:1083
#define OFFSET(x)
Definition: cuvid.c:1082

Definition at line 1084 of file cuvid.c.