Doxygen Book
tensor_filter_custom.c File Reference

Custom tensor post-processing interface for NNStreamer suite between NN developer-plugins and NNstreamer. More...

#include <errno.h>
#include <glib.h>
#include <gmodule.h>
#include "tensor_filter_custom.h"
#include "nnstreamer_plugin_api_filter.h"
#include "nnstreamer_conf.h"
#include <nnstreamer_log.h>
Include dependency graph for tensor_filter_custom.c:

Go to the source code of this file.

Classes

struct  _internal_data
 internal_data More...
 

Typedefs

typedef struct _internal_data internal_data
 

Functions

void init_filter_custom (void)
 Initialize this object for tensor_filter subplugin runtime register. More...
 
static int custom_loadlib (const GstTensorFilterProperties *prop, void **private_data)
 Load the custom library. Will skip loading if it's already loaded. More...
 
static int custom_open (const GstTensorFilterProperties *prop, void **private_data)
 The open callback for GstTensorFilterFramework. Called before anything else. More...
 
static int custom_invoke (const GstTensorFilterProperties *prop, void **private_data, const GstTensorMemory *input, GstTensorMemory *output)
 The mandatory callback for GstTensorFilterFramework. More...
 
static int custom_getInputDim (const GstTensorFilterProperties *prop, void **private_data, GstTensorsInfo *info)
 The optional callback for GstTensorFilterFramework. More...
 
static int custom_getOutputDim (const GstTensorFilterProperties *prop, void **private_data, GstTensorsInfo *info)
 The optional callback for GstTensorFilterFramework. More...
 
static int custom_setInputDim (const GstTensorFilterProperties *prop, void **private_data, const GstTensorsInfo *in_info, GstTensorsInfo *out_info)
 The set-input-dim callback for GstTensorFilterFramework. More...
 
static void custom_close (const GstTensorFilterProperties *prop, void **private_data)
 Free privateData and move on. More...
 
static void custom_destroyNotify (void **private_data, void *data)
 The optional callback for GstTensorFilterFramework. More...
 
static int custom_allocateInInvoke (void **private_data)
 The optional callback for GstTensorFilterFramework. More...
 
static int custom_checkAvailability (accl_hw hw)
 Check support of the backend. More...
 
void fini_filter_custom (void)
 Destruct the subplugin. More...
 

Variables

static gchar filter_subplugin_custom [] = "custom"
 
static GstTensorFilterFramework NNS_support_custom
 

Detailed Description

Custom tensor post-processing interface for NNStreamer suite between NN developer-plugins and NNstreamer.

GStreamer Tensor_Filter Module Copyright (C) 2018 MyungJoo Ham myung.nosp@m.joo..nosp@m.ham@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.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.

Date
01 Jun 2018
See also
http://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

This is the per-NN-framework plugin (custom) for tensor_filter. Fill in "GstTensorFilterFramework" for tensor_filter.h/c

Definition in file tensor_filter_custom.c.

Typedef Documentation

◆ internal_data

typedef struct _internal_data internal_data

Definition at line 57 of file tensor_filter_custom.c.

Function Documentation

◆ custom_allocateInInvoke()

static int custom_allocateInInvoke ( void **  private_data)
static

The optional callback for GstTensorFilterFramework.

Definition at line 283 of file tensor_filter_custom.c.

◆ custom_checkAvailability()

static int custom_checkAvailability ( accl_hw  hw)
static

Check support of the backend.

Definition at line 298 of file tensor_filter_custom.c.

Here is the call graph for this function:

◆ custom_close()

static void custom_close ( const GstTensorFilterProperties prop,
void **  private_data 
)
static

Free privateData and move on.

Definition at line 252 of file tensor_filter_custom.c.

Here is the call graph for this function:

◆ custom_destroyNotify()

static void custom_destroyNotify ( void **  private_data,
void *  data 
)
static

The optional callback for GstTensorFilterFramework.

Definition at line 267 of file tensor_filter_custom.c.

Here is the call graph for this function:

◆ custom_getInputDim()

static int custom_getInputDim ( const GstTensorFilterProperties prop,
void **  private_data,
GstTensorsInfo info 
)
static

The optional callback for GstTensorFilterFramework.

Definition at line 193 of file tensor_filter_custom.c.

◆ custom_getOutputDim()

static int custom_getOutputDim ( const GstTensorFilterProperties prop,
void **  private_data,
GstTensorsInfo info 
)
static

The optional callback for GstTensorFilterFramework.

Definition at line 212 of file tensor_filter_custom.c.

◆ custom_invoke()

static int custom_invoke ( const GstTensorFilterProperties prop,
void **  private_data,
const GstTensorMemory input,
GstTensorMemory output 
)
static

The mandatory callback for GstTensorFilterFramework.

