Doxygen Book
nnstreamer_plugin_api_impl.c File Reference

Common data for NNStreamer, the GStreamer plugin for neural networks. More...

#include <nnstreamer_util.h>
#include <string.h>
#include <tensor_common.h>
Include dependency graph for nnstreamer_plugin_api_impl.c:

Go to the source code of this file.

Classes

struct  GstTensorExtraInfo
 Data structure to describe a "extra" tensor data. This represents the information of the NNS_TENSOR_SIZE_LIMIT-th memory block for tensor stream. More...
 
struct  gst_tensor_aggregation_data_s
 Internal struct to handle aggregation data in hash table. More...
 

Macros

#define NNS_TENSOR_RANK_LIMIT_PREV   (4)
 The old rank of tensor. More...
 
#define NNS_TENSOR_EXTRA_MAGIC   0xf00dc0de
 
#define AGGREGATION_DEFAULT_KEY   0xC0FFEEU
 

Functions

static gboolean gst_memory_map_is_extra_tensor (GstMapInfo *map)
 Check if given memory has extra tensors. More...
 
static void gst_tensor_extra_info_init (GstTensorExtraInfo *extra, gsize reserved_size)
 Initialize GstTensorExtraInfo structure with given memory. More...
 
tensor_time_sync_mode gst_tensor_time_sync_get_mode (const gchar *str)
 Get the corresponding mode from the string value. More...
 
const gchar * gst_tensor_time_sync_get_mode_string (tensor_time_sync_mode mode)
 Get the time-sync mode string. More...
 
gboolean gst_tensor_time_sync_set_option_data (tensor_time_sync_data *sync)
 Setup time sync option. More...
 
static gboolean _gst_tensor_time_sync_is_eos (GstCollectPads *collect, tensor_time_sync_data *sync, guint empty)
 Internal function to detect EOS using the number of empty pads. More...
 
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 timestamp according to sync option. GstMeta is also copied with same sync mode. More...
 
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 data. More...
 
static gboolean _gst_tensor_time_sync_buffer_update (GstCollectPads *collect, GstCollectData *data, GstClockTime current, GstClockTime base, tensor_time_sync_data *sync)
 Internal function to update buffer in pad data based on the sync mode. More...
 
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 according to sync option. More...
 
GstBuffer * gst_tensor_buffer_from_config (GstBuffer *in, GstTensorsConfig *config)
 Configure gst-buffer with tensors information. NNStreamer handles single memory chunk as single tensor. If incoming buffer has invalid memories, separate it and generate new gst-buffer using tensors information. Note that this function always takes the ownership of input buffer. More...
 
static void gst_tensor_aggregation_free_data (gpointer data)
 Internal function to free aggregation data. More...
 
static gst_tensor_aggregation_data_sgst_tensor_aggregation_add_data (GHashTable *table, const guint32 key)
 Internal function to add new aggregation data. More...
 
static gst_tensor_aggregation_data_sgst_tensor_aggregation_get_data (GHashTable *table, const guint32 key)
 Internal function to get aggregation data. More...
 
static void gst_tensor_aggregation_clear_internal (gpointer key, gpointer value, gpointer user_data)
 Internal function to remove all buffers from aggregation data. More...
 
GHashTable * gst_tensor_aggregation_init (void)
 Gets new hash table for tensor aggregation. More...
 
void gst_tensor_aggregation_clear (GHashTable *table, const guint32 key)
 Clears buffers from adapter. More...
 
void gst_tensor_aggregation_clear_all (GHashTable *table)
 Clears buffers from all adapters in hash table. More...
 
GstAdapter * gst_tensor_aggregation_get_adapter (GHashTable *table, const guint32 key)
 Gets adapter from hash table. More...
 
static gboolean _append_prev_caps (const GstTensorsConfig *config)
 Internal function to check tensor dimensions to append old caps for backward compatibility (rank 4). More...
 
static GstCaps * _get_tensor_caps (const GstTensorsConfig *config)
 Internal function to get caps for single tensor from config. More...
 
static GstCaps * _get_tensors_caps (const GstTensorsConfig *config)
 Internal function to get caps for multi tensors from config. More...
 
static GstCaps * _get_flexible_caps (const GstTensorsConfig *config)
 Internal function to get caps for flexible tensor from config. More...
 
gboolean gst_structure_is_tensor_stream (const GstStructure *structure)
 Check given mimetype is tensor stream. More...
 
