GStreamer plugin to merge 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_merge.h"
Go to the source code of this file.
Macros | |
#define | GST_CAT_DEFAULT gst_tensor_merge_debug |
#define | DBG (!tensor_merge->silent) |
Macro for debug mode. More... | |
#define | CAPS_STRING GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_WITH_NUM ("1") |
Template caps string. More... | |
#define | gst_tensor_merge_parent_class parent_class |
Enumerations | |
enum | { PROP_0, PROP_MODE, PROP_OPTION, PROP_SYNC_MODE, PROP_SYNC_OPTION, PROP_SILENT } |
Functions | |
GST_DEBUG_CATEGORY_STATIC (gst_tensor_merge_debug) | |
static gboolean | gst_tensor_merge_src_event (GstPad *pad, GstObject *parent, GstEvent *event) |
src event vmethod More... | |
static GstPad * | gst_tensor_merge_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar *req_name, const GstCaps *caps) |
making new request pad (gst element vmethod) More... | |
static GstStateChangeReturn | gst_tensor_merge_change_state (GstElement *element, GstStateChange transition) |
change state (gst element vmethod) More... | |
static gboolean | gst_tensor_merge_sink_event (GstCollectPads *pads, GstCollectData *data, GstEvent *event, GstTensorMerge *tensor_merge) |
sink event vmethod More... | |
static GstFlowReturn | gst_tensor_merge_collected (GstCollectPads *pads, GstTensorMerge *tensor_merge) |
Gst Collect Pads Function which is called once collect pads done. More... | |
static void | gst_tensor_merge_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
Get property (gst element vmethod) More... | |
static void | gst_tensor_merge_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
Get property (gst element vmethod) More... | |
static void | gst_tensor_merge_finalize (GObject *object) |
finalize vmethod More... | |
G_DEFINE_TYPE (GstTensorMerge, gst_tensor_merge, GST_TYPE_ELEMENT) | |
static void | gst_tensor_merge_class_init (GstTensorMergeClass *klass) |
initialize the tensor_merge's class More... | |
static void | gst_tensor_merge_init (GstTensorMerge *tensor_merge) |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure More... | |
static tensor_merge_mode | gst_tensor_merge_get_mode (const gchar *str) |
Get the corresponding mode from the string value. More... | |
static gboolean | gst_tensor_merge_get_merged_config (GstTensorMerge *tensor_merge, const GstTensorsConfig *in_config, GstTensorsConfig *out_config) |
Generate out TensorsConfig with in TensorsConfig. More... | |
static gboolean | gst_tensor_merge_collect_buffer (GstTensorMerge *tensor_merge, GstBuffer *tensors_buf, gboolean *is_eos) |
Looping to generete output buffer for srcpad. More... | |
static GstFlowReturn | gst_tensor_merge_generate_mem (GstTensorMerge *tensor_merge, GstBuffer *tensors_buf, GstBuffer *tensor_buf) |
Generate Output GstMemory. More... | |
static gboolean | gst_tensor_merge_set_src_caps (GstTensorMerge *tensor_merge) |
Set src pad caps if src pad is not negotiated. More... | |
static void | gst_tensor_merge_send_segment_event (GstTensorMerge *tensor_merge, GstClockTime pts, GstClockTime dts) |
Send segment event if necessary. More... | |
static void | gst_tensor_merge_ready_to_paused (GstTensorMerge *tensor_merge) |
Ready --> Pasuse State Change. More... | |
static gboolean | gst_tensor_merge_set_option_data (GstTensorMerge *tensor_merge) |
Setup internal data (data_* in GstTensor_Merge) More... | |
Variables | |
static const gchar * | gst_tensor_merge_mode_string [] |
static const gchar * | gst_tensor_merge_linear_string [] |
static GstStaticPadTemplate | src_templ |
the capabilities of the inputs and outputs. describe the real formats here. More... | |
static GstStaticPadTemplate | sink_templ |
GStreamer plugin to merge 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_merge.c.
#define CAPS_STRING GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_WITH_NUM ("1") |
Template caps string.
Definition at line 102 of file gsttensor_merge.c.
#define DBG (!tensor_merge->silent) |
Macro for debug mode.
Definition at line 73 of file gsttensor_merge.c.
#define GST_CAT_DEFAULT gst_tensor_merge_debug |
Definition at line 67 of file gsttensor_merge.c.
#define gst_tensor_merge_parent_class parent_class |
Definition at line 135 of file gsttensor_merge.c.
anonymous enum |
Enumerator | |
---|---|
PROP_0 | |
PROP_MODE | |
PROP_OPTION | |
PROP_SYNC_MODE | |
PROP_SYNC_OPTION | |
PROP_SILENT |
Definition at line 76 of file gsttensor_merge.c.
G_DEFINE_TYPE | ( | GstTensorMerge | , |
gst_tensor_merge | , | ||
GST_TYPE_ELEMENT | |||
) |
GST_DEBUG_CATEGORY_STATIC | ( | gst_tensor_merge_debug | ) |
SECTION:element-tensormerge
A Merger that merge tensor stream to tensor stream for NN frameworks. The output is always in the format of other/tensor
<refsect2> <title>Example launch line</title> |[ gst-launch -v -m tensor_merge name=merge ! fakesink filesrc location=b.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! merge.sink_0 filesrc location=b.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! merge.sink_1 filesrc location=b.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! merge.sink_2 ]|
|[ gst-launch -v -m tensor_merge name=merge ! filesink location=merge.log multifilesrc location="testsequence_%1d.png" index=0 caps="image/png, framerate=(fraction)30/1" ! pngdec ! tensor_converter ! merge.sink_0 multifilesrc location="testsequence_%1d.png" index=0 caps="image/png, framerate=(fraction)30/1" ! pngdec ! tensor_converter ! merge.sink_1 multifilesrc location="testsequence_%1d.png" index=0 caps="image/png, framerate=(fraction)30/1" ! pngdec ! tensor_converter ! merge.sink_2
</refsect2>
|
static |
change state (gst element vmethod)
Definition at line 776 of file gsttensor_merge.c.
|
static |
initialize the tensor_merge's class
Definition at line 142 of file gsttensor_merge.c.
|
static |
Looping to generete output buffer for srcpad.
tensor_merge | tensor merger |
tensor_buf | output buffer for srcpad |
is_eos | boolean EOS ( End of Stream ) |
Definition at line 448 of file gsttensor_merge.c.
|
static |
Gst Collect Pads Function which is called once collect pads done.
pads | GstCollectPads |
tensor_merge | Merger |
Cannot use gst-pad util to get stream ID (multiple sink pads). Create stream ID using first sink pad.
Definition at line 693 of file gsttensor_merge.c.
|
static |
finalize vmethod
Definition at line 258 of file gsttensor_merge.c.
|
static |
Generate Output GstMemory.
tensor_merge | tensor merger |
tensors_buf | collected tensors buffer |
tensor_buf | output tensor buffer |
Definition at line 475 of file gsttensor_merge.c.
|
static |
Generate out TensorsConfig with in TensorsConfig.
tensor_merge | tensor merger |
in_config | in tensors config data (multi tensors) |
out_config | out tensors config data (single tensor) |
Definition at line 379 of file gsttensor_merge.c.
|
static |
Get the corresponding mode from the string value.
[in] | str | The string value for the mode |
Definition at line 244 of file gsttensor_merge.c.
|
static |
Get property (gst element vmethod)
Definition at line 894 of file gsttensor_merge.c.
|
static |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure
Definition at line 209 of file gsttensor_merge.c.
|
static |
Ready --> Pasuse State Change.
Definition at line 764 of file gsttensor_merge.c.
|
static |
making new request pad (gst element vmethod)
Definition at line 287 of file gsttensor_merge.c.
|
static |
Send segment event if necessary.
Definition at line 666 of file gsttensor_merge.c.
|
static |
Setup internal data (data_* in GstTensor_Merge)
[in/out] | filter "this" pointer. mode & option MUST BE set already. |
TRUE | if ok or not configured, yet. |
FALSE | if given input is configured invalid. |
Definition at line 812 of file gsttensor_merge.c.
|
static |
Get property (gst element vmethod)
Definition at line 841 of file gsttensor_merge.c.
|
static |
Set src pad caps if src pad is not negotiated.
Internal Logic Error?
Definition at line 632 of file gsttensor_merge.c.
|
static |
sink event vmethod
Definition at line 353 of file gsttensor_merge.c.
|
static |
src event vmethod
Definition at line 334 of file gsttensor_merge.c.
|
static |
Definition at line 91 of file gsttensor_merge.c.
|
static |
Definition at line 86 of file gsttensor_merge.c.
|
static |
Definition at line 113 of file gsttensor_merge.c.
|
static |
the capabilities of the inputs and outputs. describe the real formats here.
Definition at line 108 of file gsttensor_merge.c.