\hypertarget{struct__GstTensorDecoderDef}{}\doxysection{\+\_\+\+Gst\+Tensor\+Decoder\+Def Struct Reference}
\label{struct__GstTensorDecoderDef}\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}


Decoder definitions for different semantics of tensors This allows developers to create their own decoders.  




{\ttfamily \#include $<$nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h$>$}

\doxysubsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
char $\ast$ \mbox{\hyperlink{struct__GstTensorDecoderDef_aa3e93e7351d0de88ca83ab7f1c0e7e5a}{modename}}
\item 
int($\ast$ \mbox{\hyperlink{struct__GstTensorDecoderDef_a34b46f910c7f6f511ff82f5ba1f349ca}{init}} )(void $\ast$$\ast$private\+\_\+data)
\item 
void($\ast$ \mbox{\hyperlink{struct__GstTensorDecoderDef_ac6c47cfe9f9b96a289547c3ae745b54f}{exit}} )(void $\ast$$\ast$private\+\_\+data)
\item 
int($\ast$ \mbox{\hyperlink{struct__GstTensorDecoderDef_a5edbfdf990aaa4ea02a601da3032916f}{set\+Option}} )(void $\ast$$\ast$private\+\_\+data, int op\+Num, const char $\ast$param)
\item 
Gst\+Caps $\ast$($\ast$ \mbox{\hyperlink{struct__GstTensorDecoderDef_a800762909006a92061b567dd087e9bbe}{get\+Out\+Caps}} )(void $\ast$$\ast$private\+\_\+data, const \mbox{\hyperlink{structGstTensorsConfig}{Gst\+Tensors\+Config}} $\ast$config)
\item 
Gst\+Flow\+Return($\ast$ \mbox{\hyperlink{struct__GstTensorDecoderDef_add340e9839b25bc3dd37ceccfd69f5a1}{decode}} )(void $\ast$$\ast$private\+\_\+data, const \mbox{\hyperlink{structGstTensorsConfig}{Gst\+Tensors\+Config}} $\ast$config, const \mbox{\hyperlink{structGstTensorMemory}{Gst\+Tensor\+Memory}} $\ast$input, Gst\+Buffer $\ast$outbuf)
\item 
size\+\_\+t($\ast$ \mbox{\hyperlink{struct__GstTensorDecoderDef_a454b8ccb20de318310b529df98890b61}{get\+Transform\+Size}} )(void $\ast$$\ast$private\+\_\+data, const \mbox{\hyperlink{structGstTensorsConfig}{Gst\+Tensors\+Config}} $\ast$config, Gst\+Caps $\ast$caps, size\+\_\+t size, Gst\+Caps $\ast$othercaps, Gst\+Pad\+Direction direction)
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Decoder definitions for different semantics of tensors This allows developers to create their own decoders. 

Definition at line 38 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.



\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{struct__GstTensorDecoderDef_add340e9839b25bc3dd37ceccfd69f5a1}\label{struct__GstTensorDecoderDef_add340e9839b25bc3dd37ceccfd69f5a1}} 
\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}!decode@{decode}}
\index{decode@{decode}!\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}
\doxysubsubsection{\texorpdfstring{decode}{decode}}
{\footnotesize\ttfamily Gst\+Flow\+Return($\ast$ \+\_\+\+Gst\+Tensor\+Decoder\+Def\+::decode) (void $\ast$$\ast$private\+\_\+data, const \mbox{\hyperlink{structGstTensorsConfig}{Gst\+Tensors\+Config}} $\ast$config, const \mbox{\hyperlink{structGstTensorMemory}{Gst\+Tensor\+Memory}} $\ast$input, Gst\+Buffer $\ast$outbuf)}

The function to be called when the input tensor incomes into tensor\+\_\+decoder. The sub-\/plugin should update the output buffer. outbuf must be allocated but empty (gst\+\_\+buffer\+\_\+get\+\_\+size (outbuf) == 0).


\begin{DoxyParams}[1]{Parameters}
 & {\em \mbox{[}in/out\mbox{]}} & private\+\_\+data A sub-\/plugin may save its internal private data here. The sub-\/plugin is responsible for alloc/free of this pointer. \\
