Go to the documentation of this file.
25 #ifndef __G_TENSOR_FILTER_COMMON_H__
26 #define __G_TENSOR_FILTER_COMMON_H__
28 #include <glib-object.h>
41 #define DBG (!priv->silent)
45 #define GST_TF_FW_VN(fw, vn) \
46 (fw && checkGstTensorFilterFrameworkVersion (fw->version, vn))
47 #define GST_TF_FW_V0(fw) GST_TF_FW_VN (fw, 0)
48 #define GST_TF_FW_V1(fw) GST_TF_FW_VN (fw, 1)
53 #define gst_tensor_filter_v0_call(priv,ret,funcname,...) do { \
54 gst_tensor_filter_common_open_fw (priv); \
56 if ((priv)->prop.fw_opened && (priv)->fw && (priv)->fw->funcname) { \
57 ret = (priv)->fw->funcname (&(priv)->prop, &(priv)->privateData, __VA_ARGS__); \
61 #define gst_tensor_filter_v1_call(priv,ret,funcname,...) do { \
62 gst_tensor_filter_common_open_fw (priv); \
64 if ((priv)->prop.fw_opened && (priv)->fw && (priv)->fw->funcname) { \
65 ret = (priv)->fw->funcname ((priv)->fw, &(priv)->prop, (priv)->privateData, __VA_ARGS__); \
69 #define GST_TF_FW_INVOKE_COMPAT(priv,ret,in,out) do { \
71 if (GST_TF_FW_V0 ((priv)->fw)) { \
72 ret = (priv)->fw->invoke_NN (&(priv)->prop, &(priv)->privateData, (in), (out)); \
73 } else if (GST_TF_FW_V1 ((priv)->fw)) { \
74 ret = (priv)->fw->invoke ((priv)->fw, &(priv)->prop, (priv)->privateData, (in), (out)); \
78 #define GST_TF_STAT_MAX_RECENT (10)
232 guint prop_id,
const GValue * value, GParamSpec * pspec);
244 guint prop_id, GValue * value, GParamSpec * pspec);
struct _GstTensorFilterCombination GstTensorFilterCombination
Structure definition for tensor-filter in/out combination.
accl_hw
acceleration hw properties.
gint64 latest_invoke_time
Data Structure to store shared table.
void gst_tensorsinfo_compare_print(const GstTensorsInfo *info1, const GstTensorsInfo *info2)
Printout the comparison results of two tensors.
void gst_tensor_filter_common_init_property(GstTensorFilterPrivate *priv)
Initialize the properties for tensor-filter.
GstTensorsConfig out_config
Subplugin Manager for NNStreamer.
gboolean latency_reporting
Internal meta data exchange format for a other/tensors instance.
void * shared_interpreter
GstTensorFilterStatistics stat
gboolean gst_tensor_filter_common_get_combined_in_info(GstTensorFilterPrivate *priv, const GstTensorsInfo *in, GstTensorsInfo *combined)
Configure input tensor info with combi option.
struct _GstTensorFilterPrivate GstTensorFilterPrivate
Structure definition for common tensor-filter properties.
gboolean gst_tensor_filter_common_get_combined_out_info(GstTensorFilterPrivate *priv, const GstTensorsInfo *in, const GstTensorsInfo *out, GstTensorsInfo *combined)
Configure output tensor info with combi option.
Tensor_Filter Subplugin definition.
GstTensorsConfig in_config
nns_watchdog_h watchdog_h
Optional/Additional NNStreamer APIs for sub-plugin writers. (No GStreamer dependency)
guint latency_ignore_count
struct _GstTensorFilterStatistics GstTensorFilterStatistics
Structure definition for tensor-filter statistics.
gint64 old_total_invoke_num
gboolean gst_tensor_filter_allocate_in_invoke(GstTensorFilterPrivate *priv)
check if the allocate_in_invoke is valid for the framework
gboolean gst_tensor_filter_common_get_out_info(GstTensorFilterPrivate *priv, GstTensorsInfo *in, GstTensorsInfo *out)
Get output tensor info from NN model with given input info.
gboolean out_combi_i_defined
@ PROP_SHARED_TENSOR_FILTER_KEY
void gst_tensor_filter_common_open_fw(GstTensorFilterPrivate *priv)
Open NN framework.
gint64 old_total_invoke_latency
void gst_tensor_filter_load_tensor_info(GstTensorFilterPrivate *priv)
Load tensor info from NN model. (both input and output tensor)
Tensor_Filter Subplugin framework related information.
GstTensorFilterFrameworkInfo info
void gst_tensor_filter_common_unload_fw(GstTensorFilterPrivate *priv)
Unload NN framework.
Internal data structure for configured tensors info (for other/tensors).
NNStreamer watchdog header to manage the schedule in the element.
Mandatory APIs for NNStreamer Filter sub-plugins (No External Dependencies)
Structure definition for common tensor-filter properties.
gboolean gst_tensor_filter_common_get_property(GstTensorFilterPrivate *priv, guint prop_id, GValue *value, GParamSpec *pspec)
Get the properties for tensor_filter.
const GstTensorFilterFramework * fw
GstTensorFilter's properties for NN framework (internal data structure)
void gst_tensor_filter_destroy_notify_util(GstTensorFilterPrivate *priv, void *data)
Free the data allocated for tensor filter output.
gboolean in_combi_defined
gint64 total_invoke_latency
Structure definition for tensor-filter statistics.
Structure definition for tensor-filter in/out combination.
gboolean gst_tensor_filter_check_hw_availability(const gchar *name, const accl_hw hw, const char *custom)
Check if the given hw is supported by the framework.
gchar * gst_tensor_filter_detect_framework(const gchar *const *model_files, const guint num_models, const gboolean load_conf)
Get neural network framework name from given model file. This does not guarantee the framework is ava...
GstTensorFilterCombination combi
GstTensorFilterProperties prop
void gst_tensor_filter_common_close_fw(GstTensorFilterPrivate *priv)
Close NN framework.
gboolean out_combi_o_defined
void gst_tensor_filter_install_properties(GObjectClass *gobject_class)
Installs all the properties for tensor_filter.
void gst_tensor_filter_common_free_property(GstTensorFilterPrivate *priv)
Free the properties for tensor-filter.
gchar * gst_tensorsinfo_compare_to_string(const GstTensorsInfo *info, const GstTensorsInfo *info2)
Printout the comparison results of two tensors as a string.
gboolean gst_tensor_filter_common_set_property(GstTensorFilterPrivate *priv, guint prop_id, const GValue *value, GParamSpec *pspec)
Set the properties for tensor_filter.