FFmpeg
Data Structures | Macros | Functions | Variables
vf_hwupload_cuda.c File Reference
#include "libavutil/buffer.h"
#include "libavutil/hwcontext.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  CudaUploadContext
 

Macros

#define OFFSET(x)   offsetof(CudaUploadContext, x)
 
#define FLAGS   (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
 

Functions

static av_cold int cudaupload_init (AVFilterContext *ctx)
 
static av_cold void cudaupload_uninit (AVFilterContext *ctx)
 
static int cudaupload_query_formats (AVFilterContext *ctx)
 
static int cudaupload_config_output (AVFilterLink *outlink)
 
static int cudaupload_filter_frame (AVFilterLink *link, AVFrame *in)
 
 AVFILTER_DEFINE_CLASS (cudaupload)
 

Variables

static const AVOption cudaupload_options []
 
static const AVFilterPad cudaupload_inputs []
 
static const AVFilterPad cudaupload_outputs []
 
const AVFilter ff_vf_hwupload_cuda
 

Macro Definition Documentation

◆ OFFSET

#define OFFSET (   x)    offsetof(CudaUploadContext, x)

Definition at line 159 of file vf_hwupload_cuda.c.

◆ FLAGS

Definition at line 160 of file vf_hwupload_cuda.c.

Function Documentation

◆ cudaupload_init()

static av_cold int cudaupload_init ( AVFilterContext ctx)
static

Definition at line 37 of file vf_hwupload_cuda.c.

◆ cudaupload_uninit()

static av_cold void cudaupload_uninit ( AVFilterContext ctx)
static

Definition at line 47 of file vf_hwupload_cuda.c.

◆ cudaupload_query_formats()

static int cudaupload_query_formats ( AVFilterContext ctx)
static

Definition at line 55 of file vf_hwupload_cuda.c.

◆ cudaupload_config_output()

static int cudaupload_config_output ( AVFilterLink outlink)
static

Definition at line 87 of file vf_hwupload_cuda.c.

◆ cudaupload_filter_frame()

static int cudaupload_filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 123 of file vf_hwupload_cuda.c.

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( cudaupload  )

Variable Documentation

◆ cudaupload_options

const AVOption cudaupload_options[]
static
Initial value:
= {
{ "device", "Number of the device to use", OFFSET(device_idx), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, FLAGS },
{ NULL },
}

Definition at line 161 of file vf_hwupload_cuda.c.

◆ cudaupload_inputs

const AVFilterPad cudaupload_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = cudaupload_filter_frame,
},
{ NULL }
}

Definition at line 168 of file vf_hwupload_cuda.c.

◆ cudaupload_outputs

const AVFilterPad cudaupload_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = cudaupload_config_output,
},
{ NULL }
}

Definition at line 177 of file vf_hwupload_cuda.c.

◆ ff_vf_hwupload_cuda

const AVFilter ff_vf_hwupload_cuda
Initial value:
= {
.name = "hwupload_cuda",
.description = NULL_IF_CONFIG_SMALL("Upload a system memory frame to a CUDA device."),
.init = cudaupload_init,
.uninit = cudaupload_uninit,
.query_formats = cudaupload_query_formats,
.priv_size = sizeof(CudaUploadContext),
.priv_class = &cudaupload_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 186 of file vf_hwupload_cuda.c.

cudaupload_outputs
static const AVFilterPad cudaupload_outputs[]
Definition: vf_hwupload_cuda.c:177
FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:339
cudaupload_init
static av_cold int cudaupload_init(AVFilterContext *ctx)
Definition: vf_hwupload_cuda.c:37
cudaupload_query_formats
static int cudaupload_query_formats(AVFilterContext *ctx)
Definition: vf_hwupload_cuda.c:55
cudaupload_filter_frame
static int cudaupload_filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_hwupload_cuda.c:123
inputs
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several inputs
Definition: filter_design.txt:243
OFFSET
#define OFFSET(x)
Definition: vf_hwupload_cuda.c:159
outputs
static const AVFilterPad outputs[]
Definition: af_acontrast.c:203
NULL
#define NULL
Definition: coverity.c:32
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
cudaupload_config_output
static int cudaupload_config_output(AVFilterLink *outlink)
Definition: vf_hwupload_cuda.c:87
cudaupload_inputs
static const AVFilterPad cudaupload_inputs[]
Definition: vf_hwupload_cuda.c:168
CudaUploadContext
Definition: vf_hwupload_cuda.c:29
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:225
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FLAGS
#define FLAGS
Definition: vf_hwupload_cuda.c:160
cudaupload_uninit
static av_cold void cudaupload_uninit(AVFilterContext *ctx)
Definition: vf_hwupload_cuda.c:47