\hline
\mbox{\texttt{ in}}  & {\em config} & The structure of input tensor info. \\
\hline
\mbox{\texttt{ in}}  & {\em input} & The array of input tensor data. The maximum array size of input data is N\+N\+S\+\_\+\+T\+E\+N\+S\+O\+R\+\_\+\+S\+I\+Z\+E\+\_\+\+L\+I\+M\+IT. \\
\hline
\mbox{\texttt{ out}}  & {\em outbuf} & A sub-\/plugin should update or append proper memory for the negotiated media type. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
G\+S\+T\+\_\+\+F\+L\+O\+W\+\_\+\+OK if OK. 
\end{DoxyReturn}


Definition at line 71 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.

\mbox{\Hypertarget{struct__GstTensorDecoderDef_ac6c47cfe9f9b96a289547c3ae745b54f}\label{struct__GstTensorDecoderDef_ac6c47cfe9f9b96a289547c3ae745b54f}} 
\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}!exit@{exit}}
\index{exit@{exit}!\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}
\doxysubsubsection{\texorpdfstring{exit}{exit}}
{\footnotesize\ttfamily void($\ast$ \+\_\+\+Gst\+Tensor\+Decoder\+Def\+::exit) (void $\ast$$\ast$private\+\_\+data)}

Object destruction for the decoder.


\begin{DoxyParams}{Parameters}
{\em \mbox{[}in/out\mbox{]}} & private\+\_\+data A sub-\/plugin may save its internal private data here. The sub-\/plugin is responsible for alloc/free of this pointer. Normally, the sub-\/plugin may free the private\+\_\+data with this function. \\
\hline
\end{DoxyParams}


Definition at line 48 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.

\mbox{\Hypertarget{struct__GstTensorDecoderDef_a800762909006a92061b567dd087e9bbe}\label{struct__GstTensorDecoderDef_a800762909006a92061b567dd087e9bbe}} 
\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}!getOutCaps@{getOutCaps}}
\index{getOutCaps@{getOutCaps}!\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}
\doxysubsubsection{\texorpdfstring{getOutCaps}{getOutCaps}}
{\footnotesize\ttfamily Gst\+Caps$\ast$($\ast$ \+\_\+\+Gst\+Tensor\+Decoder\+Def\+::get\+Out\+Caps) (void $\ast$$\ast$private\+\_\+data, const \mbox{\hyperlink{structGstTensorsConfig}{Gst\+Tensors\+Config}} $\ast$config)}

The caller should unref the returned Gst\+Caps using gst\+\_\+caps\+\_\+unref(). The sub-\/plugin should validate the information of input tensor and return proper media type. Note that the information of input tensor is not a fixed value and the pipeline may try different values during the cap negotiations. Do N\+OT allocate or fix internal data structure until decode is called.


\begin{DoxyParams}[1]{Parameters}
 & {\em \mbox{[}in/out\mbox{]}} & private\+\_\+data A sub-\/plugin may save its internal private data here. The sub-\/plugin is responsible for alloc/free of this pointer. \\
\hline
\mbox{\texttt{ in}}  & {\em config} & The structure of input tensor info. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Gst\+Caps object describing media type. 
\end{DoxyReturn}


Definition at line 61 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.

\mbox{\Hypertarget{struct__GstTensorDecoderDef_a454b8ccb20de318310b529df98890b61}\label{struct__GstTensorDecoderDef_a454b8ccb20de318310b529df98890b61}} 
\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}!getTransformSize@{getTransformSize}}
\index{getTransformSize@{getTransformSize}!\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}
\doxysubsubsection{\texorpdfstring{getTransformSize}{getTransformSize}}
{\footnotesize\ttfamily size\+\_\+t($\ast$ \+\_\+\+Gst\+Tensor\+Decoder\+Def\+::get\+Transform\+Size) (void $\ast$$\ast$private\+\_\+data, const \mbox{\hyperlink{structGstTensorsConfig}{Gst\+Tensors\+Config}} $\ast$config, Gst\+Caps $\ast$caps, size\+\_\+t size, Gst\+Caps $\ast$othercaps, Gst\+Pad\+Direction direction)}

Optional. The sub-\/plugin may calculate the size in bytes of a buffer. If this is N\+U\+LL, tensor\+\_\+decoder will pass the empty buffer and the sub-\/plugin should append the memory block when called decode. See Gst\+Base\+Transform\+Class\+::transform\+\_\+size for the details.


