\hypertarget{group___mmal_utilities}{}\section{Utility functions}
\label{group___mmal_utilities}\index{Utility functions@{Utility functions}}
\subsection*{Modules}
\begin{DoxyCompactItemize}
\item 
\hyperlink{group___mmal_component_wrapper}{utility}
\item 
\hyperlink{group___mmal_connection_utility}{Port connection utility}
\item 
\hyperlink{group___mmal_graph_utility}{Graph Utility}
\item 
\hyperlink{group___mmal_i_l_utility}{M\+M\+A\+L to O\+M\+X I\+L conversion utilities}
\item 
\hyperlink{group___mmal_rational_utilities}{Rational Utility Functions}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{group___mmal_utilities_ga929afb11737fa1f65234bf0af53e11a2}{M\+M\+A\+L\+\_\+\+O\+F\+F\+S\+E\+T}(T\+Y\+P\+E,  F\+I\+E\+L\+D)~((size\+\_\+t)((uint8\+\_\+t $\ast$)\&((T\+Y\+P\+E$\ast$)0)-\/$>$F\+I\+E\+L\+D -\/ (uint8\+\_\+t $\ast$)0))
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
const char $\ast$ \hyperlink{group___mmal_utilities_gaa7effcf538b48b6ac43133ad7d078044}{mmal\+\_\+status\+\_\+to\+\_\+string} (\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T} status)
\item 
uint32\+\_\+t \hyperlink{group___mmal_utilities_ga8027f8612035849d1bf5ce22e7797c60}{mmal\+\_\+encoding\+\_\+stride\+\_\+to\+\_\+width} (uint32\+\_\+t encoding, uint32\+\_\+t stride)
\item 
uint32\+\_\+t \hyperlink{group___mmal_utilities_ga5e5f391d5089161a0be21687b68a160e}{mmal\+\_\+encoding\+\_\+width\+\_\+to\+\_\+stride} (uint32\+\_\+t encoding, uint32\+\_\+t width)
\item 
const char $\ast$ \hyperlink{group___mmal_utilities_ga04f035c7f4403cf08cc8f8961b4dc7a3}{mmal\+\_\+port\+\_\+type\+\_\+to\+\_\+string} (\hyperlink{group___mmal_port_gafcd53d504d5e497ee9932be2aee0154a}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T\+Y\+P\+E\+\_\+\+T} type)
\item 
\hyperlink{struct_m_m_a_l___p_a_r_a_m_e_t_e_r___h_e_a_d_e_r___t}{M\+M\+A\+L\+\_\+\+P\+A\+R\+A\+M\+E\+T\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$ \hyperlink{group___mmal_utilities_ga63c0afe0ef5c20415d40681346cdd5c3}{mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get} (\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$port, uint32\+\_\+t id, uint32\+\_\+t size, \hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T} $\ast$status)
\item 
void \hyperlink{group___mmal_utilities_ga7e7dd0cc19e5c16dcd9cc9229c4d2708}{mmal\+\_\+port\+\_\+parameter\+\_\+free} (\hyperlink{struct_m_m_a_l___p_a_r_a_m_e_t_e_r___h_e_a_d_e_r___t}{M\+M\+A\+L\+\_\+\+P\+A\+R\+A\+M\+E\+T\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$param)
\item 
void \hyperlink{group___mmal_utilities_gac3a09589576f4bd4cbd8a149dae84046}{mmal\+\_\+buffer\+\_\+header\+\_\+copy\+\_\+header} (\hyperlink{struct_m_m_a_l___b_u_f_f_e_r___h_e_a_d_e_r___t}{M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$dest, const \hyperlink{struct_m_m_a_l___b_u_f_f_e_r___h_e_a_d_e_r___t}{M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$src)
\item 
\hyperlink{struct_m_m_a_l___p_o_o_l___t}{M\+M\+A\+L\+\_\+\+P\+O\+O\+L\+\_\+\+T} $\ast$ \hyperlink{group___mmal_utilities_ga7228191288b87cfcd45d275bed55fa38}{mmal\+\_\+port\+\_\+pool\+\_\+create} (\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$port, unsigned int headers, uint32\+\_\+t payload\+\_\+size)
\item 
void \hyperlink{group___mmal_utilities_ga1809406ac2ea1d5c4cb5569487b22048}{mmal\+\_\+port\+\_\+pool\+\_\+destroy} (\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$port, \hyperlink{struct_m_m_a_l___p_o_o_l___t}{M\+M\+A\+L\+\_\+\+P\+O\+O\+L\+\_\+\+T} $\ast$pool)
\item 
void \hyperlink{group___mmal_utilities_ga8d228d5c170cc5a92c53b475e5069d54}{mmal\+\_\+log\+\_\+dump\+\_\+port} (\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$port)
\item 
void \hyperlink{group___mmal_utilities_ga7449eff2119eeb8f3fa35a39727b5c82}{mmal\+\_\+log\+\_\+dump\+\_\+format} (\hyperlink{struct_m_m_a_l___e_s___f_o_r_m_a_t___t}{M\+M\+A\+L\+\_\+\+E\+S\+\_\+\+F\+O\+R\+M\+A\+T\+\_\+\+T} $\ast$format)
\item 
\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$ \hyperlink{group___mmal_utilities_gaadf255e562d2cf04755e4fdd2963c32b}{mmal\+\_\+util\+\_\+get\+\_\+port} (\hyperlink{struct_m_m_a_l___c_o_m_p_o_n_e_n_t___t}{M\+M\+A\+L\+\_\+\+C\+O\+M\+P\+O\+N\+E\+N\+T\+\_\+\+T} $\ast$comp, \hyperlink{group___mmal_port_gafcd53d504d5e497ee9932be2aee0154a}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T\+Y\+P\+E\+\_\+\+T} type, unsigned index)
\item 
char $\ast$ \hyperlink{group___mmal_utilities_ga840a7068069e0062e1bcf5c5e8665669}{mmal\+\_\+4cc\+\_\+to\+\_\+string} (char $\ast$buf, size\+\_\+t len, uint32\+\_\+t fourcc)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The utility functions provide helpers for common functionality that is not part of the core M\+M\+A\+L A\+P\+I. 

\subsection{Macro Definition Documentation}
\hypertarget{group___mmal_utilities_ga929afb11737fa1f65234bf0af53e11a2}{}\index{Utility functions@{Utility functions}!M\+M\+A\+L\+\_\+\+O\+F\+F\+S\+E\+T@{M\+M\+A\+L\+\_\+\+O\+F\+F\+S\+E\+T}}
\index{M\+M\+A\+L\+\_\+\+O\+F\+F\+S\+E\+T@{M\+M\+A\+L\+\_\+\+O\+F\+F\+S\+E\+T}!Utility functions@{Utility functions}}
\subsubsection[{M\+M\+A\+L\+\_\+\+O\+F\+F\+S\+E\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define M\+M\+A\+L\+\_\+\+O\+F\+F\+S\+E\+T(
\begin{DoxyParamCaption}
\item[{}]{T\+Y\+P\+E, }
\item[{}]{F\+I\+E\+L\+D}
\end{DoxyParamCaption}
)~((size\+\_\+t)((uint8\+\_\+t $\ast$)\&((T\+Y\+P\+E$\ast$)0)-\/$>$F\+I\+E\+L\+D -\/ (uint8\+\_\+t $\ast$)0))}\label{group___mmal_utilities_ga929afb11737fa1f65234bf0af53e11a2}
Offset in bytes of F\+I\+E\+L\+D in T\+Y\+P\+E. 

\subsection{Function Documentation}
\hypertarget{group___mmal_utilities_ga840a7068069e0062e1bcf5c5e8665669}{}\index{Utility functions@{Utility functions}!mmal\+\_\+4cc\+\_\+to\+\_\+string@{mmal\+\_\+4cc\+\_\+to\+\_\+string}}
\index{mmal\+\_\+4cc\+\_\+to\+\_\+string@{mmal\+\_\+4cc\+\_\+to\+\_\+string}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+4cc\+\_\+to\+\_\+string}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ mmal\+\_\+4cc\+\_\+to\+\_\+string (
\begin{DoxyParamCaption}
\item[{char $\ast$}]{buf, }
\item[{size\+\_\+t}]{len, }
\item[{uint32\+\_\+t}]{fourcc}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga840a7068069e0062e1bcf5c5e8665669}
Convert a 4cc into a string.


\begin{DoxyParams}{Parameters}
{\em buf} & Destination for result \\
\hline
{\em len} & Size of result buffer \\
\hline
{\em fourcc} & 4cc to be converted \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
converted string (buf) 
\end{DoxyReturn}
\hypertarget{group___mmal_utilities_gac3a09589576f4bd4cbd8a149dae84046}{}\index{Utility functions@{Utility functions}!mmal\+\_\+buffer\+\_\+header\+\_\+copy\+\_\+header@{mmal\+\_\+buffer\+\_\+header\+\_\+copy\+\_\+header}}
\index{mmal\+\_\+buffer\+\_\+header\+\_\+copy\+\_\+header@{mmal\+\_\+buffer\+\_\+header\+\_\+copy\+\_\+header}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+buffer\+\_\+header\+\_\+copy\+\_\+header}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+buffer\+\_\+header\+\_\+copy\+\_\+header (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$}]{dest, }
\item[{const {\bf M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$}]{src}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_gac3a09589576f4bd4cbd8a149dae84046}
Copy buffer header metadata from source to destination.


\begin{DoxyParams}{Parameters}
{\em dest} & The destination buffer header. \\
\hline
{\em src} & The source buffer header. \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_utilities_ga8027f8612035849d1bf5ce22e7797c60}{}\index{Utility functions@{Utility functions}!mmal\+\_\+encoding\+\_\+stride\+\_\+to\+\_\+width@{mmal\+\_\+encoding\+\_\+stride\+\_\+to\+\_\+width}}
\index{mmal\+\_\+encoding\+\_\+stride\+\_\+to\+\_\+width@{mmal\+\_\+encoding\+\_\+stride\+\_\+to\+\_\+width}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+encoding\+\_\+stride\+\_\+to\+\_\+width}]{\setlength{\rightskip}{0pt plus 5cm}uint32\+\_\+t mmal\+\_\+encoding\+\_\+stride\+\_\+to\+\_\+width (
\begin{DoxyParamCaption}
\item[{uint32\+\_\+t}]{encoding, }
\item[{uint32\+\_\+t}]{stride}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga8027f8612035849d1bf5ce22e7797c60}
Convert stride to pixel width for a given pixel encoding.


\begin{DoxyParams}{Parameters}
{\em encoding} & The pixel encoding (such as one of the \hyperlink{group___mmal_encodings}{pre-\/defined encodings}) \\
\hline
{\em stride} & The stride in bytes. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The width in pixels. 
\end{DoxyReturn}
\hypertarget{group___mmal_utilities_ga5e5f391d5089161a0be21687b68a160e}{}\index{Utility functions@{Utility functions}!mmal\+\_\+encoding\+\_\+width\+\_\+to\+\_\+stride@{mmal\+\_\+encoding\+\_\+width\+\_\+to\+\_\+stride}}
\index{mmal\+\_\+encoding\+\_\+width\+\_\+to\+\_\+stride@{mmal\+\_\+encoding\+\_\+width\+\_\+to\+\_\+stride}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+encoding\+\_\+width\+\_\+to\+\_\+stride}]{\setlength{\rightskip}{0pt plus 5cm}uint32\+\_\+t mmal\+\_\+encoding\+\_\+width\+\_\+to\+\_\+stride (
\begin{DoxyParamCaption}
\item[{uint32\+\_\+t}]{encoding, }
\item[{uint32\+\_\+t}]{width}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga5e5f391d5089161a0be21687b68a160e}
Convert pixel width to stride for a given pixel encoding


\begin{DoxyParams}{Parameters}
{\em encoding} & The pixel encoding (such as one of the \hyperlink{group___mmal_encodings}{pre-\/defined encodings}) \\
\hline
{\em width} & The width in pixels. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The stride in bytes. 
\end{DoxyReturn}
\hypertarget{group___mmal_utilities_ga7449eff2119eeb8f3fa35a39727b5c82}{}\index{Utility functions@{Utility functions}!mmal\+\_\+log\+\_\+dump\+\_\+format@{mmal\+\_\+log\+\_\+dump\+\_\+format}}
\index{mmal\+\_\+log\+\_\+dump\+\_\+format@{mmal\+\_\+log\+\_\+dump\+\_\+format}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+log\+\_\+dump\+\_\+format}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+log\+\_\+dump\+\_\+format (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+E\+S\+\_\+\+F\+O\+R\+M\+A\+T\+\_\+\+T} $\ast$}]{format}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga7449eff2119eeb8f3fa35a39727b5c82}
Log the content of a \hyperlink{struct_m_m_a_l___e_s___f_o_r_m_a_t___t}{M\+M\+A\+L\+\_\+\+E\+S\+\_\+\+F\+O\+R\+M\+A\+T\+\_\+\+T} structure.