Parameters
propThe properties of parent object
[in]inputThe array of input tensors
[out]outputThe array of output tensors
Returns
0 if OK. non-zero if error.

Definition at line 167 of file tensor_filter_custom.c.

◆ custom_loadlib()

static int custom_loadlib ( const GstTensorFilterProperties prop,
void **  private_data 
)
static

Load the custom library. Will skip loading if it's already loaded.

Returns
0 if successfully loaded. 1 if skipped (already loaded). -1 if error
Todo:
: Check the integrity of filter->data and filter->model_file, nnfw
Todo:
Double check if this check is really required and safe

Definition at line 64 of file tensor_filter_custom.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ custom_open()

static int custom_open ( const GstTensorFilterProperties prop,
void **  private_data 
)
static

The open callback for GstTensorFilterFramework. Called before anything else.

Definition at line 138 of file tensor_filter_custom.c.

Here is the call graph for this function:

◆ custom_setInputDim()

static int custom_setInputDim ( const GstTensorFilterProperties prop,
void **  private_data,
const GstTensorsInfo in_info,
GstTensorsInfo out_info 
)
static

The set-input-dim callback for GstTensorFilterFramework.

Definition at line 231 of file tensor_filter_custom.c.

◆ fini_filter_custom()

void fini_filter_custom ( void  )

Destruct the subplugin.

Definition at line 335 of file tensor_filter_custom.c.

Here is the call graph for this function:

◆ init_filter_custom()

void init_filter_custom ( void  )

Initialize this object for tensor_filter subplugin runtime register.

Definition at line 38 of file tensor_filter_custom.c.

Variable Documentation

◆ filter_subplugin_custom

gchar filter_subplugin_custom[] = "custom"
static

Definition at line 306 of file tensor_filter_custom.c.

◆ NNS_support_custom

GstTensorFilterFramework NNS_support_custom
static
Initial value:
= {
.allow_in_place = FALSE,
.allocate_in_invoke = TRUE,
.run_without_model = FALSE,
.invoke_NN = custom_invoke,
.handleEvent = NULL,
.getInputDimension = custom_getInputDim,
.getOutputDimension = custom_getOutputDim,
.setInputDimension = custom_setInputDim,
.open = custom_open,
.close = custom_close,
.destroyNotify = custom_destroyNotify,
.allocateInInvoke = custom_allocateInInvoke,
.checkAvailability = custom_checkAvailability,
}

Definition at line 308 of file tensor_filter_custom.c.

custom_destroyNotify
static void custom_destroyNotify(void **private_data, void *data)
The optional callback for GstTensorFilterFramework.
Definition: tensor_filter_custom.c:267
FALSE
return FALSE
Definition: gsttensor_transform.c:590
custom_open
static int custom_open(const GstTensorFilterProperties *prop, void **private_data)
The open callback for GstTensorFilterFramework. Called before anything else.
Definition: tensor_filter_custom.c:138
custom_getInputDim
static int custom_getInputDim(const GstTensorFilterProperties *prop, void **private_data, GstTensorsInfo *info)
The optional callback for GstTensorFilterFramework.
Definition: tensor_filter_custom.c:193
GST_TENSOR_FILTER_FRAMEWORK_V0
#define GST_TENSOR_FILTER_FRAMEWORK_V0
Definition: nnstreamer_plugin_api_filter.h:37
filter_subplugin_custom
static gchar filter_subplugin_custom[]
Definition: tensor_filter_custom.c:306
custom_getOutputDim
static int custom_getOutputDim(const GstTensorFilterProperties *prop, void **private_data, GstTensorsInfo *info)
The optional callback for GstTensorFilterFramework.
Definition: tensor_filter_custom.c:212
TRUE
return TRUE
Definition: gsttensor_if.c:897
custom_setInputDim
static int custom_setInputDim(const GstTensorFilterProperties *prop, void **private_data, const GstTensorsInfo *in_info, GstTensorsInfo *out_info)
The set-input-dim callback for GstTensorFilterFramework.
Definition: tensor_filter_custom.c:231
custom_checkAvailability
static int custom_checkAvailability(accl_hw hw)
Check support of the backend.
Definition: tensor_filter_custom.c:298
custom_invoke
static int custom_invoke(const GstTensorFilterProperties *prop, void **private_data, const GstTensorMemory *input, GstTensorMemory *output)
The mandatory callback for GstTensorFilterFramework.
Definition: tensor_filter_custom.c:167
custom_close
static void custom_close(const GstTensorFilterProperties *prop, void **private_data)
Free privateData and move on.
Definition: tensor_filter_custom.c:252
custom_allocateInInvoke
static int custom_allocateInInvoke(void **private_data)
The optional callback for GstTensorFilterFramework.
Definition: tensor_filter_custom.c:283