GStreamer plugin to demux tensors (as a filter for other general neural network filters) More...
#include <string.h>
#include <gst/gst.h>
#include <glib.h>
#include <nnstreamer_util.h>
#include "gsttensor_demux.h"
Go to the source code of this file.
Macros | |
#define | GST_CAT_DEFAULT gst_tensor_demux_debug |
#define | CAPS_STRING_SINK GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for sink pad. More... | |
#define | CAPS_STRING_SRC GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for src pad. More... | |
#define | gst_tensor_demux_parent_class parent_class |
Enumerations | |
enum | { PROP_0, PROP_SILENT, PROP_TENSORPICK } |
Functions | |
GST_DEBUG_CATEGORY_STATIC (gst_tensor_demux_debug) | |
static GstFlowReturn | gst_tensor_demux_chain (GstPad *pad, GstObject *parent, GstBuffer *buf) |
chain function for sink (gst element vmethod) More... | |
static gboolean | gst_tensor_demux_event (GstPad *pad, GstObject *parent, GstEvent *event) |
event function for sink (gst element vmethod) More... | |
static GstStateChangeReturn | gst_tensor_demux_change_state (GstElement *element, GstStateChange transition) |
change state (gst element vmethod) More... | |
static void | gst_tensor_demux_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
Get property (gst element vmethod) More... | |
static void | gst_tensor_demux_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
Get property (gst element vmethod) More... | |
static void | gst_tensor_demux_dispose (GObject *object) |
dispose function for tensor demux (gst element vmethod) More... | |
G_DEFINE_TYPE (GstTensorDemux, gst_tensor_demux, GST_TYPE_ELEMENT) | |
static void | gst_tensor_demux_class_init (GstTensorDemuxClass *klass) |
initialize the tensor_demux's class More... | |
static void | gst_tensor_demux_init (GstTensorDemux *tensor_demux) |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure More... | |
static void | gst_tensor_demux_remove_src_pads (GstTensorDemux *tensor_demux) |
function to remove srcpad list More... | |
static gboolean | gst_tensor_demux_parse_caps (GstTensorDemux *tensor_demux, GstCaps *caps) |
Parse caps and configure tensors info. More... | |
static gboolean | gst_tensor_demux_get_tensor_config (GstTensorDemux *tensor_demux, GstTensorsConfig *config, const guint nth, const guint total) |
Get tensor config info from configured tensors. More... | |
static GstTensorPad * | gst_tensor_demux_get_tensor_pad (GstTensorDemux *tensor_demux, gboolean *created, const guint nth, const guint total) |
Checking if the source pad is created and if not, create TensorPad. More... | |
static GstFlowReturn | gst_tensor_demux_combine_flows (GstTensorDemux *tensor_demux, GstTensorPad *pad, GstFlowReturn ret) |
Check the status among sources in demux. More... | |
Variables | |
static GstStaticPadTemplate | src_templ |
the capabilities of the inputs and outputs. describe the real formats here. More... | |
static GstStaticPadTemplate | sink_templ |
GStreamer plugin to demux tensors (as a filter for other general neural network filters)
GStreamer 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.
Definition in file gsttensor_demux.c.
#define CAPS_STRING_SINK GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for sink pad.
Definition at line 78 of file gsttensor_demux.c.
#define CAPS_STRING_SRC GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for src pad.
Definition at line 83 of file gsttensor_demux.c.
#define GST_CAT_DEFAULT gst_tensor_demux_debug |
Definition at line 73 of file gsttensor_demux.c.
#define gst_tensor_demux_parent_class parent_class |
Definition at line 119 of file gsttensor_demux.c.
anonymous enum |
Enumerator | |
---|---|
PROP_0 | |
PROP_SILENT | |
PROP_TENSORPICK |
Definition at line 85 of file gsttensor_demux.c.
G_DEFINE_TYPE | ( | GstTensorDemux | , |
gst_tensor_demux | , | ||
GST_TYPE_ELEMENT | |||
) |
GST_DEBUG_CATEGORY_STATIC | ( | gst_tensor_demux_debug | ) |
SECTION:element-tensor_demux
A Demuxer that demux tensors stream to tensor(s) stream for NN frameworks. The output is always in the format of other/tensor or other/tensors.
<refsect2> <title>Example launch line</title> |[ gst-launch-1.0 tensor_mux name=mux ! tensor_demux name=demux \ filesrc location=testcase01_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! mux.sink_0 \ filesrc location=testcase01_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! mux.sink_1 \ filesrc location=testcase01_RGB_100x100.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! mux.sink_2 \ demux.src_0 ! queue ! filesink location=demux00.log \ demux.src_1 ! queue ! filesink location=demux01.log \ demux.src_2 ! queue ! filesink location=demux02.log ]|
|[ gst-launch-1.0 tensor_mux name=mux ! tensor_demux name=demux tensorpick=0,1:2,2+0 \ ... (tensor 0) ! mux.sink_0 \ ... (tensor 1) ! mux.sink_1 \ ... (tensor 2) ! mux.sink_2 \ demux.src_0 ! (tensor 0) ... demux.src_1 ! (tensor 1,2) ... demux.src_2 ! (tensor 2,0) ... ]|
</refsect2>
|
static |
chain function for sink (gst element vmethod)
The number of tensors in the buffer: The number of tensors from caps and gst-buffer should be same when incoming buffer is static tensor. If given buffer is flexible tensor, we cannot get exact number of tensors from config.
Definition at line 476 of file gsttensor_demux.c.
|
static |
change state (gst element vmethod)
Definition at line 586 of file gsttensor_demux.c.
|
static |
initialize the tensor_demux's class
Definition at line 127 of file gsttensor_demux.c.
|
static |
Check the status among sources in demux.
tensor_demux | TensorDemux Object |
TensorPad | Tensorpad |
ret | return status of current pad |
Definition at line 453 of file gsttensor_demux.c.
|
static |
dispose function for tensor demux (gst element vmethod)
Definition at line 219 of file gsttensor_demux.c.
|
static |
event function for sink (gst element vmethod)
Definition at line 252 of file gsttensor_demux.c.
|
static |
Get property (gst element vmethod)
Definition at line 652 of file gsttensor_demux.c.
|
static |
Get tensor config info from configured tensors.
tensor_demux | "this" pointer |
config | tensor config to be filled |
nth | source ordering |
total | number of tensors |
Definition at line 290 of file gsttensor_demux.c.
|
static |
Checking if the source pad is created and if not, create TensorPad.
tensor_demux | TensorDemux Object | |
[out] | created | will be updated in this function |
nth | source ordering | |
total | number of tensors |
Definition at line 349 of file gsttensor_demux.c.
|
static |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure
Definition at line 175 of file gsttensor_demux.c.
|
static |
Parse caps and configure tensors info.
tensor_demux | GstTensorDemux object |
caps | incoming capability |
Definition at line 235 of file gsttensor_demux.c.
|
static |
function to remove srcpad list
Definition at line 199 of file gsttensor_demux.c.
|
static |
Get property (gst element vmethod)
Definition at line 615 of file gsttensor_demux.c.
|
static |
Definition at line 102 of file gsttensor_demux.c.
|
static |
the capabilities of the inputs and outputs. describe the real formats here.
Definition at line 96 of file gsttensor_demux.c.