GStreamer plugin to mux 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_mux.h"
Go to the source code of this file.
Macros | |
#define | GST_CAT_DEFAULT gst_tensor_mux_debug |
#define | DBG (!tensor_mux->silent) |
Macro for debug mode. More... | |
#define | CAPS_STRING_SINK GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for sink pad. More... | |
#define | CAPS_STRING_SRC GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for src pad. More... | |
#define | gst_tensor_mux_parent_class parent_class |
Enumerations | |
enum | { PROP_0, PROP_SILENT, PROP_SYNC_MODE, PROP_SYNC_OPTION } |
Functions | |
GST_DEBUG_CATEGORY_STATIC (gst_tensor_mux_debug) | |
static gboolean | gst_tensor_mux_src_event (GstPad *pad, GstObject *parent, GstEvent *event) |
src event vmethod More... | |
static GstPad * | gst_tensor_mux_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_mux_change_state (GstElement *element, GstStateChange transition) |
change state (gst element vmethod) More... | |
static gboolean | gst_tensor_mux_sink_event (GstCollectPads *pads, GstCollectData *data, GstEvent *event, GstTensorMux *tensor_mux) |
sink event vmethod More... | |
static GstFlowReturn | gst_tensor_mux_collected (GstCollectPads *pads, GstTensorMux *tensor_mux) |
Gst Collect Pads Function which is called once collect pads done. More... | |
static GstFlowReturn | gst_tensor_mux_do_clip (GstCollectPads *pads, GstCollectData *data, GstBuffer *buffer, GstBuffer **out, GstTensorMux *tensor_mux) |
Gst Clip Pads Function which is called right after a buffer is received for each pad. More... | |
static void | gst_tensor_mux_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
Get property (gst element vmethod) More... | |
static void | gst_tensor_mux_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
Get property (gst element vmethod) More... | |
static void | gst_tensor_mux_finalize (GObject *object) |
finalize vmethod More... | |
G_DEFINE_TYPE (GstTensorMux, gst_tensor_mux, GST_TYPE_ELEMENT) | |
static void | gst_tensor_mux_class_init (GstTensorMuxClass *klass) |
initialize the tensor_mux's class More... | |
static void | gst_tensor_mux_init (GstTensorMux *tensor_mux) |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure More... | |
static void | gst_tensor_mux_set_waiting (GstTensorMux *tensor_mux, gboolean waiting) |
set pads waiting property More... | |
static gboolean | gst_tensor_mux_collect_buffer (GstTensorMux *tensor_mux, GstBuffer *tensors_buf, gboolean *is_eos) |
Looping to generete output buffer for srcpad. More... | |
static gboolean | gst_tensor_mux_set_src_caps (GstTensorMux *tensor_mux) |
Set src pad caps if src pad is not negotiated. More... | |
static void | gst_tensor_mux_send_segment_event (GstTensorMux *tensor_mux, GstClockTime pts, GstClockTime dts) |
Create a new segment event if necessary. More... | |
static GstBuffer * | gst_tensor_mux_chain_flex_tensor (GstTensorMux *tensor_mux, GstBuffer *buf) |
Process flex tensor. More... | |
static void | gst_tensor_mux_ready_to_paused (GstTensorMux *tensor_mux) |
Ready --> Pasuse State Change. 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 mux 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_mux.c.
#define CAPS_STRING_SINK GST_TENSOR_CAP_DEFAULT ";" GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for sink pad.
Definition at line 89 of file gsttensor_mux.c.
#define CAPS_STRING_SRC GST_TENSORS_CAP_MAKE ("{ static, flexible }") |
Default caps string for src pad.
Definition at line 94 of file gsttensor_mux.c.
#define DBG (!tensor_mux->silent) |
Macro for debug mode.
Definition at line 75 of file gsttensor_mux.c.
#define GST_CAT_DEFAULT gst_tensor_mux_debug |
Definition at line 69 of file gsttensor_mux.c.
#define gst_tensor_mux_parent_class parent_class |
Definition at line 132 of file gsttensor_mux.c.
anonymous enum |
Enumerator | |
---|---|
PROP_0 | |
PROP_SILENT | |
PROP_SYNC_MODE | |
PROP_SYNC_OPTION |
Definition at line 78 of file gsttensor_mux.c.
G_DEFINE_TYPE | ( | GstTensorMux | , |
gst_tensor_mux | , | ||
GST_TYPE_ELEMENT | |||
) |
GST_DEBUG_CATEGORY_STATIC | ( | gst_tensor_mux_debug | ) |
SECTION:element-tensormux
A Muxer that merge tensor stream to tensors stream for NN frameworks. The output is always in the format of other/tensors
<refsect2> <title>Example launch line</title> |[ gst-launch -v -m \ filesrc location=b.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! mux.sink_0 \ filesrc location=b.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! mux.sink_1 \ filesrc location=b.png ! pngdec ! videoscale ! imagefreeze ! videoconvert ! video/x-raw,format=RGB,width=100,height=100,framerate=0/1 ! tensor_converter ! mux.sink_2 \ tensor_mux name=mux ! fakesink ]|
|[ gst-launch -v -m \ multifilesrc location="testsequence_%1d.png" index=0 caps="image/png, framerate=(fraction)30/1" ! pngdec ! tensor_converter ! mux.sink_0 \ multifilesrc location="testsequence_%1d.png" index=0 caps="image/png, framerate=(fraction)30/1" ! pngdec ! tensor_converter ! mux.sink_1 \ multifilesrc location="testsequence_%1d.png" index=0 caps="image/png, framerate=(fraction)30/1" ! pngdec ! tensor_converter ! mux.sink_2 \ tensor_mux name=mux ! filesink location=mux.log ]| </refsect2>
|
static |
Process flex tensor.
Definition at line 446 of file gsttensor_mux.c.
|
static |
change state (gst element vmethod)
Definition at line 584 of file gsttensor_mux.c.
|
static |
initialize the tensor_mux's class
Definition at line 139 of file gsttensor_mux.c.
|
static |
Looping to generete output buffer for srcpad.
tensor_mux | tensor muxer |
tensors_buf | output buffer for srcpad |
is_eos | boolean EOS ( End of Stream ) |
Definition at line 368 of file gsttensor_mux.c.
|
static |
Gst Collect Pads Function which is called once collect pads done.
pads | GstCollectPads |
tensor_mux | Muxer |
Cannot use gst-pad util to get stream ID (multiple sink pads). Create stream ID using first sink pad.
Definition at line 486 of file gsttensor_mux.c.
|
static |
Gst Clip Pads Function which is called right after a buffer is received for each pad.
Definition at line 558 of file gsttensor_mux.c.
|
static |
finalize vmethod
Definition at line 227 of file gsttensor_mux.c.
|
static |
Get property (gst element vmethod)
Definition at line 650 of file gsttensor_mux.c.
|
static |
initialize the new element instantiate pads and add them to element set pad callback functions initialize instance structure
Definition at line 193 of file gsttensor_mux.c.
|
static |
Ready --> Pasuse State Change.
Definition at line 572 of file gsttensor_mux.c.
|
static |
making new request pad (gst element vmethod)
Definition at line 253 of file gsttensor_mux.c.
|
static |
Create a new segment event if necessary.
Definition at line 422 of file gsttensor_mux.c.
|
static |
Get property (gst element vmethod)
Definition at line 617 of file gsttensor_mux.c.
|
static |
Set src pad caps if src pad is not negotiated.
Definition at line 393 of file gsttensor_mux.c.
|
static |
set pads waiting property
Definition at line 322 of file gsttensor_mux.c.
|
static |
sink event vmethod
Definition at line 339 of file gsttensor_mux.c.
|
static |
src event vmethod
Definition at line 303 of file gsttensor_mux.c.
|
static |
Definition at line 106 of file gsttensor_mux.c.
|
static |
the capabilities of the inputs and outputs. describe the real formats here.
Definition at line 100 of file gsttensor_mux.c.