Go to the documentation of this file.
25 #ifndef __GST_TENSOR_COMMON_H__
26 #define __GST_TENSOR_COMMON_H__
35 #include <gst/base/gstadapter.h>
36 #include <gst/base/gstcollectpads.h>
43 #include <orc/orcfunctions.h>
45 #define nns_memcpy(d,s,n) do { \
46 if ((n) > 100) orc_memcpy ((d), (s), (n)); \
47 else memcpy ((d), (s), (n)); \
50 #define nns_memset orc_memset
52 #define nns_memcpy memcpy
53 #define nns_memset memset
226 #define gst_tensor_pad_caps_is_static(p) (gst_tensor_pad_get_format (p) == _NNS_TENSOR_FORMAT_STATIC)
231 #define gst_tensor_pad_caps_is_flexible(p) (gst_tensor_pad_get_format (p) == _NNS_TENSOR_FORMAT_FLEXIBLE)
236 #define gst_tensor_pad_caps_is_sparse(p) (gst_tensor_pad_get_format (p) == _NNS_TENSOR_FORMAT_SPARSE)
276 #define silent_debug(self, ...) do { \
278 GST_DEBUG_OBJECT (self, __VA_ARGS__); \
285 #define silent_debug_caps(self, caps, msg) do { \
288 gchar *caps_s_string = gst_caps_to_string (caps); \
289 GST_DEBUG_OBJECT (self, msg " = %s\n", caps_s_string); \
290 g_free (caps_s_string); \
struct _tensor_sync_basepad_data tensor_sync_basepad_data
Tensor Merge/Mux sync data for baspad mode.
tensor_sync_basepad_data data_basepad
GstCaps * gst_tensor_pad_possible_caps_from_config(GstPad *pad, const GstTensorsConfig *config)
Get all possible caps from tensors config. Unlike gst_tensor_pad_caps_from_config(),...
Internal data structure for pad in demux / split.
tensor_time_sync_mode gst_tensor_time_sync_get_mode(const gchar *str)
Get the corresponding mode from the string value.
GHashTable * gst_tensor_aggregation_init(void)
Gets new hash table for tensor aggregation.
const gchar * gst_tensor_time_sync_get_mode_string(tensor_time_sync_mode mode)
Get the time-sync mode string.
Tensor Merge/Mux time sync data.
Internal log util for NNStreamer plugins and native APIs.
void gst_tensor_aggregation_clear_all(GHashTable *table)
Clears buffers from all adapters in hash table.
GstBuffer * gst_tensor_buffer_from_config(GstBuffer *in, GstTensorsConfig *config)
Configure gst-buffer with tensors information. NNStreamer handles single memory chunk as single tenso...
void gst_tensor_aggregation_clear(GHashTable *table, const guint32 key)
Clears buffers from adapter.
GstCaps * gst_tensor_pad_caps_from_config(GstPad *pad, const GstTensorsConfig *config)
Get pad caps from tensors config and caps of the peer connected to the pad.
gboolean gst_tensor_time_sync_get_current_time(GstCollectPads *collect, tensor_time_sync_data *sync, GstClockTime *current_time, GstBuffer *tensors_buf)
A function call to decide current timestamp among collected pads based on PTS. It will decide current...
enum _tensor_format tensor_format
Data format of tensor stream in the pipeline.
gboolean gst_tensor_time_sync_buffer_from_collectpad(GstCollectPads *collect, tensor_time_sync_data *sync, GstClockTime current_time, GstBuffer *tensors_buf, GstTensorsConfig *configs, gboolean *is_eos)
A function call to make tensors from collected pads It decide which buffer is going to be used accord...
Tensor Merge/Mux sync data for baspad mode.
GstAdapter * gst_tensor_aggregation_get_adapter(GHashTable *table, const guint32 key)
Gets adapter from hash table.
Internal data structure for configured tensors info (for other/tensors).
Common header file for NNStreamer, the GStreamer plugin for neural networks.
Internal data structure for Collect Pad in mux / merge.
tensor_time_sync_mode mode
struct _tensor_time_sync_data tensor_time_sync_data
Tensor Merge/Mux time sync data.
tensor_time_sync_mode
time synchronization options
void gst_tensor_parse_config_file(const gchar *config_path, const GObject *object)
Parses a configuration file and sets the corresponding properties on a GObject.
void gst_tensor_time_sync_flush(GstCollectPads *collect)
A function to be called while processing a flushing event. It should clear old buffer and reset pad d...
gboolean gst_tensor_time_sync_set_option_data(tensor_time_sync_data *sync)
Setup time sync option.
tensor_format gst_tensor_pad_get_format(GstPad *pad)
Get tensor format of current pad caps.
Optional/Additional NNStreamer APIs for sub-plugin writers. (Need Gst devel)