Doxygen Book
gstdatarepo.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
13 #include "gstdatarepo.h"
14 #include "gstdatareposrc.h"
15 #include "gstdatareposink.h"
16 
22 {
23  const gchar *name;
24 
25  g_return_val_if_fail (GST_IS_CAPS (caps), GST_DATA_REPO_DATA_UNKNOWN);
26 
27  name = gst_structure_get_name (gst_caps_get_structure (caps, 0));
28  g_return_val_if_fail (name != NULL, GST_DATA_REPO_DATA_UNKNOWN);
29 
30  if (g_ascii_strcasecmp (name, "other/tensors") == 0) {
32  } else if (g_ascii_strcasecmp (name, "video/x-raw") == 0) {
34  } else if (g_ascii_strcasecmp (name, "audio/x-raw") == 0) {
36  } else if (g_ascii_strcasecmp (name, "text/x-raw") == 0) {
38  } else if (g_ascii_strcasecmp (name, "application/octet-stream") == 0) {
40  } else if (g_ascii_strcasecmp (name, "image/png") == 0
41  || g_ascii_strcasecmp (name, "image/jpeg") == 0
42  || g_ascii_strcasecmp (name, "image/tiff") == 0
43  || g_ascii_strcasecmp (name, "image/gif") == 0) {
45  }
46 
47  GST_ERROR ("Could not get a data type from caps.");
49 }
50 
54 static gboolean
55 plugin_init (GstPlugin * plugin)
56 {
57  if (!gst_element_register (plugin, "datareposrc", GST_RANK_NONE,
59  return FALSE;
60 
61  if (!gst_element_register (plugin, "datareposink", GST_RANK_NONE,
63  return FALSE;
64 
65  return TRUE;
66 }
67 
68 #ifndef PACKAGE
69 #define PACKAGE "NNStreamer MLOps Data Repository Plugins"
70 #endif
71 
72 GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
73  GST_VERSION_MINOR,
74  datarepo,
75  "NNStreamer MLOps Data Repository plugin library",
76  plugin_init, VERSION, "LGPL", PACKAGE,
77  "https://github.com/nnstreamer/nnstreamer")
GST_DATA_REPO_DATA_VIDEO
@ GST_DATA_REPO_DATA_VIDEO
Definition: gstdatarepo.h:26
gstdatareposink.h
FALSE
return FALSE
Definition: gsttensor_transform.c:590
GST_DATA_REPO_DATA_IMAGE
@ GST_DATA_REPO_DATA_IMAGE
Definition: gstdatarepo.h:31
GST_DATA_REPO_DATA_TEXT
@ GST_DATA_REPO_DATA_TEXT
Definition: gstdatarepo.h:28
GST_TYPE_DATA_REPO_SRC
#define GST_TYPE_DATA_REPO_SRC
Definition: gstdatareposrc.h:24
GstDataRepoDataType
GstDataRepoDataType
Data type of incoming buffer.
Definition: gstdatarepo.h:23
GST_DATA_REPO_DATA_UNKNOWN
@ GST_DATA_REPO_DATA_UNKNOWN
Definition: gstdatarepo.h:25
gst_data_repo_get_data_type_from_caps
GstDataRepoDataType gst_data_repo_get_data_type_from_caps(const GstCaps *caps)
Get data type from caps.
Definition: gstdatarepo.c:21
gstdatarepo.h
GStreamer plugin to read file in MLOps Data repository into buffers.
PACKAGE
#define PACKAGE
Definition: gstdatarepo.c:69
TRUE
return TRUE
Definition: gsttensor_if.c:897
GST_TYPE_DATA_REPO_SINK
#define GST_TYPE_DATA_REPO_SINK
Definition: gstdatareposink.h:22
GST_PLUGIN_DEFINE
GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR, nnstreamer, "NNStreamer plugin library allows neural networks in GStreamer pipelines. Use nnstreamer-check utility for more information of the current NNStreamer installation.", gst_nnstreamer_init, VERSION, "LGPL", "nnstreamer", "https://github.com/nnstreamer/nnstreamer")
GST_DATA_REPO_DATA_OCTET
@ GST_DATA_REPO_DATA_OCTET
Definition: gstdatarepo.h:29
GST_DATA_REPO_DATA_TENSOR
@ GST_DATA_REPO_DATA_TENSOR
Definition: gstdatarepo.h:30
plugin_init
static gboolean plugin_init(GstPlugin *plugin)
The entry point of the Gstreamer datarepo plugin.
Definition: gstdatarepo.c:55
GST_DATA_REPO_DATA_AUDIO
@ GST_DATA_REPO_DATA_AUDIO
Definition: gstdatarepo.h:27
gstdatareposrc.h
GStreamer plugin to read file in MLOps Data repository into buffers.
GST_ERROR
GST_ERROR("Failed to register nnstreamer plugin : tensor_" # name)
type)) { \