Line data Source code
1 : /* SPDX-License-Identifier: LGPL-2.1-only */
2 : /**
3 : * nnstreamer registerer for gRPC plugin
4 : * Copyright (C) 2020 Dongju Chae <dongju.chae@samsung.com>
5 : */
6 :
7 : /**
8 : * @file grpc.c
9 : * @date 22 Oct 2020
10 : * @brief Registers nnstreamer extension plugin for gRPC
11 : * @see https://github.com/nnstreamer/nnstreamer
12 : * @author Dongju Chae <dongju.chae@samsung.com>
13 : * @bug No known bugs except for NYI items
14 : */
15 :
16 : #ifdef HAVE_CONFIG_H
17 : #include <config.h>
18 : #endif
19 :
20 : #include <gst/gst.h>
21 :
22 : #include <tensor_src_grpc.h>
23 : #include <tensor_sink_grpc.h>
24 :
25 : #define NNSTREAMER_GRPC_INIT(plugin,name,type) \
26 : do { \
27 : if (!gst_element_register (plugin, "tensor_" # name, GST_RANK_NONE, GST_TYPE_TENSOR_ ## type)) { \
28 : GST_ERROR ("Failed to register nnstreamer plugin : tensor_" # name); \
29 : return FALSE; \
30 : } \
31 : } while (0)
32 :
33 : /**
34 : * @brief Function to initialize all nnstreamer elements
35 : */
36 : static gboolean
37 37 : gst_nnstreamer_grpc_init (GstPlugin * plugin)
38 : {
39 37 : NNSTREAMER_GRPC_INIT (plugin, src_grpc, SRC_GRPC);
40 37 : NNSTREAMER_GRPC_INIT (plugin, sink_grpc, SINK_GRPC);
41 37 : return TRUE;
42 : }
43 :
44 : #ifndef PACKAGE
45 : #define PACKAGE "nnstreamer_grpc"
46 : #endif
47 :
48 37 : GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
49 : GST_VERSION_MINOR,
50 : nnstreamer_grpc,
51 : "nnstreamer gRPC framework extension",
52 : gst_nnstreamer_grpc_init, VERSION, "LGPL", "nnstreamer",
53 : "https://github.com/nnstreamer/nnstreamer");
|