23 if (!
ctx->model_filename) {
27 if (!
ctx->model_inputname) {
31 if (!
ctx->model_outputname) {
37 if (!
ctx->dnn_module) {
41 if (!
ctx->dnn_module->load_model) {
46 ctx->model = (
ctx->dnn_module->load_model)(
ctx->model_filename, func_type,
ctx->backend_options,
filter_ctx);
52 if (!
ctx->dnn_module->execute_model_async &&
ctx->async) {
57 #if !HAVE_PTHREAD_CANCEL
69 return ctx->model->get_input(
ctx->model->model, input,
ctx->model_inputname);
74 return ctx->model->get_output(
ctx->model->model,
ctx->model_inputname, input_width, input_height,
75 ctx->model_outputname, output_width, output_height);
80 return (
ctx->dnn_module->execute_model)(
ctx->model,
ctx->model_inputname, in_frame,
81 (
const char **)&
ctx->model_outputname, 1, out_frame);
86 return (
ctx->dnn_module->execute_model_async)(
ctx->model,
ctx->model_inputname, in_frame,
87 (
const char **)&
ctx->model_outputname, 1, out_frame);
92 return (
ctx->dnn_module->get_async_result)(
ctx->model, in_frame, out_frame);
97 return (
ctx->dnn_module->flush)(
ctx->model);
102 if (
ctx->dnn_module) {
103 (
ctx->dnn_module->free_model)(&
ctx->model);
DNNReturnType ff_dnn_execute_model_async(DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame)
DNNAsyncStatusType ff_dnn_get_async_result(DnnContext *ctx, AVFrame **in_frame, AVFrame **out_frame)
void ff_dnn_uninit(DnnContext *ctx)
DNNReturnType ff_dnn_execute_model(DnnContext *ctx, AVFrame *in_frame, AVFrame *out_frame)
DNNReturnType ff_dnn_get_input(DnnContext *ctx, DNNData *input)
DNNReturnType ff_dnn_flush(DnnContext *ctx)
DNNReturnType ff_dnn_get_output(DnnContext *ctx, int input_width, int input_height, int *output_width, int *output_height)
int ff_dnn_init(DnnContext *ctx, DNNFunctionType func_type, AVFilterContext *filter_ctx)
common functions for the dnn based filters
DNNModule * ff_get_dnn_module(DNNBackendType backend_type)
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
This structure describes decoded (raw) audio or video data.
static FilteringContext * filter_ctx