FFmpeg
Data Structures | Macros | Functions | Variables
dnn_interface.c File Reference
#include "../dnn_interface.h"
#include "libavutil/avassert.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
#include "libavfilter/filters.h"

Go to the source code of this file.

Data Structures

struct  DnnBackendInfo
 

Macros

#define OFFSET(x)   offsetof(DnnContext, x)
 
#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM
 

Functions

 AVFILTER_DEFINE_CLASS (dnn_base)
 
const DNNModuleff_get_dnn_module (DNNBackendType backend_type, void *log_ctx)
 
void ff_dnn_init_child_class (DnnContext *ctx)
 
void * ff_dnn_child_next (DnnContext *obj, void *prev)
 
const AVClassff_dnn_child_class_iterate_with_mask (void **iter, uint32_t backend_mask)
 

Variables

const DNNModule ff_dnn_backend_openvino
 
const DNNModule ff_dnn_backend_tf
 
const DNNModule ff_dnn_backend_torch
 
static const AVOption dnn_base_options []
 
static const DnnBackendInfo dnn_backend_info_list []
 

Detailed Description

Implements DNN module initialization with specified backend.

Definition in file dnn_interface.c.

Macro Definition Documentation

◆ OFFSET

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

Definition at line 37 of file dnn_interface.c.

◆ FLAGS

#define FLAGS   AV_OPT_FLAG_FILTERING_PARAM

Definition at line 38 of file dnn_interface.c.

Function Documentation

◆ AVFILTER_DEFINE_CLASS()

AVFILTER_DEFINE_CLASS ( dnn_base  )

◆ ff_get_dnn_module()

const DNNModule* ff_get_dnn_module ( DNNBackendType  backend_type,
void *  log_ctx 
)

Definition at line 83 of file dnn_interface.c.

Referenced by ff_dnn_init().

◆ ff_dnn_init_child_class()

void ff_dnn_init_child_class ( DnnContext ctx)

Definition at line 96 of file dnn_interface.c.

Referenced by ff_dnn_filter_init_child_class().

◆ ff_dnn_child_next()

void* ff_dnn_child_next ( DnnContext obj,
void *  prev 
)

Definition at line 104 of file dnn_interface.c.

Referenced by ff_dnn_filter_child_next(), and ff_dnn_init().

◆ ff_dnn_child_class_iterate_with_mask()

const AVClass* ff_dnn_child_class_iterate_with_mask ( void **  iter,
uint32_t  backend_mask 
)

Definition at line 124 of file dnn_interface.c.

Variable Documentation

◆ ff_dnn_backend_openvino

const DNNModule ff_dnn_backend_openvino

Referenced by get_output_ov().

◆ ff_dnn_backend_tf

const DNNModule ff_dnn_backend_tf

Definition at line 886 of file dnn_backend_tf.c.

◆ ff_dnn_backend_torch

const DNNModule ff_dnn_backend_torch

◆ dnn_base_options

const AVOption dnn_base_options[]
static
Initial value:
= {
{"model", "path to model file",
OFFSET(model_filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS},
{"input", "input name of the model",
OFFSET(model_inputname), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS},
{"output", "output name of the model",
OFFSET(model_outputnames_string), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS},
{"backend_configs", "backend configs (deprecated)",
OFFSET(backend_options), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS | AV_OPT_FLAG_DEPRECATED},
{"options", "backend configs (deprecated)",
OFFSET(backend_options), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS | AV_OPT_FLAG_DEPRECATED},
{"nireq", "number of request",
OFFSET(nireq), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, FLAGS},
{"async", "use DNN async inference",
OFFSET(async), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, FLAGS},
{"device", "device to run model",
OFFSET(device), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS},
{NULL}
}

Definition at line 39 of file dnn_interface.c.

◆ dnn_backend_info_list

const DnnBackendInfo dnn_backend_info_list[]
static
Initial value:
= {
{0, .class = &dnn_base_class},
}

Definition at line 69 of file dnn_interface.c.

Referenced by ff_dnn_child_class_iterate_with_mask(), ff_dnn_child_next(), ff_dnn_init_child_class(), and ff_get_dnn_module().

NULL
#define NULL
Definition: coverity.c:32
FLAGS
#define FLAGS
Definition: dnn_interface.c:38
AV_OPT_FLAG_DEPRECATED
#define AV_OPT_FLAG_DEPRECATED
Set if option is deprecated, users should refer to AVOption.help text for more information.
Definition: opt.h:386
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
AV_OPT_TYPE_BOOL
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
Definition: opt.h:327
OFFSET
#define OFFSET(x)
Definition: dnn_interface.c:37
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276