FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
hwcontext_cuda.c File Reference
#include "buffer.h"
#include "common.h"
#include "hwcontext.h"
#include "hwcontext_internal.h"
#include "hwcontext_cuda_internal.h"
#include "mem.h"
#include "pixdesc.h"
#include "pixfmt.h"
#include "imgutils.h"

Go to the source code of this file.

Data Structures

struct  CUDAFramesContext
 

Macros

#define CUDA_FRAME_ALIGNMENT   256
 

Functions

static int cuda_frames_get_constraints (AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
 
static void cuda_buffer_free (void *opaque, uint8_t *data)
 
static AVBufferRefcuda_pool_alloc (void *opaque, int size)
 
static int cuda_frames_init (AVHWFramesContext *ctx)
 
static int cuda_get_buffer (AVHWFramesContext *ctx, AVFrame *frame)
 
static int cuda_transfer_get_formats (AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
 
static int cuda_transfer_data_from (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
 
static int cuda_transfer_data_to (AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
 
static void cuda_device_uninit (AVHWDeviceContext *ctx)
 
static int cuda_device_init (AVHWDeviceContext *ctx)
 
static int cuda_device_create (AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
 

Variables

static enum AVPixelFormat supported_formats []
 
const HWContextType ff_hwcontext_type_cuda
 

Macro Definition Documentation

#define CUDA_FRAME_ALIGNMENT   256

Definition at line 29 of file hwcontext_cuda.c.

Referenced by cuda_frames_init(), and cuda_get_buffer().

Function Documentation

static int cuda_frames_get_constraints ( AVHWDeviceContext ctx,
const void hwconfig,
AVHWFramesConstraints constraints 
)
static

Definition at line 46 of file hwcontext_cuda.c.

static void cuda_buffer_free ( void opaque,
uint8_t data 
)
static

Definition at line 71 of file hwcontext_cuda.c.

Referenced by cuda_pool_alloc().

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

Definition at line 86 of file hwcontext_cuda.c.

Referenced by cuda_frames_init().

static int cuda_frames_init ( AVHWFramesContext ctx)
static

Definition at line 118 of file hwcontext_cuda.c.

static int cuda_get_buffer ( AVHWFramesContext ctx,
AVFrame frame 
)
static

Definition at line 148 of file hwcontext_cuda.c.

static int cuda_transfer_get_formats ( AVHWFramesContext ctx,
enum AVHWFrameTransferDirection  dir,
enum AVPixelFormat **  formats 
)
static

Definition at line 176 of file hwcontext_cuda.c.

static int cuda_transfer_data_from ( AVHWFramesContext ctx,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 194 of file hwcontext_cuda.c.

static int cuda_transfer_data_to ( AVHWFramesContext ctx,
AVFrame dst,
const AVFrame src 
)
static

Definition at line 239 of file hwcontext_cuda.c.

static void cuda_device_uninit ( AVHWDeviceContext ctx)
static

Definition at line 284 of file hwcontext_cuda.c.

Referenced by cuda_device_create(), and cuda_device_init().

static int cuda_device_init ( AVHWDeviceContext ctx)
static

Definition at line 299 of file hwcontext_cuda.c.

Referenced by cuda_device_create().

static int cuda_device_create ( AVHWDeviceContext ctx,
const char *  device,
AVDictionary opts,
int  flags 
)
static

Definition at line 325 of file hwcontext_cuda.c.

Variable Documentation

enum AVPixelFormat supported_formats[]
static
Initial value:
= {
}
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:71
#define AV_PIX_FMT_P016
Definition: pixfmt.h:427
#define AV_PIX_FMT_P010
Definition: pixfmt.h:426
#define AV_PIX_FMT_YUV444P16
Definition: pixfmt.h:392
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
Definition: pixfmt.h:89
#define AV_PIX_FMT_0BGR32
Definition: pixfmt.h:357
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:66
#define AV_PIX_FMT_0RGB32
Definition: pixfmt.h:356

Definition at line 35 of file hwcontext_cuda.c.

Referenced by cuda_frames_get_constraints(), and cuda_frames_init().

const HWContextType ff_hwcontext_type_cuda
Initial value:
= {
.name = "CUDA",
.device_hwctx_size = sizeof(AVCUDADeviceContext),
.frames_priv_size = sizeof(CUDAFramesContext),
.device_create = cuda_device_create,
.device_init = cuda_device_init,
.device_uninit = cuda_device_uninit,
.frames_get_constraints = cuda_frames_get_constraints,
.frames_init = cuda_frames_init,
.frames_get_buffer = cuda_get_buffer,
.transfer_get_formats = cuda_transfer_get_formats,
.transfer_data_to = cuda_transfer_data_to,
.transfer_data_from = cuda_transfer_data_from,
.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_CUDA, AV_PIX_FMT_NONE },
}
static int cuda_frames_get_constraints(AVHWDeviceContext *ctx, const void *hwconfig, AVHWFramesConstraints *constraints)
static int cuda_frames_init(AVHWFramesContext *ctx)
static int cuda_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
static int cuda_device_init(AVHWDeviceContext *ctx)
static int cuda_get_buffer(AVHWFramesContext *ctx, AVFrame *frame)
static int cuda_transfer_get_formats(AVHWFramesContext *ctx, enum AVHWFrameTransferDirection dir, enum AVPixelFormat **formats)
HW acceleration through CUDA.
Definition: pixfmt.h:235
static int cuda_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *src)
This struct is allocated as AVHWDeviceContext.hwctx.
static int cuda_device_create(AVHWDeviceContext *ctx, const char *device, AVDictionary *opts, int flags)
static void cuda_device_uninit(AVHWDeviceContext *ctx)
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64

Definition at line 375 of file hwcontext_cuda.c.