Line data Source code
1 : /**
2 : * nnstreamer registerer
3 : * Copyright (C) 2018 MyungJoo Ham <myungjoo.ham@samsung.com>
4 : *
5 : * This library is free software; you can redistribute it and/or
6 : * modify it under the terms of the GNU Library General Public
7 : * License as published by the Free Software Foundation;
8 : * version 2.1 of the License.
9 : *
10 : * This library is distributed in the hope that it will be useful,
11 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 : * Library General Public License for more details.
14 : */
15 :
16 : /**
17 : * @mainpage nnstreamer
18 : * @section intro Introduction
19 : * - Introduction : Neural Network Streamer for AI Projects
20 : * @section Program Program Name
21 : * - Program Name : nnstreamer
22 : * - Program Details : It provides a neural network framework connectivities (e.g., tensorflow, caffe) for gstreamer streams.
23 : * Efficient Streaming for AI Projects: Neural network models wanted to use efficient and flexible streaming management as well.
24 : * Intelligent Media Filters!: Use a neural network model as a media filter / converter.
25 : * Composite Models!: Allow to use multiple neural network models in a single stream instance.
26 : * Multi Model Intelligence!: Allow to use multiple sources for neural network models.
27 : * @section INOUTPUT Input/output data
28 : * - INPUT : None
29 : * - OUTPUT : None
30 : * @section CREATEINFO Code information
31 : * - Initial date : 2018/06/14
32 : * - Version : 0.1
33 : */
34 :
35 : /**
36 : * @file nnstreamer.c
37 : * @date 11 Oct 2018
38 : * @brief Registers all nnstreamer plugins for gstreamer so that we can have a single big binary
39 : * @see https://github.com/nnstreamer/nnstreamer
40 : * @author MyungJoo Ham <myungjoo.ham@samsung.com>
41 : * @bug No known bugs except for NYI items
42 : */
43 :
44 : #ifdef HAVE_CONFIG_H
45 : #include <config.h>
46 : #endif
47 :
48 : #include <gst/gst.h>
49 :
50 : #include <elements/gsttensor_aggregator.h>
51 : #include <elements/gsttensor_converter.h>
52 : #include <elements/gsttensor_crop.h>
53 : #include <elements/gsttensor_debug.h>
54 : #include <elements/gsttensor_decoder.h>
55 : #include <elements/gsttensor_demux.h>
56 : #include <elements/gsttensor_if.h>
57 : #include <elements/gsttensor_merge.h>
58 : #include <elements/gsttensor_mux.h>
59 : #include <elements/gsttensor_rate.h>
60 : #include <elements/gsttensor_reposink.h>
61 : #include <elements/gsttensor_reposrc.h>
62 : #include <elements/gsttensor_sink.h>
63 : #include <elements/gsttensor_sparsedec.h>
64 : #include <elements/gsttensor_sparseenc.h>
65 : #include <elements/gsttensor_split.h>
66 : #include <elements/gsttensor_transform.h>
67 : #include <elements/gsttensor_trainer.h>
68 :
69 : #ifdef _ENABLE_SRC_IIO
70 : #include <elements/gsttensor_srciio.h>
71 : #endif
72 :
73 : #include <tensor_filter/tensor_filter.h>
74 : #if defined(ENABLE_NNSTREAMER_EDGE)
75 : #include <tensor_query/tensor_query_serversrc.h>
76 : #include <tensor_query/tensor_query_serversink.h>
77 : #include <tensor_query/tensor_query_client.h>
78 : #endif
79 :
80 : #define NNSTREAMER_INIT(plugin,name,type) \
81 : do { \
82 : if (!gst_element_register (plugin, "tensor_" # name, GST_RANK_NONE, GST_TYPE_TENSOR_ ## type)) { \
83 : GST_ERROR ("Failed to register nnstreamer plugin : tensor_" # name); \
84 : return FALSE; \
85 : } \
86 : } while (0)
87 :
88 : /**
89 : * @brief Function to initialize all nnstreamer elements
90 : */
91 : static gboolean
92 444 : gst_nnstreamer_init (GstPlugin * plugin)
93 : {
94 444 : NNSTREAMER_INIT (plugin, aggregator, AGGREGATOR);
95 444 : NNSTREAMER_INIT (plugin, converter, CONVERTER);
96 444 : NNSTREAMER_INIT (plugin, crop, CROP);
97 444 : NNSTREAMER_INIT (plugin, debug, DEBUG);
98 444 : NNSTREAMER_INIT (plugin, decoder, DECODER);
99 444 : NNSTREAMER_INIT (plugin, demux, DEMUX);
100 444 : NNSTREAMER_INIT (plugin, filter, FILTER);
101 444 : NNSTREAMER_INIT (plugin, merge, MERGE);
102 444 : NNSTREAMER_INIT (plugin, mux, MUX);
103 444 : NNSTREAMER_INIT (plugin, reposink, REPOSINK);
104 444 : NNSTREAMER_INIT (plugin, reposrc, REPOSRC);
105 444 : NNSTREAMER_INIT (plugin, sink, SINK);
106 444 : NNSTREAMER_INIT (plugin, sparse_enc, SPARSE_ENC);
107 444 : NNSTREAMER_INIT (plugin, sparse_dec, SPARSE_DEC);
108 444 : NNSTREAMER_INIT (plugin, split, SPLIT);
109 444 : NNSTREAMER_INIT (plugin, transform, TRANSFORM);
110 444 : NNSTREAMER_INIT (plugin, if, IF);
111 444 : NNSTREAMER_INIT (plugin, rate, RATE);
112 444 : NNSTREAMER_INIT (plugin, trainer, TRAINER);
113 : #if defined(ENABLE_NNSTREAMER_EDGE)
114 444 : NNSTREAMER_INIT (plugin, query_serversrc, QUERY_SERVERSRC);
115 444 : NNSTREAMER_INIT (plugin, query_serversink, QUERY_SERVERSINK);
116 444 : NNSTREAMER_INIT (plugin, query_client, QUERY_CLIENT);
117 : #endif
118 : #ifdef _ENABLE_SRC_IIO
119 444 : NNSTREAMER_INIT (plugin, src_iio, SRC_IIO);
120 : #endif
121 444 : return TRUE;
122 : }
123 :
124 : #ifndef PACKAGE
125 : #define PACKAGE "nnstreamer"
126 : #endif
127 :
128 444 : GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
129 : GST_VERSION_MINOR,
130 : nnstreamer,
131 : "NNStreamer plugin library allows neural networks in GStreamer pipelines. Use nnstreamer-check utility for more information of the current NNStreamer installation.",
132 : gst_nnstreamer_init, VERSION, "LGPL", "nnstreamer",
133 : "https://github.com/nnstreamer/nnstreamer");
|