Doxygen Book
gsttensor_if.h File Reference

GStreamer plugin to control flow based on tensor values. More...

#include <gst/gst.h>
#include <tensor_common.h>
#include <tensor_data.h>
#include <tensor_if.h>
Include dependency graph for gsttensor_if.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tensor_if_sv_s
 Internal data structure for supplied value. More...
 
struct  custom_cb_s
 
struct  _GstTensorIf
 Tensor If data structure. More...
 
struct  _GstTensorIfClass
 GstTensorIfClass inherits GstElementClass. More...
 

Macros

#define GST_TYPE_TENSOR_IF   (gst_tensor_if_get_type ())
 
#define GST_TENSOR_IF(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TENSOR_IF, GstTensorIf))
 
#define GST_TENSOR_IF_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TENSOR_IF, GstTensorIfClass))
 
#define GST_TENSOR_IF_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_TENSOR_IF, GstTensorIfClass))
 
#define GST_IS_TENSOR_IF(obj)   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TENSOR_IF))
 
#define GST_IS_TENSOR_IF_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TENSOR_IF))
 
#define GST_TENSOR_IF_CAST(obj)   ((GstTensorIf*)(obj))
 

Typedefs

typedef struct _GstTensorIf GstTensorIf
 
typedef struct _GstTensorIfClass GstTensorIfClass
 

Enumerations

enum  tensor_if_compared_value {
  TIFCV_A_VALUE = 0, TIFCV_TENSOR_TOTAL_VALUE = 1, TIFCV_ALL_TENSORS_TOTAL_VALUE = 2, TIFCV_TENSOR_AVERAGE_VALUE = 3,
  TIFCV_ALL_TENSORS_AVERAGE_VALUE = 4, TIFCV_CUSTOM = 5, TIFCV_END
}
 Compared_Value. More...
 
enum  tensor_if_operator {
  TIFOP_EQ = 0, TIFOP_NE, TIFOP_GT, TIFOP_GE,
  TIFOP_LT, TIFOP_LE, TIFOP_RANGE_INCLUSIVE, TIFOP_RANGE_EXCLUSIVE,
  TIFOP_NOT_IN_RANGE_INCLUSIVE, TIFOP_NOT_IN_RANGE_EXCLUSIVE, TIFOP_END
}
 OPERAND. More...
 
enum  tensor_if_behavior {
  TIFB_PASSTHROUGH = 0, TIFB_SKIP, TIFB_FILL_ZERO, TIFB_FILL_VALUES,
  TIFB_FILL_WITH_FILE, TIFB_FILL_WITH_FILE_RPT, TIFB_REPEAT_PREVIOUS_FRAME, TIFB_TENSORPICK,
  TIFB_END
}
 Behaviors that may fit in THEN and ELSE. More...
 
enum  tensor_if_srcpads { TIFSP_THEN_PAD = 0, TIFSP_ELSE_PAD }
 Which src pad. More...
 

Functions

GType gst_tensor_if_get_type (void)
 Get Type function required for gst elements. More...
 

Detailed Description

GStreamer plugin to control flow based on tensor values.

GStreamer/NNStreamer Tensor-IF Copyright (C) 2020 MyungJoo Ham myung.nosp@m.joo..nosp@m.ham@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m

Date
08 April 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
Todo:
Add "event/signal" to reload FILL_WITH_FILE* file??? (TBD)

The output dimension is SAME with input dimension.

Definition in file gsttensor_if.h.

Macro Definition Documentation

◆ GST_IS_TENSOR_IF

#define GST_IS_TENSOR_IF (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_TENSOR_IF))

Definition at line 33 of file gsttensor_if.h.

◆ GST_IS_TENSOR_IF_CLASS

#define GST_IS_TENSOR_IF_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_TENSOR_IF))

Definition at line 34 of file gsttensor_if.h.

◆ GST_TENSOR_IF

#define GST_TENSOR_IF (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_TENSOR_IF, GstTensorIf))

Definition at line 30 of file gsttensor_if.h.

