GStreamer plugin to convert tensors (as a filter for other general neural network filters) to other media types. More...
Go to the source code of this file.
Macros | |
#define | DBG (!self->silent) |
Macro for debug mode. More... | |
#define | GST_CAT_DEFAULT gst_tensordec_debug |
#define | DEFAULT_SILENT TRUE |
Flag to print minimized log. More... | |
#define | CAPS_STRING GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_DEFAULT ";" GST_TENSORS_FLEX_CAP_DEFAULT |
Support multi-tensor along with single-tensor as the input. More... | |
#define | gst_tensordec_parent_class parent_class |
#define | gst_tensor_decoder_clean_plugin(self) |
Macro to clean sub-plugin data. More... | |
#define | PROP_MODE_OPTION(opnum) case PROP_MODE_OPTION |
A macro to process incoming per-mode option. More... | |
#define | PROP_READ_OPTION(opnum) case PROP_MODE_OPTION |
A macro to read per-mode option. More... | |
Enumerations | |
enum | { PROP_0, PROP_SILENT, PROP_MODE, PROP_MODE_OPTION1, PROP_MODE_OPTION2, PROP_MODE_OPTION3, PROP_MODE_OPTION4, PROP_MODE_OPTION5, PROP_MODE_OPTION6, PROP_MODE_OPTION7, PROP_MODE_OPTION8, PROP_MODE_OPTION9, PROP_SUBPLUGINS, PROP_CONFIG } |
Properties. More... | |
Functions | |
GST_DEBUG_CATEGORY_STATIC (gst_tensordec_debug) | |
G_DEFINE_TYPE (GstTensorDecoder, gst_tensordec, GST_TYPE_BASE_TRANSFORM) | |
static void | gst_tensordec_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
Set property (GObject vmethod) More... | |
static void | gst_tensordec_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
Get property (GObject vmethod) More... | |
static void | gst_tensordec_class_finalize (GObject *object) |
Finalize instance (GObject vmethod) More... | |
static GstFlowReturn | gst_tensordec_transform (GstBaseTransform *trans, GstBuffer *inbuf, GstBuffer *outbuf) |
non-ip transform. required vmethod for BaseTransform class. More... | |
static GstCaps * | gst_tensordec_transform_caps (GstBaseTransform *trans, GstPadDirection direction, GstCaps *caps, GstCaps *filter) |
configure tensor-srcpad cap from "proposed" cap. More... | |
static GstCaps * | gst_tensordec_fixate_caps (GstBaseTransform *trans, GstPadDirection direction, GstCaps *caps, GstCaps *othercaps) |
fixate caps. required vmethod of BaseTransform More... | |
static gboolean | gst_tensordec_set_caps (GstBaseTransform *trans, GstCaps *incaps, GstCaps *outcaps) |
set caps. required vmethod of BaseTransform More... | |
static gboolean | gst_tensordec_transform_size (GstBaseTransform *trans, GstPadDirection direction, GstCaps *caps, gsize size, GstCaps *othercaps, gsize *othersize) |
Tell the framework the required size of buffer based on the info of the other side pad. optional vmethod of BaseTransform. More... | |
static gboolean | nnstreamer_decoder_validate (const GstTensorDecoderDef *decoder) |
Validate decoder sub-plugin's data. More... | |
int | nnstreamer_decoder_probe (GstTensorDecoderDef *decoder) |
Decoder's sub-plugin should call this function to register itself. More... | |
void | nnstreamer_decoder_exit (const char *name) |
Decoder's sub-plugin may call this to unregister itself. More... | |
const GstTensorDecoderDef * | nnstreamer_decoder_find (const char *name) |
Find decoder sub-plugin with the name. More... | |
void | nnstreamer_decoder_set_custom_property_desc (const char *name, const char *prop,...) |
set custom property description for tensor decoder sub-plugin More... | |
static GstCaps * | gst_tensordec_media_caps_from_tensor (GstTensorDecoder *self, const GstTensorsConfig *config) |
Get media caps from tensor config. More... | |
static GstCaps * | gst_tensordec_media_caps_from_structure (GstTensorDecoder *self, const GstStructure *structure) |
Parse structure and return media caps. More... | |
static gboolean | gst_tensordec_check_consistency (GstTensorDecoder *self, GstTensorsConfig *config) |
Check tensor config is consistent. More... | |
static void | gst_tensordec_class_init (GstTensorDecoderClass *klass) |
initialize the tensordec's class More... | |
static void | gst_tensordec_init (GstTensorDecoder *self) |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure More... | |
static gboolean | gst_tensordec_process_plugin_options (GstTensorDecoder *self, guint opnum) |
Process plugin (self->decoder) with given options if available. More... | |
g_free (self->option[(opnum) - 1]) | |
opnum: \ More... | |
if (!gst_tensordec_process_plugin_options(self,(opnum) - 1)) GST_ERROR_OBJECT(self | |
Configuring option for tensor decoder | failed (option %d=%s)" |
g_value_set_string (value, self->option[opnum - 1]) | |
opnum: \ More... | |
static gboolean | gst_tensordec_configure (GstTensorDecoder *self, const GstCaps *in_caps, const GstCaps *out_caps) |
Configure tensor metadata from sink caps. More... | |
int | nnstreamer_decoder_custom_register (const gchar *name, tensor_decoder_custom func, void *data) |
Registers a callback for tensor_decoder custom condition. More... | |
int | nnstreamer_decoder_custom_unregister (const gchar *name) |
Unregisters a callback for tensor_decoder custom condition. More... | |
Variables | |
static GstStaticPadTemplate | sink_factory |
The capabilities of the inputs. More... | |
static GstStaticPadTemplate | src_factory |
The capabilities of the outputs. More... | |
self | option [(opnum) - 1] = g_value_dup_string (value) |
Configuring option for tensor decoder | opnum |
GStreamer plugin to convert tensors (as a filter for other general neural network filters) to other media types.
GStreamer / NNStreamer tensor_decoder main Copyright (C) 2005 Thomas Vander Stichele thoma Copyright (C) 2005 Ronald S. Bultje s@ap estaa rt.o rgrbult Copyright (C) 2018 Jijoong Moon je@r onald .bit freak .netjijoo ng.m oon@s amsu ng.co m
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; version 2.1 of the License.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details.
gst_tensordec_transform_size () may be incorrect if direction is SINK.
If configured = TRUE, it holds TRUE until exit. What if configuration changes in run-time?
Definition in file gsttensor_decoder.c.
#define CAPS_STRING GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_DEFAULT ";" GST_TENSORS_FLEX_CAP_DEFAULT |
Support multi-tensor along with single-tensor as the input.
Definition at line 89 of file gsttensor_decoder.c.
#define DBG (!self->silent) |
Macro for debug mode.
SECTION:element-tensordec
A filter that converts tensor stream for NN frameworks to media stream. The input is always in the format of other/tensor
<refsect2> <title>Example launch line</title> |[ gst-launch -v -m fakesink ! tensor_decoder ! fakesrc silent=TRUE ]| </refsect2>
Definition at line 54 of file gsttensor_decoder.c.
#define DEFAULT_SILENT TRUE |
Flag to print minimized log.
Definition at line 84 of file gsttensor_decoder.c.
#define GST_CAT_DEFAULT gst_tensordec_debug |
Definition at line 58 of file gsttensor_decoder.c.
#define gst_tensor_decoder_clean_plugin | ( | self | ) |
Macro to clean sub-plugin data.
Definition at line 200 of file gsttensor_decoder.c.
#define gst_tensordec_parent_class parent_class |
Definition at line 107 of file gsttensor_decoder.c.
#define PROP_MODE_OPTION | ( | opnum | ) | case PROP_MODE_OPTION |
A macro to process incoming per-mode option.
[in] | opnum | The option number (1 to TensorDecMaxOpNum) |
Definition at line 457 of file gsttensor_decoder.c.
#define PROP_READ_OPTION | ( | opnum | ) | case PROP_MODE_OPTION |
A macro to read per-mode option.
[in] | opnum | The option number (1 to TensorDecMaxOpNum) |
Definition at line 556 of file gsttensor_decoder.c.
anonymous enum |
Properties.
Definition at line 63 of file gsttensor_decoder.c.
G_DEFINE_TYPE | ( | GstTensorDecoder | , |
gst_tensordec | , | ||
GST_TYPE_BASE_TRANSFORM | |||
) |
g_free | ( | self-> | option[(opnum) - 1] | ) |
opnum: \
g_value_set_string | ( | value | , |
self-> | option[opnum - 1] | ||
) |
opnum: \
GST_DEBUG_CATEGORY_STATIC | ( | gst_tensordec_debug | ) |
|
static |
Check tensor config is consistent.
self | "this" pointer to check consistency |
t_info | newly configured tensor metadata |
not configured yet
Definition at line 269 of file gsttensor_decoder.c.
|
static |
Finalize instance (GObject vmethod)
Definition at line 618 of file gsttensor_decoder.c.
|
static |
initialize the tensordec's class
Refer: https://gstreamer.freedesktop.org/documentation/design/element-transform.html
Processing units
Negotiation units
Allocation units
Definition at line 287 of file gsttensor_decoder.c.
|
static |
Configure tensor metadata from sink caps.
This caps is coming from tensor
If previous input configuration is set and is not compatible with incoming caps, get possible media caps from sub-plugin and change input configuration.
Check if outcaps is compatible with new caps
Definition at line 641 of file gsttensor_decoder.c.
|
static |
fixate caps. required vmethod of BaseTransform
In gst_tensordec_transform_caps, we have refused to specify caps if the direction is GST_PAD_SRC. Thus, gstreamer shouldn't fixate it with GST_PAD_SRC. If this happens, it's either internal logic error or GST bUG.
Definition at line 852 of file gsttensor_decoder.c.
|
static |
Get property (GObject vmethod)
Definition at line 565 of file gsttensor_decoder.c.
|
static |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure
Definition at line 416 of file gsttensor_decoder.c.
|
static |
Parse structure and return media caps.
self | "this" pointer |
structure | structure to be interpreted |
Definition at line 245 of file gsttensor_decoder.c.
|
static |
Get media caps from tensor config.
self | "this" pointer |
config | tensor config info |
Definition at line 217 of file gsttensor_decoder.c.
|
static |
Process plugin (self->decoder) with given options if available.
FALSE | if error. TRUE if OK (or SKIP) |
Definition at line 440 of file gsttensor_decoder.c.
|
static |
set caps. required vmethod of BaseTransform
Check if outcaps ==equivalent== supposed
Definition at line 913 of file gsttensor_decoder.c.
|
static |
Set property (GObject vmethod)
GObject vmethod implementations
Definition at line 470 of file gsttensor_decoder.c.
|
static |
non-ip transform. required vmethod for BaseTransform class.
GstBaseTransform vmethod implementations
Internal logic error. Negotiation process should prevent this!
Definition at line 696 of file gsttensor_decoder.c.
|
static |
configure tensor-srcpad cap from "proposed" cap.
@trans ("this" pointer) @direction (why do we need this?) @caps sinkpad cap @filter this element's cap (don't know specifically.)
caps = sinkpad (other/tensor) return = srcpad (media)
caps = srcpad (media) return = sinkpad (other/tensor)
Definition at line 786 of file gsttensor_decoder.c.
|
static |
Tell the framework the required size of buffer based on the info of the other side pad. optional vmethod of BaseTransform.
This is called when non-ip mode is used.
Definition at line 945 of file gsttensor_decoder.c.
if | ( | ! | gst_tensordec_process_plugin_optionsself,(opnum) - 1 | ) |
int nnstreamer_decoder_custom_register | ( | const gchar * | name, |
tensor_decoder_custom | func, | ||
void * | data | ||
) |
Registers a callback for tensor_decoder custom condition.
Register the custom callback function.
Definition at line 972 of file gsttensor_decoder.c.
int nnstreamer_decoder_custom_unregister | ( | const gchar * | name | ) |
Unregisters a callback for tensor_decoder custom condition.
Unregister the custom callback function.
Definition at line 998 of file gsttensor_decoder.c.
void nnstreamer_decoder_exit | ( | const char * | name | ) |
Decoder's sub-plugin may call this to unregister itself.
[in] | name | The name of decoder sub-plugin. |
Definition at line 166 of file gsttensor_decoder.c.
const GstTensorDecoderDef* nnstreamer_decoder_find | ( | const char * | name | ) |
Find decoder sub-plugin with the name.
[in] | name | The name of decoder sub-plugin. |
Definition at line 177 of file gsttensor_decoder.c.
int nnstreamer_decoder_probe | ( | GstTensorDecoderDef * | decoder | ) |
Decoder's sub-plugin should call this function to register itself.
[in] | decoder | Decoder sub-plugin to be registered. |
Definition at line 155 of file gsttensor_decoder.c.
void nnstreamer_decoder_set_custom_property_desc | ( | const char * | name, |
const char * | prop, | ||
... | |||
) |
set custom property description for tensor decoder sub-plugin
Definition at line 186 of file gsttensor_decoder.c.
|
static |
Validate decoder sub-plugin's data.
Definition at line 134 of file gsttensor_decoder.c.
Configuring option for tensor decoder opnum |
Definition at line 463 of file gsttensor_decoder.c.
Configuring option for tensor decoder self option = g_value_dup_string (value) |
Definition at line 460 of file gsttensor_decoder.c.
|
static |
The capabilities of the inputs.
Definition at line 94 of file gsttensor_decoder.c.
|
static |
The capabilities of the outputs.
Definition at line 102 of file gsttensor_decoder.c.