media_type gst_structure_get_media_type (const GstStructure *structure)
 Get media type from structure. More...
 
gboolean gst_tensors_config_from_peer (GstPad *pad, GstTensorsConfig *config, gboolean *is_fixed)
 Parse caps from peer pad and set tensors config. More...
 
static gboolean _is_structure_dimension_same (GstStructure *st1, GstStructure *st2, const gchar *fieldname)
 Check whether two structures have the same dimension. More...
 
void gst_tensor_caps_update_dimension (GstCaps *caps, GstCaps *filter)
 Update caps dimensions for negotiation. More...
 
gboolean gst_tensor_caps_can_intersect (GstCaps *caps1, GstCaps *caps2)
 Try intersecting @caps1 and @caps2 for tensor stream. More...
 
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. More...
 
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(), this function does not check peer caps. More...
 
tensor_format gst_tensor_pad_get_format (GstPad *pad)
 Get tensor format of current pad caps. More...
 
GstCaps * gst_tensors_caps_from_config (const GstTensorsConfig *config)
 Get caps from tensors config (for other/tensors) More...
 
GstCaps * gst_tensor_caps_from_config (const GstTensorsConfig *config)
 Get tensor caps from tensors config. More...
 
gboolean gst_tensors_config_from_structure (GstTensorsConfig *config, const GstStructure *structure)
 Parse structure and set tensors config (for other/tensors) More...
 
gboolean gst_tensor_meta_info_parse_memory (GstTensorMetaInfo *meta, GstMemory *mem)
 Parse memory and fill the tensor meta. More...
 
GstMemory * gst_tensor_meta_info_append_header (GstTensorMetaInfo *meta, GstMemory *mem)
 Append header to memory. More...
 
GstMemory * gst_tensor_buffer_get_nth_memory (GstBuffer *buffer, const guint index)
 Get the nth GstMemory from given buffer. More...
 
gboolean gst_tensor_buffer_append_memory (GstBuffer *buffer, GstMemory *memory, const GstTensorInfo *info)
 Append memory to given buffer. More...
 
guint gst_tensor_buffer_get_count (GstBuffer *buffer)
 Get the number of tensors in the buffer. More...
 
static void set_property_value (GValue *prop_value, const GParamSpec *param_spec, const gchar *property_value)
 Sets the value of a property based on the specified property value and GParamSpec. More...
 
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. More...
 

Variables

static const gchar * gst_tensor_time_sync_mode_string []
 

Detailed Description

Common data for NNStreamer, the GStreamer plugin for neural networks.

NNStreamer Common Header's Contents (pipeline extension) Copyright (C) 2020 MyungJoo Ham myung.nosp@m.joo..nosp@m.ham@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m

Date
14 Apr 2020
See also
https://github.com/nnstreamer/nnstreamer
Author
MyungJoo Ham myung.nosp@m.joo..nosp@m.ham@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m
Bug:
No known bugs except for NYI items

Definition in file nnstreamer_plugin_api_impl.c.

Macro Definition Documentation

◆ AGGREGATION_DEFAULT_KEY

#define AGGREGATION_DEFAULT_KEY   0xC0FFEEU

Definition at line 662 of file nnstreamer_plugin_api_impl.c.

◆ NNS_TENSOR_EXTRA_MAGIC

#define NNS_TENSOR_EXTRA_MAGIC   0xf00dc0de

Definition at line 33 of file nnstreamer_plugin_api_impl.c.

◆ NNS_TENSOR_RANK_LIMIT_PREV

#define NNS_TENSOR_RANK_LIMIT_PREV   (4)

The old rank of tensor.

Definition at line 31 of file nnstreamer_plugin_api_impl.c.

Function Documentation

◆ _append_prev_caps()

static gboolean _append_prev_caps ( const GstTensorsConfig config)
static

Internal function to check tensor dimensions to append old caps for backward compatibility (rank 4).

Definition at line 809 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _get_flexible_caps()

static GstCaps* _get_flexible_caps ( const GstTensorsConfig config)
static

Internal function to get caps for flexible tensor from config.

Definition at line 964 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ _get_tensor_caps()

static GstCaps* _get_tensor_caps ( const GstTensorsConfig config)
static

Internal function to get caps for single tensor from config.

Definition at line 839 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _get_tensors_caps()

static GstCaps* _get_tensors_caps ( const GstTensorsConfig config)
static

Internal function to get caps for multi tensors from config.

Definition at line 904 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _gst_tensor_time_sync_buffer_update()

