Doxygen Book
edge_src.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
13 #ifdef HAVE_CONFIG_H
14 #include <config.h>
15 #endif
16 
17 #include "edge_src.h"
18 
19 GST_DEBUG_CATEGORY_STATIC (gst_edgesrc_debug);
20 #define GST_CAT_DEFAULT gst_edgesrc_debug
21 
25 static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src",
26  GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS_ANY);
27 
31 enum
32 {
41 
43 };
44 
45 #define gst_edgesrc_parent_class parent_class
46 G_DEFINE_TYPE (GstEdgeSrc, gst_edgesrc, GST_TYPE_BASE_SRC);
47 
48 static void gst_edgesrc_set_property (GObject * object, guint prop_id,
49  const GValue * value, GParamSpec * pspec);
50 static void gst_edgesrc_get_property (GObject * object, guint prop_id,
51  GValue * value, GParamSpec * pspec);
52 static void gst_edgesrc_class_finalize (GObject * object);
53 
54 static gboolean gst_edgesrc_start (GstBaseSrc * basesrc);
55 static gboolean gst_edgesrc_stop (GstBaseSrc * basesrc);
56 static GstFlowReturn gst_edgesrc_create (GstBaseSrc * basesrc, guint64 offset,
57  guint size, GstBuffer ** out_buf);
58 
59 static gchar *gst_edgesrc_get_dest_host (GstEdgeSrc * self);
60 static void gst_edgesrc_set_dest_host (GstEdgeSrc * self,
61  const gchar * dest_host);
62 
63 static guint16 gst_edgesrc_get_dest_port (GstEdgeSrc * self);
64 static void gst_edgesrc_set_dest_port (GstEdgeSrc * self,
65  const guint16 dest_port);
66 
67 static nns_edge_connect_type_e gst_edgesrc_get_connect_type (GstEdgeSrc * self);
68 static void gst_edgesrc_set_connect_type (GstEdgeSrc * self,
69  const nns_edge_connect_type_e connect_type);
70 static GstStateChangeReturn gst_edgesrc_change_state (GstElement * element,
71  GstStateChange transition);
72 
76 static void
78 {
79  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
80  GstElementClass *gstelement_class = GST_ELEMENT_CLASS (klass);
81  GstBaseSrcClass *gstbasesrc_class = GST_BASE_SRC_CLASS (klass);
82 
83  gobject_class->set_property = gst_edgesrc_set_property;
84  gobject_class->get_property = gst_edgesrc_get_property;
85  gobject_class->finalize = gst_edgesrc_class_finalize;
86 
87  g_object_class_install_property (gobject_class, PROP_HOST,
88  g_param_spec_string ("host", "Host",
89  "A self host address (DEPRECATED, has no effect).", DEFAULT_HOST,
90  G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED));
91  g_object_class_install_property (gobject_class, PROP_PORT,
92  g_param_spec_uint ("port", "Port",
93  "A self port number (DEPRECATED, has no effect).",
94  0, 65535, DEFAULT_PORT,
95  G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_DEPRECATED));
96  g_object_class_install_property (gobject_class, PROP_DEST_HOST,
97  g_param_spec_string ("dest-host", "Destination Host",
98  "A host address of edgesink to receive the packets from edgesink",
99  DEFAULT_HOST, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
100  g_object_class_install_property (gobject_class, PROP_DEST_PORT,
101  g_param_spec_uint ("dest-port", "Destination Port",
102  "A port of edgesink to receive the packets from edgesink", 0, 65535,
103  DEFAULT_PORT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
104  g_object_class_install_property (gobject_class, PROP_CONNECT_TYPE,
105  g_param_spec_enum ("connect-type", "Connect Type",
106  "The connections type between edgesink and edgesrc.",
108  G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
109  g_object_class_install_property (gobject_class, PROP_TOPIC,
110  g_param_spec_string ("topic", "Topic",
111  "The main topic of the host and option if necessary. "
112  "(topic)/(optional topic for main topic).", "",
113  G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
114  g_object_class_install_property (gobject_class, PROP_CUSTOM_LIB,
115  g_param_spec_string ("custom-lib", "Custom connection lib path",
116  "User defined custom connection lib path.",
117  "", G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
118 
119  gst_element_class_add_pad_template (gstelement_class,
120  gst_static_pad_template_get (&srctemplate));
121 
122  gst_element_class_set_static_metadata (gstelement_class,
123  "EdgeSrc", "Source/Edge",
124  "Subscribe and push incoming streams", "Samsung Electronics Co., Ltd.");
125 
126  gstbasesrc_class->start = gst_edgesrc_start;
127  gstbasesrc_class->stop = gst_edgesrc_stop;
128  gstbasesrc_class->create = gst_edgesrc_create;
129  gstelement_class->change_state = gst_edgesrc_change_state;
130 
131  GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT,
132  GST_EDGE_ELEM_NAME_SRC, 0, "Edge src");
133 }
134 
138 static void
140 {
141  GstBaseSrc *basesrc = GST_BASE_SRC (self);
142 
143  gst_base_src_set_format (basesrc, GST_FORMAT_TIME);
144  gst_base_src_set_async (basesrc, FALSE);
145 
146  self->dest_host = g_strdup (DEFAULT_HOST);
147  self->dest_port = DEFAULT_PORT;
148  self->topic = NULL;
149  self->msg_queue = g_async_queue_new ();
150  self->connect_type = DEFAULT_CONNECT_TYPE;
151  self->playing = FALSE;
152  self->custom_lib = NULL;
153 }
154 
158 static void
159 gst_edgesrc_set_property (GObject * object, guint prop_id, const GValue * value,
160  GParamSpec * pspec)
161 {
162  GstEdgeSrc *self = GST_EDGESRC (object);
163 
164  switch (prop_id) {
165  case PROP_HOST:
166  nns_logw ("host property is deprecated");
167  break;
168  case PROP_PORT:
169  nns_logw ("port property is deprecated");
170  break;
171  case PROP_DEST_HOST:
172  gst_edgesrc_set_dest_host (self, g_value_get_string (value));
173  break;
174  case PROP_DEST_PORT:
175  gst_edgesrc_set_dest_port (self, g_value_get_uint (value));
176  break;
177  case PROP_CONNECT_TYPE:
178  gst_edgesrc_set_connect_type (self, g_value_get_enum (value));
179  break;
180  case PROP_TOPIC:
181  if (!g_value_get_string (value)) {
182  nns_logw ("topic property cannot be NULL. Query-hybrid is disabled.");
183  break;
184  }
185  g_free (self->topic);
186  self->topic = g_value_dup_string (value);
187  break;
188  case PROP_CUSTOM_LIB:
189  g_free (self->custom_lib);
190  self->custom_lib = g_value_dup_string (value);
191  break;
192  default:
193  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
194  break;
195  }
196 }
197 
201 static void
202 gst_edgesrc_get_property (GObject * object, guint prop_id, GValue * value,
203  GParamSpec * pspec)
204 {
205  GstEdgeSrc *self = GST_EDGESRC (object);
206 
207  switch (prop_id) {
208  case PROP_HOST:
209  nns_logw ("host property is deprecated");
210  break;
211  case PROP_PORT:
212  nns_logw ("port property is deprecated");
213  break;
214  case PROP_DEST_HOST:
216  break;
217  case PROP_DEST_PORT:
218  g_value_set_uint (value, gst_edgesrc_get_dest_port (self));
219  break;
220  case PROP_CONNECT_TYPE:
221  g_value_set_enum (value, gst_edgesrc_get_connect_type (self));
222  break;
223  case PROP_TOPIC:
224  g_value_set_string (value, self->topic);
225  break;
226  case PROP_CUSTOM_LIB:
227  g_value_set_string (value, self->custom_lib);
228  break;
229  default:
230  G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
231  break;
232  }
233 }
234 
238 static void
239 gst_edgesrc_class_finalize (GObject * object)
240 {
241  GstEdgeSrc *self = GST_EDGESRC (object);
242  nns_edge_data_h data_h;
243 
244  self->playing = FALSE;
245  g_free (self->dest_host);
246  self->dest_host = NULL;
247 
248  g_free (self->topic);
249  self->topic = NULL;
250 
251  g_free (self->custom_lib);
252  self->custom_lib = NULL;
253 
254  if (self->msg_queue) {
255  while ((data_h = g_async_queue_try_pop (self->msg_queue))) {
256  nns_edge_data_destroy (data_h);
257  }
258  g_async_queue_unref (self->msg_queue);
259  self->msg_queue = NULL;
260  }
261 
262  if (self->edge_h) {
263  nns_edge_release_handle (self->edge_h);
264  self->edge_h = NULL;
265  }
266  G_OBJECT_CLASS (parent_class)->finalize (object);
267 }
268 
272 static GstStateChangeReturn
273 gst_edgesrc_change_state (GstElement * element, GstStateChange transition)
274 {
275  GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
276  GstEdgeSrc *self = GST_EDGESRC (element);
277 
278  switch (transition) {
279  case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
280  GST_INFO_OBJECT (self, "State changed from PAUSED to PLAYING.");
281  self->playing = TRUE;
282  break;
283  default:
284  break;
285  }
286 
287  ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
288 
289  switch (transition) {
290  case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
291  GST_INFO_OBJECT (self, "State changed from PLAYING to PAUSED.");
292  self->playing = FALSE;
293  break;
294  default:
295  break;
296  }
297 
298  return ret;
299 }
300 
304 static int
305 _nns_edge_event_cb (nns_edge_event_h event_h, void *user_data)
306 {
307  nns_edge_event_e event_type;
308  int ret = NNS_EDGE_ERROR_NONE;
309 
310  GstEdgeSrc *self = GST_EDGESRC (user_data);
311 
312  if (0 != nns_edge_event_get_type (event_h, &event_type)) {
313  nns_loge ("Failed to get event type!");
314  return NNS_EDGE_ERROR_UNKNOWN;
315  }
316 
317  switch (event_type) {
318  case NNS_EDGE_EVENT_NEW_DATA_RECEIVED:
319  {
320  nns_edge_data_h data;
321 
322  nns_edge_event_parse_new_data (event_h, &data);
323  g_async_queue_push (self->msg_queue, data);
324  break;
325  }
326  case NNS_EDGE_EVENT_CONNECTION_CLOSED:
327  {
328  self->playing = FALSE;
329  break;
330  }
331  default:
332  break;
333  }
334 
335  return ret;
336 }
337 
341 static gboolean
342 gst_edgesrc_start (GstBaseSrc * basesrc)
343 {
344  GstEdgeSrc *self = GST_EDGESRC (basesrc);
345 
346  int ret;
347  char *port = NULL;
348 
349  if (NNS_EDGE_CONNECT_TYPE_CUSTOM != self->connect_type) {
350  ret = nns_edge_create_handle (NULL, self->connect_type,
351  NNS_EDGE_NODE_TYPE_SUB, &self->edge_h);
352  } else {
353  if (!self->custom_lib) {
354  nns_loge ("Failed to create custom handle. custom-lib path is not set.");
355  return FALSE;
356  }
357  ret = nns_edge_custom_create_handle (NULL, self->custom_lib,
358  NNS_EDGE_NODE_TYPE_SUB, &self->edge_h);
359  }
360 
361  if (NNS_EDGE_ERROR_NONE != ret) {
362  nns_loge ("Failed to get nnstreamer edge handle.");
363 
364  if (self->edge_h) {
365  nns_edge_release_handle (self->edge_h);
366  self->edge_h = NULL;
367  }
368 
369  return FALSE;
370  }
371 
372  if (self->dest_host)
373  nns_edge_set_info (self->edge_h, "DEST_HOST", self->dest_host);
374  if (self->dest_port > 0) {
375  port = g_strdup_printf ("%u", self->dest_port);
376  nns_edge_set_info (self->edge_h, "DEST_PORT", port);
377  g_free (port);
378  }
379  if (self->topic)
380  nns_edge_set_info (self->edge_h, "TOPIC", self->topic);
381 
382  nns_edge_set_event_callback (self->edge_h, _nns_edge_event_cb, self);
383 
384  if (0 != nns_edge_start (self->edge_h)) {
385  nns_loge
386  ("Failed to start NNStreamer-edge. Please check server IP and port");
387  return FALSE;
388  }
389 
390  if (0 != nns_edge_connect (self->edge_h, self->dest_host, self->dest_port)) {
391  nns_loge ("Failed to connect to edge server!");
392  return FALSE;
393  }
394  self->playing = TRUE;
395 
396  return TRUE;
397 }
398 
402 static gboolean
403 gst_edgesrc_stop (GstBaseSrc * basesrc)
404 {
405  GstEdgeSrc *self = GST_EDGESRC (basesrc);
406  int ret;
407 
408  self->playing = FALSE;
409  ret = nns_edge_stop (self->edge_h);
410 
411  if (NNS_EDGE_ERROR_NONE != ret) {
412  nns_loge ("Failed to stop edgesrc. error code(%d)", ret);
413  return FALSE;
414  }
415 
416  return TRUE;
417 }
418 
422 static GstFlowReturn
423 gst_edgesrc_create (GstBaseSrc * basesrc, guint64 offset, guint size,
424  GstBuffer ** out_buf)
425 {
426  GstEdgeSrc *self = GST_EDGESRC (basesrc);
427  nns_edge_data_h data_h = NULL;
428  GstBuffer *buffer = NULL;
429  GstMemory *mem;
430  GstCaps *caps = NULL;
431  GstStructure *structure;
432  GstTensorsConfig config;
433  GstTensorInfo *_info;
434  gboolean is_tensor = FALSE;
435  guint i, num_data, max_mems;
436  int ret;
437 
438  UNUSED (offset);
439  UNUSED (size);
440  gst_tensors_config_init (&config);
441 
442  while (self->playing && !data_h) {
443  data_h = g_async_queue_timeout_pop (self->msg_queue, G_USEC_PER_SEC);
444  }
445 
446  if (!data_h) {
447  nns_loge ("Failed to get message from the edgesrc message queue.");
448  return GST_FLOW_ERROR;
449  }
450 
451  ret = nns_edge_data_get_count (data_h, &num_data);
452  if (ret != NNS_EDGE_ERROR_NONE || num_data == 0) {
453  nns_loge ("Failed to get the number of memories of the edge data.");
454  goto done;
455  }
456 
457  /* Check current caps and max memory. */
458  caps = gst_pad_get_current_caps (GST_BASE_SRC_PAD (basesrc));
459  if (caps) {
460  structure = gst_caps_get_structure (caps, 0);
461  is_tensor = gst_structure_is_tensor_stream (structure);
462 
463  if (is_tensor)
464  gst_tensors_config_from_structure (&config, structure);
465 
466  gst_caps_unref (caps);
467  }
468 
469  max_mems = is_tensor ? NNS_TENSOR_SIZE_LIMIT : gst_buffer_get_max_memory ();
470  if (num_data > max_mems) {
471  nns_loge
472  ("Cannot create new buffer. The edge-data has %u memories, but allowed memories is %u.",
473  num_data, max_mems);
474  goto done;
475  }
476 
477  buffer = gst_buffer_new ();
478  for (i = 0; i < num_data; i++) {
479  void *data = NULL;
480  nns_size_t data_len = 0;
481  gpointer new_data;
482 
483  nns_edge_data_get (data_h, i, &data, &data_len);
484  new_data = _g_memdup (data, data_len);
485  mem = gst_memory_new_wrapped (0, new_data, data_len, 0, data_len,
486  new_data, g_free);
487 
488  if (is_tensor) {
489  _info = gst_tensors_info_get_nth_info (&config.info, i);
490  gst_tensor_buffer_append_memory (buffer, mem, _info);
491  } else {
492  gst_buffer_append_memory (buffer, mem);
493  }
494  }
495 
496 done:
497  if (data_h)
498  nns_edge_data_destroy (data_h);
499 
500  gst_tensors_config_free (&config);
501 
502  if (buffer == NULL) {
503  nns_loge ("Failed to get buffer to push to the edgesrc.");
504  return GST_FLOW_ERROR;
505  }
506 
507  *out_buf = buffer;
508 
509  return GST_FLOW_OK;
510 }
511 
515 static gchar *
517 {
518  return self->dest_host;
519 }
520 
524 static void
525 gst_edgesrc_set_dest_host (GstEdgeSrc * self, const gchar * dest_host)
526 {
527  g_free (self->dest_host);
528  self->dest_host = g_strdup (dest_host);
529 }
530 
534 static guint16
536 {
537  return self->dest_port;
538 }
539 
543 static void
544 gst_edgesrc_set_dest_port (GstEdgeSrc * self, const guint16 dest_port)
545 {
546  self->dest_port = dest_port;
547 }
548 
552 static nns_edge_connect_type_e
554 {
555  return self->connect_type;
556 }
557 
561 static void
563  const nns_edge_connect_type_e connect_type)
564 {
565  self->connect_type = connect_type;
566 }
data
svtc_1 data
Definition: gsttensor_if.c:844
GstTensorInfo
Internal data structure for tensor info.
Definition: tensor_typedef.h:261
gst_edgesrc_set_dest_host
static void gst_edgesrc_set_dest_host(GstEdgeSrc *self, const gchar *dest_host)
setter for the 'host' property.
Definition: edge_src.c:525
NNS_TENSOR_SIZE_LIMIT
#define NNS_TENSOR_SIZE_LIMIT
The number of tensors NNStreamer supports is 256. The max memories of gst-buffer is 16 (See NNS_TENSO...
Definition: tensor_typedef.h:42
gst_edgesrc_get_dest_port
static guint16 gst_edgesrc_get_dest_port(GstEdgeSrc *self)
getter for the 'port' property.
Definition: edge_src.c:535
PROP_CUSTOM_LIB
@ PROP_CUSTOM_LIB
Definition: edge_src.c:40
FALSE
return FALSE
Definition: gsttensor_transform.c:590
PROP_CONNECT_TYPE
@ PROP_CONNECT_TYPE
Definition: edge_src.c:38
gst_edgesrc_class_init
static void gst_edgesrc_class_init(GstEdgeSrcClass *klass)
initialize the class
Definition: edge_src.c:77
gst_edgesrc_create
static GstFlowReturn gst_edgesrc_create(GstBaseSrc *basesrc, guint64 offset, guint size, GstBuffer **out_buf)
Create a buffer containing the subscribed data.
Definition: edge_src.c:423
gst_edgesrc_set_property
static void gst_edgesrc_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
set property
Definition: edge_src.c:159
edge_src.h
Subscribe and push incoming data to the GStreamer pipeline.
PROP_LAST
@ PROP_LAST
Definition: edge_src.c:42
gst_edgesrc_stop
static gboolean gst_edgesrc_stop(GstBaseSrc *basesrc)
Stop edgesrc, called when state changed ready to null.
Definition: edge_src.c:403
_nns_edge_event_cb
static int _nns_edge_event_cb(nns_edge_event_h event_h, void *user_data)
nnstreamer-edge event callback.
Definition: edge_src.c:305
g_free
g_free(self->option[(opnum) - 1])
opnum: \
g_value_set_string
g_value_set_string(value, self->option[opnum - 1])
opnum: \
gst_edgesrc_set_connect_type
static void gst_edgesrc_set_connect_type(GstEdgeSrc *self, const nns_edge_connect_type_e connect_type)
setter for the 'connect_type' property.
Definition: edge_src.c:562
_g_memdup
#define _g_memdup(data, size)
g_memdup() function replaced by g_memdup2() in glib version >= 2.68
Definition: nnstreamer_util.h:31
gst_edgesrc_get_dest_host
static gchar * gst_edgesrc_get_dest_host(GstEdgeSrc *self)
getter for the 'host' property.
Definition: edge_src.c:516
PROP_PORT
@ PROP_PORT
Definition: edge_src.c:35
PROP_DEST_HOST
@ PROP_DEST_HOST
Definition: edge_src.c:36
GST_EDGESRC
#define GST_EDGESRC(obj)
Definition: edge_src.h:27
_GstEdgeSrc
GstEdgeSrc data structure.
Definition: edge_src.h:42
gst_tensors_config_free
void gst_tensors_config_free(GstTensorsConfig *config)
Free allocated data in tensors config structure.
Definition: nnstreamer_plugin_api_util_impl.c:845
gst_edgesrc_get_connect_type
static nns_edge_connect_type_e gst_edgesrc_get_connect_type(GstEdgeSrc *self)
getter for the 'connect_type' property.
Definition: edge_src.c:553
GstTensorsConfig
Internal data structure for configured tensors info (for other/tensors).
Definition: tensor_typedef.h:284
gst_structure_is_tensor_stream
G_BEGIN_DECLS gboolean gst_structure_is_tensor_stream(const GstStructure *structure)
Check given mimetype is tensor stream.
Definition: nnstreamer_plugin_api_impl.c:984
srctemplate
static GstStaticPadTemplate srctemplate
the capabilities of the outputs
Definition: edge_src.c:25
TRUE
return TRUE
Definition: gsttensor_if.c:897
UNUSED
#define UNUSED(expr)
Definition: mqttcommon.h:19
nns_loge
#define nns_loge
Definition: nnstreamer_log.h:142
gst_edgesrc_init
static void gst_edgesrc_init(GstEdgeSrc *self)
initialize edgesrc element
Definition: edge_src.c:139
DEFAULT_CONNECT_TYPE
#define DEFAULT_CONNECT_TYPE
Definition: edge_common.h:27
gst_edgesrc_class_finalize
static void gst_edgesrc_class_finalize(GObject *object)
finalize the object
Definition: edge_src.c:239
PROP_TOPIC
@ PROP_TOPIC
Definition: edge_src.c:39
gst_edgesrc_change_state
static GstStateChangeReturn gst_edgesrc_change_state(GstElement *element, GstStateChange transition)
Change state of edgesrc.
Definition: edge_src.c:273
PROP_DEST_PORT
@ PROP_DEST_PORT
Definition: edge_src.c:37
DEFAULT_HOST
#define DEFAULT_HOST
Definition: edge_common.h:25
gst_tensors_info_get_nth_info
GstTensorInfo * gst_tensors_info_get_nth_info(GstTensorsInfo *info, guint index)
Get the pointer of nth tensor information.
Definition: nnstreamer_plugin_api_util_impl.c:296
gst_edgesrc_get_property
static void gst_edgesrc_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
get property
Definition: edge_src.c:202
G_DEFINE_TYPE
G_DEFINE_TYPE(GstEdgeSrc, gst_edgesrc, GST_TYPE_BASE_SRC)
DEFAULT_PORT
#define DEFAULT_PORT
Definition: edge_common.h:26
_GstEdgeSrcClass
GstEdgeSrcClass data structure.
Definition: edge_src.h:62
nns_logw
#define nns_logw
Definition: nnstreamer_log.h:141
GST_TYPE_EDGE_CONNECT_TYPE
#define GST_TYPE_EDGE_CONNECT_TYPE
Definition: edge_common.h:28
gst_edgesrc_set_dest_port
static void gst_edgesrc_set_dest_port(GstEdgeSrc *self, const guint16 dest_port)
setter for the 'port' property.
Definition: edge_src.c:544
gst_tensors_config_init
void gst_tensors_config_init(GstTensorsConfig *config)
Initialize the tensors config info structure (for other/tensors)
Definition: nnstreamer_plugin_api_util_impl.c:830
GST_DEBUG_CATEGORY_STATIC
GST_DEBUG_CATEGORY_STATIC(gst_edgesrc_debug)
GstTensorsConfig::info
GstTensorsInfo info
Definition: tensor_typedef.h:286
gst_edgesrc_start
static gboolean gst_edgesrc_start(GstBaseSrc *basesrc)
start edgesrc, called when state changed null to ready
Definition: edge_src.c:342
GST_EDGE_ELEM_NAME_SRC
#define GST_EDGE_ELEM_NAME_SRC
Definition: edge_common.h:24
gst_tensors_config_from_structure
gboolean gst_tensors_config_from_structure(GstTensorsConfig *config, const GstStructure *structure)
Parse structure and set tensors config (for other/tensors)
Definition: nnstreamer_plugin_api_impl.c:1413
GST_CAT_DEFAULT
#define GST_CAT_DEFAULT
Definition: edge_src.c:20
PROP_HOST
@ PROP_HOST
Definition: edge_src.c:34
gst_tensor_buffer_append_memory
gboolean gst_tensor_buffer_append_memory(GstBuffer *buffer, GstMemory *memory, const GstTensorInfo *info)
Append memory to given buffer.
Definition: nnstreamer_plugin_api_impl.c:1666
PROP_0
@ PROP_0
Definition: edge_src.c:33