FFmpeg coverage


Directory: ../../../ffmpeg/
File: src/libavfilter/dnn/dnn_interface.c
Date: 2024-04-26 14:42:52
Exec Total Coverage
Lines: 0 3 0.0%
Functions: 0 1 0.0%
Branches: 0 0 -%

Line Branch Exec Source
1 /*
2 * Copyright (c) 2018 Sergey Lavrushkin
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 /**
22 * @file
23 * Implements DNN module initialization with specified backend.
24 */
25
26 #include "../dnn_interface.h"
27 #include "libavutil/mem.h"
28
29 extern const DNNModule ff_dnn_backend_openvino;
30 extern const DNNModule ff_dnn_backend_tf;
31 extern const DNNModule ff_dnn_backend_torch;
32
33 const DNNModule *ff_get_dnn_module(DNNBackendType backend_type, void *log_ctx)
34 {
35 switch(backend_type){
36 #if (CONFIG_LIBTENSORFLOW == 1)
37 case DNN_TF:
38 return &ff_dnn_backend_tf;
39 #endif
40 #if (CONFIG_LIBOPENVINO == 1)
41 case DNN_OV:
42 return &ff_dnn_backend_openvino;
43 #endif
44 #if (CONFIG_LIBTORCH == 1)
45 case DNN_TH:
46 return &ff_dnn_backend_torch;
47 #endif
48 default:
49 av_log(log_ctx, AV_LOG_ERROR,
50 "Module backend_type %d is not supported or enabled.\n",
51 backend_type);
52 return NULL;
53 }
54 }
55