static gboolean _gst_tensor_time_sync_buffer_update ( GstCollectPads *  collect,
GstCollectData *  data,
GstClockTime  current,
GstClockTime  base,
tensor_time_sync_data sync 
)
static

Internal function to update buffer in pad data based on the sync mode.

Definition at line 287 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ _gst_tensor_time_sync_is_eos()

static gboolean _gst_tensor_time_sync_is_eos ( GstCollectPads *  collect,
tensor_time_sync_data sync,
guint  empty 
)
static

Internal function to detect EOS using the number of empty pads.

Parameters
[in]collectCollect pad.
[in]syncSynchronization option.
[in]emptyThe number of empty pads (pad has no buffer).
Returns
True if EOS.

Definition at line 175 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ _is_structure_dimension_same()

static gboolean _is_structure_dimension_same ( GstStructure *  st1,
GstStructure *  st2,
const gchar *  fieldname 
)
static

Check whether two structures have the same dimension.

Definition at line 1072 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_memory_map_is_extra_tensor()

static gboolean gst_memory_map_is_extra_tensor ( GstMapInfo *  map)
static

Check if given memory has extra tensors.

Parameters
[in]mapGstMapInfo of GstMemory to be checked.
Returns
TRUE if @map has extra tensors, otherwise FALSE.

Definition at line 54 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ gst_structure_get_media_type()

media_type gst_structure_get_media_type ( const GstStructure *  structure)

Get media type from structure.

Parameters
structurestructure to be interpreted
Returns
corresponding media type (returns _NNS_MEDIA_INVALID for unsupported type)

Definition at line 1001 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_structure_is_tensor_stream()

gboolean gst_structure_is_tensor_stream ( const GstStructure *  structure)

Check given mimetype is tensor stream.

Parameters
structurestructure to be interpreted
Returns
TRUE if mimetype is tensor stream

Definition at line 984 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_aggregation_add_data()

static gst_tensor_aggregation_data_s* gst_tensor_aggregation_add_data ( GHashTable *  table,
const guint32  key 
)
static

Internal function to add new aggregation data.

Definition at line 685 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_aggregation_clear()

void gst_tensor_aggregation_clear ( GHashTable *  table,
const guint32  key 
)

Clears buffers from adapter.

Parameters
tablea hash table instance initialized with gst_tensor_aggregation_init()
keythe key to look up (set null to get default adapter)

Definition at line 763 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:

◆ gst_tensor_aggregation_clear_all()

void gst_tensor_aggregation_clear_all ( GHashTable *  table)

Clears buffers from all adapters in hash table.

Parameters
tablea hash table instance initialized with gst_tensor_aggregation_init()

Definition at line 778 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_aggregation_clear_internal()

static void gst_tensor_aggregation_clear_internal ( gpointer  key,
gpointer  value,
gpointer  user_data 
)
static

Internal function to remove all buffers from aggregation data.

Definition at line 718 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_aggregation_free_data()

static void gst_tensor_aggregation_free_data ( gpointer  data)
static

Internal function to free aggregation data.

Definition at line 668 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_aggregation_get_adapter()

GstAdapter* gst_tensor_aggregation_get_adapter ( GHashTable *  table,
const guint32  key 
)

Gets adapter from hash table.

Parameters
tablea hash table instance initialized with gst_tensor_aggregation_init()
keythe key to look up (set null to get default adapter)
Returns
gst-adapter instance. DO NOT release this instance.

Definition at line 790 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_aggregation_get_data()

static gst_tensor_aggregation_data_s* gst_tensor_aggregation_get_data ( GHashTable *  table,
const guint32  key 
)
static

Internal function to get aggregation data.

Definition at line 706 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_aggregation_init()

GHashTable* gst_tensor_aggregation_init ( void  )

Gets new hash table for tensor aggregation.

Returns
Newly allocated hash table, caller should release this using g_hash_table_destroy().

Add default adapter (for the case if buffer has no specific id). If gst-buffer has tensor-meta which includes client-id, e.g., aggregation frames from multiple clients on query-server pipeline, nnstreamer element should parse meta and request adapter with this id. However, on normal pipeline, gst-buffer does not contain tensor-meta, then the element may request adapter with null key string.

Definition at line 737 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_buffer_append_memory()

gboolean gst_tensor_buffer_append_memory ( GstBuffer *  buffer,
GstMemory *  memory,
const GstTensorInfo info 
)

Append memory to given buffer.