\begin{DoxyParams}{Parameters}
{\em format} & Pointer to the format to dump. \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_utilities_ga8d228d5c170cc5a92c53b475e5069d54}{}\index{Utility functions@{Utility functions}!mmal\+\_\+log\+\_\+dump\+\_\+port@{mmal\+\_\+log\+\_\+dump\+\_\+port}}
\index{mmal\+\_\+log\+\_\+dump\+\_\+port@{mmal\+\_\+log\+\_\+dump\+\_\+port}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+log\+\_\+dump\+\_\+port}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+log\+\_\+dump\+\_\+port (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$}]{port}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga8d228d5c170cc5a92c53b475e5069d54}
Log the content of a \hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} structure.


\begin{DoxyParams}{Parameters}
{\em port} & Pointer to the port to dump. \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_utilities_ga63c0afe0ef5c20415d40681346cdd5c3}{}\index{Utility functions@{Utility functions}!mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get@{mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get}}
\index{mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get@{mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+M\+A\+L\+\_\+\+P\+A\+R\+A\+M\+E\+T\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T}$\ast$ mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$}]{port, }
\item[{uint32\+\_\+t}]{id, }
\item[{uint32\+\_\+t}]{size, }
\item[{{\bf M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T} $\ast$}]{status}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga63c0afe0ef5c20415d40681346cdd5c3}
Get a parameter from a port allocating the required amount of memory for the parameter (i.\+e. for variable length parameters like U\+R\+I or arrays). The size field will be set on output to the actual size of the parameter allocated and retrieved.

