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 |
|
|
|
32 |
|
✗ |
const DNNModule *ff_get_dnn_module(DNNBackendType backend_type, void *log_ctx) |
33 |
|
|
{ |
34 |
|
|
switch(backend_type){ |
35 |
|
|
#if (CONFIG_LIBTENSORFLOW == 1) |
36 |
|
|
case DNN_TF: |
37 |
|
|
return &ff_dnn_backend_tf; |
38 |
|
|
#endif |
39 |
|
|
#if (CONFIG_LIBOPENVINO == 1) |
40 |
|
|
case DNN_OV: |
41 |
|
|
return &ff_dnn_backend_openvino; |
42 |
|
|
#endif |
43 |
|
|
default: |
44 |
|
✗ |
av_log(log_ctx, AV_LOG_ERROR, |
45 |
|
|
"Module backend_type %d is not supported or enabled.\n", |
46 |
|
|
backend_type); |
47 |
|
✗ |
return NULL; |
48 |
|
|
} |
49 |
|
|
} |
50 |
|
|
|