Parameters
[in/out]buffer GstBuffer to be appended.
[in]memoryGstMemory to append. This function takes ownership of this, even if it returns failure.
[in]infoGstTensorInfo of given memory.
Returns
TRUE if successfully appended, otherwise FALSE.

Free the name string, cause it does not freed by gstreamer.

Todo:
Make custom gst_allocator later?

Definition at line 1666 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_buffer_from_config()

GstBuffer* gst_tensor_buffer_from_config ( GstBuffer *  in,
GstTensorsConfig config 
)

Configure gst-buffer with tensors information. NNStreamer handles single memory chunk as single tensor. If incoming buffer has invalid memories, separate it and generate new gst-buffer using tensors information. Note that this function always takes the ownership of input buffer.

Parameters
ininput buffer
configtensors config structure
Returns
Newly allocated buffer. Null if failed. Caller should unref the buffer using gst_buffer_unref().

Definition at line 535 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_buffer_get_count()

guint gst_tensor_buffer_get_count ( GstBuffer *  buffer)

Get the number of tensors in the buffer.

Definition at line 1813 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_buffer_get_nth_memory()

GstMemory* gst_tensor_buffer_get_nth_memory ( GstBuffer *  buffer,
const guint  index 
)

Get the nth GstMemory from given buffer.

Parameters
[in]bufferGstBuffer to be parsed.
[in]indexIndex of GstMemory to be returned.
Returns
GstMemory if found, otherwise NULL (Caller should free returned memory using gst_memory_unref()).

Definition at line 1586 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_caps_can_intersect()

gboolean gst_tensor_caps_can_intersect ( GstCaps *  caps1,
GstCaps *  caps2 
)

Try intersecting @caps1 and @caps2 for tensor stream.

Parameters
caps1a GstCaps to intersect
caps2a GstCaps to intersect
Returns
TRUE if intersection would be not empty.

Definition at line 1142 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_caps_from_config()

GstCaps* gst_tensor_caps_from_config ( const GstTensorsConfig config)

Get tensor caps from tensors config.

Get tensor caps from tensors config (for other/tensor)

Parameters
configtensors config info
Returns
caps for given config

Definition at line 1395 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_caps_update_dimension()

void gst_tensor_caps_update_dimension ( GstCaps *  caps,
GstCaps *  filter 
)

Update caps dimensions for negotiation.

Update caps dimension for negotiation.

Parameters
capscaps to compare and update
filtercaps to compare

Definition at line 1093 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_extra_info_init()

static void gst_tensor_extra_info_init ( GstTensorExtraInfo extra,
gsize  reserved_size 
)
static

Initialize GstTensorExtraInfo structure with given memory.

Parameters
[in/out]extra GstTensorExtraInfo to be initialized.
[in]reserved_sizeThe memory size of extra memory block.

Definition at line 78 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_meta_info_append_header()

GstMemory* gst_tensor_meta_info_append_header ( GstTensorMetaInfo meta,
GstMemory *  mem 
)

Append header to memory.

Parameters
[in]metatensor meta structure
[in]mempointer to GstMemory
Returns
Newly allocated GstMemory (Caller should free returned memory using gst_memory_unref())

Definition at line 1544 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_meta_info_parse_memory()

gboolean gst_tensor_meta_info_parse_memory ( GstTensorMetaInfo meta,
GstMemory *  mem 
)

Parse memory and fill the tensor meta.

Parameters
[out]metatensor meta structure to be filled
[in]mempointer to GstMemory to be parsed
Returns
TRUE if successfully set the meta

Definition at line 1509 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_pad_caps_from_config()

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.

Parameters
padGstPad to get possible caps
configtensors config structure
Returns
caps for given config. Caller is responsible for unreffing the returned caps.

Definition at line 1209 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_pad_get_format()

tensor_format gst_tensor_pad_get_format ( GstPad *  pad)

Get tensor format of current pad caps.

Parameters
padGstPad to check current caps.
Returns
The tensor_format of current pad caps.

If pad does not have tensor caps return _NNS_TENSOR_FORMAT_END

Definition at line 1343 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:

◆ gst_tensor_pad_possible_caps_from_config()

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(), this function does not check peer caps.

Parameters
padGstPad to get possible caps
configtensors config structure
Returns
caps for given config. Caller is responsible for unreffing the returned caps.

Definition at line 1286 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_parse_config_file()

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.

This function reads the contents of the configuration file located at the given path and sets the properties of the specified GObject based on the configuration data.