The pointer returned must be released by a call to \hyperlink{group___mmal_utilities_ga7e7dd0cc19e5c16dcd9cc9229c4d2708}{mmal\+\_\+port\+\_\+parameter\+\_\+free()}.


\begin{DoxyParams}{Parameters}
{\em port} & port to send request to \\
\hline
{\em id} & parameter id \\
\hline
{\em size} & initial size hint for allocation (can be 0) \\
\hline
{\em status} & status of the parameter get operation (can be 0) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to the header of the parameter or N\+U\+L\+L on failure. 
\end{DoxyReturn}
\hypertarget{group___mmal_utilities_ga7e7dd0cc19e5c16dcd9cc9229c4d2708}{}\index{Utility functions@{Utility functions}!mmal\+\_\+port\+\_\+parameter\+\_\+free@{mmal\+\_\+port\+\_\+parameter\+\_\+free}}
\index{mmal\+\_\+port\+\_\+parameter\+\_\+free@{mmal\+\_\+port\+\_\+parameter\+\_\+free}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+port\+\_\+parameter\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+port\+\_\+parameter\+\_\+free (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+A\+R\+A\+M\+E\+T\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$}]{param}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga7e7dd0cc19e5c16dcd9cc9229c4d2708}
Free a parameter structure previously allocated via \hyperlink{group___mmal_utilities_ga63c0afe0ef5c20415d40681346cdd5c3}{mmal\+\_\+port\+\_\+parameter\+\_\+alloc\+\_\+get()}.