◆ GST_TENSOR_IF_CAST

#define GST_TENSOR_IF_CAST (   obj)    ((GstTensorIf*)(obj))

Definition at line 35 of file gsttensor_if.h.

◆ GST_TENSOR_IF_CLASS

#define GST_TENSOR_IF_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_TENSOR_IF, GstTensorIfClass))

Definition at line 31 of file gsttensor_if.h.

◆ GST_TENSOR_IF_GET_CLASS

#define GST_TENSOR_IF_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_TENSOR_IF, GstTensorIfClass))

Definition at line 32 of file gsttensor_if.h.

◆ GST_TYPE_TENSOR_IF

#define GST_TYPE_TENSOR_IF   (gst_tensor_if_get_type ())

Definition at line 29 of file gsttensor_if.h.

Typedef Documentation

◆ GstTensorIf

typedef struct _GstTensorIf GstTensorIf

Definition at line 36 of file gsttensor_if.h.

◆ GstTensorIfClass

Definition at line 37 of file gsttensor_if.h.

Enumeration Type Documentation

◆ tensor_if_behavior

Behaviors that may fit in THEN and ELSE.

FILL_WITH_FILE, FILL_WITH_FILE_RPT, and REPEAT_PREVIOUS_FRAME caches an output frame and thus, may consume additional memory and incur an additional memcpy.

Enumerator
TIFB_PASSTHROUGH 

The input frame becomes the output frame

TIFB_SKIP 

Do not generate output frame (frame skip)

TIFB_FILL_ZERO 

Fill output frame with zeros

TIFB_FILL_VALUES 

Fill output frame with a user given value

TIFB_FILL_WITH_FILE 

Fill output frame with a user given file (a raw data of tensor/tensors) If the filesize is smaller, the reset is filled with 0

TIFB_FILL_WITH_FILE_RPT 

Fill output frame with a user given file (a raw data of tensor/tensors) If the filesize is smally, the file is repeatedly used

TIFB_REPEAT_PREVIOUS_FRAME 

Resend the previous output frame. If this is the first, send ZERO values.

TIFB_TENSORPICK 

Choose nth tensor (or tensors) among tensors

TIFB_END 

Definition at line 79 of file gsttensor_if.h.

◆ tensor_if_compared_value

Compared_Value.

Enumerator
TIFCV_A_VALUE 

Decide based on a single scalar value of tensors

TIFCV_TENSOR_TOTAL_VALUE 

Decide based on a total (sum) value of a specific tensor

TIFCV_ALL_TENSORS_TOTAL_VALUE 

Decide based on a total (sum) value of of tensors or a specific tensor

TIFCV_TENSOR_AVERAGE_VALUE 

Decide based on a average value of a specific tensor

TIFCV_ALL_TENSORS_AVERAGE_VALUE 

Decide based on a average value of tensors or a specific tensor

TIFCV_CUSTOM 

Decide based on a user defined condition

TIFCV_END 

Definition at line 42 of file gsttensor_if.h.

◆ tensor_if_operator

OPERAND.

Enumerator
TIFOP_EQ 

==

TIFOP_NE 

!=

TIFOP_GT 

TIFOP_GE 

>=

TIFOP_LT 

<

TIFOP_LE 

<=

TIFOP_RANGE_INCLUSIVE 

in [min, max]

TIFOP_RANGE_EXCLUSIVE 

in (min, max)

TIFOP_NOT_IN_RANGE_INCLUSIVE 

not in [min, max]

TIFOP_NOT_IN_RANGE_EXCLUSIVE 

not in (min, max)

TIFOP_END 

Definition at line 60 of file gsttensor_if.h.

◆ tensor_if_srcpads

Which src pad.

Enumerator
TIFSP_THEN_PAD 
TIFSP_ELSE_PAD 

Definition at line 96 of file gsttensor_if.h.

Function Documentation

◆ gst_tensor_if_get_type()

GType gst_tensor_if_get_type ( void  )

Get Type function required for gst elements.