Parameters
config_pathThe path to the configuration file.
objectThe GObject on which to set the properties.
Note
The responsibility of managing the memory of the GObject passed as a parameter lies outside this function.

Iterate over each line

Definition at line 1902 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_time_sync_buffer_from_collectpad()

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 according to sync option.

A function call to make tensors from collected pads It decide which buffer is going to be used according to sync option.

Returns
True to push buffer.

This would be an internal logic error. in_configs should be already confirmed valid at the negotiation phase and this function should be called in a running pipeline. If new sync mode is enabled (e.g., handle output when a pad gets new buffer), this may cause unexpected exception.

These are internal logic error. If given inputs are incorrect, the negotiation should have been failed before this stage.

Definition at line 332 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_time_sync_flush()

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 data.

Parameters
collectCollect pad.

Definition at line 263 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_time_sync_get_current_time()

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 timestamp according to sync option. GstMeta is also copied with same sync mode.

Returns
True / False. If EOS, it return TRUE.
Parameters
collectCollect pad.
syncSynchronization Option (NOSYNC, SLOWEST, BASEPAD, END)
current_timeCurrent time
tensors_bufGenerated GstBuffer for Collected Buffer

Definition at line 203 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_time_sync_get_mode()

tensor_time_sync_mode gst_tensor_time_sync_get_mode ( const gchar *  str)

Get the corresponding mode from the string value.

Parameters
[in]strThe string value for the mode.
Returns
Corresponding mode for the string. SYNC_END for errors.

Definition at line 101 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_time_sync_get_mode_string()

const gchar* gst_tensor_time_sync_get_mode_string ( tensor_time_sync_mode  mode)

Get the time-sync mode string.

Returns
Corresponding mode string.

Definition at line 115 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ gst_tensor_time_sync_set_option_data()

gboolean gst_tensor_time_sync_set_option_data ( tensor_time_sync_data sync)

Setup time sync option.

Parameters
[in/out]filter "this" pointer. Sync mode & option MUST BE set already.
Returns
True if successfully set the option.

Definition at line 126 of file nnstreamer_plugin_api_impl.c.

Here is the caller graph for this function:

◆ gst_tensors_caps_from_config()

GstCaps* gst_tensors_caps_from_config ( const GstTensorsConfig config)

Get caps from tensors config (for other/tensors)

Parameters
configtensors config info
Returns
caps for given config

Definition at line 1372 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensors_config_from_peer()

gboolean gst_tensors_config_from_peer ( GstPad *  pad,
GstTensorsConfig config,
gboolean *  is_fixed 
)

Parse caps from peer pad and set tensors config.

Parameters
padGstPad to get the capabilities
configtensors config structure to be filled
is_fixedflag to be updated when peer caps is fixed (not mandatory, do nothing when the param is null)
Returns
TRUE if successfully configured from peer

Definition at line 1041 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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)

Parameters
configtensors config structure to be filled
structurestructure to be interpreted
Returns
TRUE if no error

Definition at line 1413 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_property_value()

static void set_property_value ( GValue *  prop_value,
const GParamSpec *  param_spec,
const gchar *  property_value 
)
static

Sets the value of a property based on the specified property value and GParamSpec.

Parameters
prop_valueA pointer to the GValue where the property value will be set.
param_specA pointer to the GParamSpec that describes the property.
property_valueA string representing the value to be set for the property.
Note
This API is intended to be used by gst_tensor_parse_config_file ()

default is string

Definition at line 1862 of file nnstreamer_plugin_api_impl.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ gst_tensor_time_sync_mode_string

const gchar* gst_tensor_time_sync_mode_string[]
static
Initial value:
= {
[SYNC_NOSYNC] = "nosync",
[SYNC_SLOWEST] = "slowest",
[SYNC_BASEPAD] = "basepad",
[SYNC_REFRESH] = "refresh",
[SYNC_END] = NULL
}

Definition at line 20 of file nnstreamer_plugin_api_impl.c.

SYNC_BASEPAD
@ SYNC_BASEPAD
Definition: tensor_common.h:66
SYNC_NOSYNC
@ SYNC_NOSYNC
Definition: tensor_common.h:64
SYNC_END
@ SYNC_END
Definition: tensor_common.h:68
SYNC_SLOWEST
@ SYNC_SLOWEST
Definition: tensor_common.h:65
SYNC_REFRESH
@ SYNC_REFRESH
Definition: tensor_common.h:67