\begin{DoxyParams}{Parameters}
{\em param} & pointer to header of the parameter \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_utilities_ga7228191288b87cfcd45d275bed55fa38}{}\index{Utility functions@{Utility functions}!mmal\+\_\+port\+\_\+pool\+\_\+create@{mmal\+\_\+port\+\_\+pool\+\_\+create}}
\index{mmal\+\_\+port\+\_\+pool\+\_\+create@{mmal\+\_\+port\+\_\+pool\+\_\+create}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+port\+\_\+pool\+\_\+create}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+M\+A\+L\+\_\+\+P\+O\+O\+L\+\_\+\+T}$\ast$ mmal\+\_\+port\+\_\+pool\+\_\+create (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$}]{port, }
\item[{unsigned int}]{headers, }
\item[{uint32\+\_\+t}]{payload\+\_\+size}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga7228191288b87cfcd45d275bed55fa38}
Create a pool of \hyperlink{struct_m_m_a_l___b_u_f_f_e_r___h_e_a_d_e_r___t}{M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} associated with a specific port. This allows a client to allocate memory for the payload buffers based on the preferences of a port. This for instance will allow the port to allocate memory which can be shared between the host processor and videocore. After allocation, all allocated buffer headers will have been added to the queue.

It is valid to create a pool with no buffer headers, or with zero size payload buffers. The \hyperlink{group___mmal_pool_gaafbd65fabba428d264574e84b567c660}{mmal\+\_\+pool\+\_\+resize()} function can be used to increase or decrease the number of buffer headers, or the size of the payload buffers, after creation of the pool.