\begin{DoxyParams}[1]{Parameters}
 & {\em \mbox{[}in/out\mbox{]}} & private\+\_\+data A sub-\/plugin may save its internal private data here. The sub-\/plugin is responsible for alloc/free of this pointer. \\
\hline
\mbox{\texttt{ in}}  & {\em config} & The structure of input tensor info. \\
\hline
\mbox{\texttt{ in}}  & {\em caps} & Gst\+Caps object for the given direction. \\
\hline
\mbox{\texttt{ in}}  & {\em size} & The size of a buffer for the given direction. \\
\hline
\mbox{\texttt{ in}}  & {\em othercaps} & Gst\+Caps object on the other pad for the given direction. \\
\hline
\mbox{\texttt{ in}}  & {\em direction} & The direction of a pad. Normally this is G\+S\+T\+\_\+\+P\+A\+D\+\_\+\+S\+I\+NK. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The size of a buffer. 
\end{DoxyReturn}


Definition at line 82 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.

\mbox{\Hypertarget{struct__GstTensorDecoderDef_a34b46f910c7f6f511ff82f5ba1f349ca}\label{struct__GstTensorDecoderDef_a34b46f910c7f6f511ff82f5ba1f349ca}} 
\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}!init@{init}}
\index{init@{init}!\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}
\doxysubsubsection{\texorpdfstring{init}{init}}
{\footnotesize\ttfamily int($\ast$ \+\_\+\+Gst\+Tensor\+Decoder\+Def\+::init) (void $\ast$$\ast$private\+\_\+data)}

Object initialization for the decoder.


\begin{DoxyParams}{Parameters}
{\em \mbox{[}in/out\mbox{]}} & private\+\_\+data A sub-\/plugin may save its internal private data here. The sub-\/plugin is responsible for alloc/free of this pointer. Normally, the sub-\/plugin may allocate the private\+\_\+data with this function. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if OK. F\+A\+L\+SE if error. 
\end{DoxyReturn}


Definition at line 42 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.

\mbox{\Hypertarget{struct__GstTensorDecoderDef_aa3e93e7351d0de88ca83ab7f1c0e7e5a}\label{struct__GstTensorDecoderDef_aa3e93e7351d0de88ca83ab7f1c0e7e5a}} 
\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}!modename@{modename}}
\index{modename@{modename}!\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}
\doxysubsubsection{\texorpdfstring{modename}{modename}}
{\footnotesize\ttfamily char$\ast$ \+\_\+\+Gst\+Tensor\+Decoder\+Def\+::modename}

Unique decoder name. G\+ST users choose decoders with mode=\char`\"{}modename\char`\"{}. 

Definition at line 40 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.

\mbox{\Hypertarget{struct__GstTensorDecoderDef_a5edbfdf990aaa4ea02a601da3032916f}\label{struct__GstTensorDecoderDef_a5edbfdf990aaa4ea02a601da3032916f}} 
\index{\_GstTensorDecoderDef@{\_GstTensorDecoderDef}!setOption@{setOption}}
\index{setOption@{setOption}!\_GstTensorDecoderDef@{\_GstTensorDecoderDef}}
\doxysubsubsection{\texorpdfstring{setOption}{setOption}}
{\footnotesize\ttfamily int($\ast$ \+\_\+\+Gst\+Tensor\+Decoder\+Def\+::set\+Option) (void $\ast$$\ast$private\+\_\+data, int op\+Num, const char $\ast$param)}

Process with the given options. It can be called repeatedly.


\begin{DoxyParams}[1]{Parameters}
 & {\em \mbox{[}in/out\mbox{]}} & private\+\_\+data A sub-\/plugin may save its internal private data here. The sub-\/plugin is responsible for alloc/free of this pointer. \\
\hline
\mbox{\texttt{ in}}  & {\em op\+Num} & The index of the given options. \\
\hline
\mbox{\texttt{ in}}  & {\em param} & The option string. A sub-\/plugin should parse the string to get the proper value. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if OK. F\+A\+L\+SE if error. 
\end{DoxyReturn}


Definition at line 53 of file nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
nnstreamer/include/\mbox{\hyperlink{nnstreamer__plugin__api__decoder_8h}{nnstreamer\+\_\+plugin\+\_\+api\+\_\+decoder.\+h}}\end{DoxyCompactItemize}