\begin{DoxyParams}{Parameters}
{\em port} & Port responsible for creating the pool. \\
\hline
{\em headers} & Number of buffers which will be allocated with the pool. \\
\hline
{\em payload\+\_\+size} & Size of the payload buffer which will be allocated in each of the buffer headers. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Pointer to the newly created pool or N\+U\+L\+L on failure. 
\end{DoxyReturn}
\hypertarget{group___mmal_utilities_ga1809406ac2ea1d5c4cb5569487b22048}{}\index{Utility functions@{Utility functions}!mmal\+\_\+port\+\_\+pool\+\_\+destroy@{mmal\+\_\+port\+\_\+pool\+\_\+destroy}}
\index{mmal\+\_\+port\+\_\+pool\+\_\+destroy@{mmal\+\_\+port\+\_\+pool\+\_\+destroy}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+port\+\_\+pool\+\_\+destroy}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+port\+\_\+pool\+\_\+destroy (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T} $\ast$}]{port, }
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+O\+O\+L\+\_\+\+T} $\ast$}]{pool}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga1809406ac2ea1d5c4cb5569487b22048}
Destroy a pool of \hyperlink{struct_m_m_a_l___b_u_f_f_e_r___h_e_a_d_e_r___t}{M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} associated with a specific port. This will also deallocate all of the memory which was allocated when creating or resizing the pool.


\begin{DoxyParams}{Parameters}
{\em port} & Pointer to the port responsible for creating the pool. \\
\hline
{\em pool} & Pointer to the pool to be destroyed. \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_utilities_ga04f035c7f4403cf08cc8f8961b4dc7a3}{}\index{Utility functions@{Utility functions}!mmal\+\_\+port\+\_\+type\+\_\+to\+\_\+string@{mmal\+\_\+port\+\_\+type\+\_\+to\+\_\+string}}
\index{mmal\+\_\+port\+\_\+type\+\_\+to\+\_\+string@{mmal\+\_\+port\+\_\+type\+\_\+to\+\_\+string}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+port\+\_\+type\+\_\+to\+\_\+string}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ mmal\+\_\+port\+\_\+type\+\_\+to\+\_\+string (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T\+Y\+P\+E\+\_\+\+T}}]{type}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_ga04f035c7f4403cf08cc8f8961b4dc7a3}
Convert a port type to a string.


\begin{DoxyParams}{Parameters}
{\em type} & The M\+M\+A\+L port type. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A N\+U\+L\+L-\/terminated string describing the port type. 
\end{DoxyReturn}
\hypertarget{group___mmal_utilities_gaa7effcf538b48b6ac43133ad7d078044}{}\index{Utility functions@{Utility functions}!mmal\+\_\+status\+\_\+to\+\_\+string@{mmal\+\_\+status\+\_\+to\+\_\+string}}
\index{mmal\+\_\+status\+\_\+to\+\_\+string@{mmal\+\_\+status\+\_\+to\+\_\+string}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+status\+\_\+to\+\_\+string}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ mmal\+\_\+status\+\_\+to\+\_\+string (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+T}}]{status}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_gaa7effcf538b48b6ac43133ad7d078044}
Convert a status to a statically-\/allocated string.


\begin{DoxyParams}{Parameters}
{\em status} & The M\+M\+A\+L status code. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A C string describing the status code. 
\end{DoxyReturn}
\hypertarget{group___mmal_utilities_gaadf255e562d2cf04755e4fdd2963c32b}{}\index{Utility functions@{Utility functions}!mmal\+\_\+util\+\_\+get\+\_\+port@{mmal\+\_\+util\+\_\+get\+\_\+port}}
\index{mmal\+\_\+util\+\_\+get\+\_\+port@{mmal\+\_\+util\+\_\+get\+\_\+port}!Utility functions@{Utility functions}}
\subsubsection[{mmal\+\_\+util\+\_\+get\+\_\+port}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T}$\ast$ mmal\+\_\+util\+\_\+get\+\_\+port (
\begin{DoxyParamCaption}
\item[{{\bf M\+M\+A\+L\+\_\+\+C\+O\+M\+P\+O\+N\+E\+N\+T\+\_\+\+T} $\ast$}]{comp, }
\item[{{\bf M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+\+T\+Y\+P\+E\+\_\+\+T}}]{type, }
\item[{unsigned}]{index}
\end{DoxyParamCaption}
)}\label{group___mmal_utilities_gaadf255e562d2cf04755e4fdd2963c32b}
Return the nth port.


\begin{DoxyParams}{Parameters}
{\em comp} & component to query \\
\hline
{\em index} & port index \\
\hline
{\em type} & port type\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
port or N\+U\+L\+L if not found 
\end{DoxyReturn}
