\hypertarget{group___mmal_connection_utility}{}\section{Port connection utility}
\label{group___mmal_connection_utility}\index{Port connection utility@{Port connection utility}}
\subsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}}
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} \mbox{\hyperlink{group___mmal_connection_utility_ga6d3c90e62701f22a723b4c01c43fb2b8}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}}
\item 
typedef void($\ast$ \mbox{\hyperlink{group___mmal_connection_utility_gad01e44cb6c4250744cddeb52493da379}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+T}}) (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection)
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} \mbox{\hyperlink{group___mmal_connection_utility_ga5d84ac4327841ca2c19f223e6314f06b}{mmal\+\_\+connection\+\_\+create}} (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$$\ast$connection, \mbox{\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+T}} $\ast$out, \mbox{\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+T}} $\ast$in, uint32\+\_\+t flags)
\item 
void \mbox{\hyperlink{group___mmal_connection_utility_ga0cd42bb447233fed7ad46db87dc50e13}{mmal\+\_\+connection\+\_\+acquire}} (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection)
\item 
\mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} \mbox{\hyperlink{group___mmal_connection_utility_gaa5f301d2089944d340f2723fbdd67291}{mmal\+\_\+connection\+\_\+release}} (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection)
\item 
\mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} \mbox{\hyperlink{group___mmal_connection_utility_ga0b872de7d96b262486ee4e5c72971513}{mmal\+\_\+connection\+\_\+destroy}} (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection)
\item 
\mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} \mbox{\hyperlink{group___mmal_connection_utility_ga89a16249fc99b996ee95515728183a12}{mmal\+\_\+connection\+\_\+enable}} (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection)
\item 
\mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} \mbox{\hyperlink{group___mmal_connection_utility_ga0adcf80011e99d4b2b97a45cac7a1a19}{mmal\+\_\+connection\+\_\+disable}} (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection)
\item 
\mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} \mbox{\hyperlink{group___mmal_connection_utility_ga21c63aa5f109a93e405d5704f80372c0}{mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed}} (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection, \mbox{\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$buffer)
\end{DoxyCompactItemize}
\subsection*{Connection flags}
\label{_amgrp96f2711da0ec391100bb823c9e93af22}%
\label{group___mmal_connection_utility_connectionflags}%
\Hypertarget{group___mmal_connection_utility_connectionflags}%
The following flags describe the properties of the connection. \begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{group___mmal_connection_utility_gae4b2f9bfaef3df4f4b070158e26b9385}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG}}~0x1
\item 
\#define \mbox{\hyperlink{group___mmal_connection_utility_ga1ec21f813040f7d206ab1d615bfa4db6}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+I\+N\+P\+UT}}~0x2
\item 
\#define \mbox{\hyperlink{group___mmal_connection_utility_gae1c546dc960ad3273664b96daeb1ac60}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+O\+U\+T\+P\+UT}}~0x4
\item 
\#define \mbox{\hyperlink{group___mmal_connection_utility_ga14262c3055cbe87dc17d77cba322224f}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+Q\+U\+I\+R\+E\+M\+E\+N\+TS}}~0x8
\item 
\#define \mbox{\hyperlink{group___mmal_connection_utility_gac120f97349b2d7a09d1a7e96e0dd86fb}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+D\+I\+R\+E\+CT}}~0x10
\item 
\#define \mbox{\hyperlink{group___mmal_connection_utility_gade7a339c02659a85492fd74abbe92c54}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+P\+O\+R\+T\+\_\+\+F\+O\+R\+M\+A\+TS}}~0x20
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The port connection utility functions can be used in place of common sequences of calls to the M\+M\+AL A\+PI in order to process buffers being passed between two ports.\hypertarget{group___mmal_connection_utility_ProcessingConnectionBufferHeaders}{}\subsection{Processing connection buffer headers}\label{group___mmal_connection_utility_ProcessingConnectionBufferHeaders}
Either in response to the client callback function being called, or simply on a timer, the client will need to process the buffer headers of the connection (unless tunneling is used).

Buffer headers that are in the pool queue will need to be sent to the output port, while buffer headers in the connection queue are sent to the input port. The buffer headers in the connection queue may contain pixel data (the cmd field is zero) or an event (the cmd field is non-\/zero). In general, pixel data buffer headers need to be passed on, while event buffer headers are released. In the case of the format changed event, \mbox{\hyperlink{group___mmal_connection_utility_ga21c63aa5f109a93e405d5704f80372c0}{mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed()}} can be called before the event is released.

Other, specialized use cases may also be implemented, such as getting and immediately releasing buffer headers from the connection queue in order to prevent their propagation. This could be used to drop out video, for example.\hypertarget{group___mmal_connection_utility_TunnellingConnections}{}\subsection{Tunnelling connections}\label{group___mmal_connection_utility_TunnellingConnections}
If the \mbox{\hyperlink{group___mmal_connection_utility_gae4b2f9bfaef3df4f4b070158e26b9385}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG}} flag is set when the connection is created, M\+M\+AL tunneling will be used. This automates the passing of the buffer headers between the output port and input port, and back again. It will also do this as efficiently as possible, avoiding trips between the A\+RM and the Video\+Core if both components are implemented on the Video\+Core. The consequence of this is that there is no client callback made as buffer headers get transferred.

The client can still monitor the control port of a component (usually a sink component, such as video\+\_\+render) for the end of stream, in order to know when to dismantle the connection.\hypertarget{group___mmal_connection_utility_ConnectionClientCallback}{}\subsection{Client callback}\label{group___mmal_connection_utility_ConnectionClientCallback}
When not using tunnelling, the client callback function is called each time a buffer arrives from a port (either input or output).

\begin{DoxyNote}{Note}
The callback is made on a different thread from the one used by the client to set up the connection, so care must be taken with thread safety. One option is to raise a signal to the main client thread that queue processing needs to be done, another is for the callback to perform the queue processing itself.
\end{DoxyNote}
The client can also store an opaque pointer in the connection object, which is never used by the M\+M\+AL code and is only meaningful to the client. 

\subsection{Macro Definition Documentation}
\mbox{\Hypertarget{group___mmal_connection_utility_ga1ec21f813040f7d206ab1d615bfa4db6}\label{group___mmal_connection_utility_ga1ec21f813040f7d206ab1d615bfa4db6}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+I\+N\+P\+UT@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+I\+N\+P\+UT}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+I\+N\+P\+UT@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+I\+N\+P\+UT}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+I\+N\+P\+UT}{MMAL\_CONNECTION\_FLAG\_ALLOCATION\_ON\_INPUT}}
{\footnotesize\ttfamily \#define M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+I\+N\+P\+UT~0x2}

Force the pool of buffer headers used by the connection to be allocated on the input port. \mbox{\Hypertarget{group___mmal_connection_utility_gae1c546dc960ad3273664b96daeb1ac60}\label{group___mmal_connection_utility_gae1c546dc960ad3273664b96daeb1ac60}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+O\+U\+T\+P\+UT@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+O\+U\+T\+P\+UT}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+O\+U\+T\+P\+UT@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+O\+U\+T\+P\+UT}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+O\+U\+T\+P\+UT}{MMAL\_CONNECTION\_FLAG\_ALLOCATION\_ON\_OUTPUT}}
{\footnotesize\ttfamily \#define M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+A\+L\+L\+O\+C\+A\+T\+I\+O\+N\+\_\+\+O\+N\+\_\+\+O\+U\+T\+P\+UT~0x4}

Force the pool of buffer headers used by the connection to be allocated on the output port. \mbox{\Hypertarget{group___mmal_connection_utility_gac120f97349b2d7a09d1a7e96e0dd86fb}\label{group___mmal_connection_utility_gac120f97349b2d7a09d1a7e96e0dd86fb}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+D\+I\+R\+E\+CT@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+D\+I\+R\+E\+CT}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+D\+I\+R\+E\+CT@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+D\+I\+R\+E\+CT}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+D\+I\+R\+E\+CT}{MMAL\_CONNECTION\_FLAG\_DIRECT}}
{\footnotesize\ttfamily \#define M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+D\+I\+R\+E\+CT~0x10}

The connection is flagged as direct. This doesn\textquotesingle{}t change the behaviour of the connection itself but is used by the the graph utility to specify that the buffer should be sent to the input port from with the port callback. \mbox{\Hypertarget{group___mmal_connection_utility_ga14262c3055cbe87dc17d77cba322224f}\label{group___mmal_connection_utility_ga14262c3055cbe87dc17d77cba322224f}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+Q\+U\+I\+R\+E\+M\+E\+N\+TS@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+Q\+U\+I\+R\+E\+M\+E\+N\+TS}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+Q\+U\+I\+R\+E\+M\+E\+N\+TS@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+Q\+U\+I\+R\+E\+M\+E\+N\+TS}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+Q\+U\+I\+R\+E\+M\+E\+N\+TS}{MMAL\_CONNECTION\_FLAG\_KEEP\_BUFFER\_REQUIREMENTS}}
{\footnotesize\ttfamily \#define M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+R\+E\+Q\+U\+I\+R\+E\+M\+E\+N\+TS~0x8}

Specify that the connection should not modify the buffer requirements. \mbox{\Hypertarget{group___mmal_connection_utility_gade7a339c02659a85492fd74abbe92c54}\label{group___mmal_connection_utility_gade7a339c02659a85492fd74abbe92c54}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+P\+O\+R\+T\+\_\+\+F\+O\+R\+M\+A\+TS@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+P\+O\+R\+T\+\_\+\+F\+O\+R\+M\+A\+TS}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+P\+O\+R\+T\+\_\+\+F\+O\+R\+M\+A\+TS@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+P\+O\+R\+T\+\_\+\+F\+O\+R\+M\+A\+TS}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+P\+O\+R\+T\+\_\+\+F\+O\+R\+M\+A\+TS}{MMAL\_CONNECTION\_FLAG\_KEEP\_PORT\_FORMATS}}
{\footnotesize\ttfamily \#define M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+K\+E\+E\+P\+\_\+\+P\+O\+R\+T\+\_\+\+F\+O\+R\+M\+A\+TS~0x20}

Specify that the connection should not modify the port formats. \mbox{\Hypertarget{group___mmal_connection_utility_gae4b2f9bfaef3df4f4b070158e26b9385}\label{group___mmal_connection_utility_gae4b2f9bfaef3df4f4b070158e26b9385}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG}{MMAL\_CONNECTION\_FLAG\_TUNNELLING}}
{\footnotesize\ttfamily \#define M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG~0x1}

The connection is tunnelled. Buffer headers do not transit via the client but directly from the output port to the input port. 

\subsection{Typedef Documentation}
\mbox{\Hypertarget{group___mmal_connection_utility_gad01e44cb6c4250744cddeb52493da379}\label{group___mmal_connection_utility_gad01e44cb6c4250744cddeb52493da379}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+T@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+T}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+T@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+T}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+T}{MMAL\_CONNECTION\_CALLBACK\_T}}
{\footnotesize\ttfamily typedef void($\ast$ M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+C\+A\+L\+L\+B\+A\+C\+K\+\_\+T) (\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$connection)}

Definition of the callback used by a connection to signal back to the client that a buffer header is available either in the pool or in the output queue.


\begin{DoxyParams}{Parameters}
{\em connection} & Pointer to the connection \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group___mmal_connection_utility_ga6d3c90e62701f22a723b4c01c43fb2b8}\label{group___mmal_connection_utility_ga6d3c90e62701f22a723b4c01c43fb2b8}} 
\index{Port connection utility@{Port connection utility}!M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}}
\index{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T@{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}{MMAL\_CONNECTION\_T}}
{\footnotesize\ttfamily typedef struct \mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} \mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}}}

Forward type definition for a connection 

\subsection{Function Documentation}
\mbox{\Hypertarget{group___mmal_connection_utility_ga0cd42bb447233fed7ad46db87dc50e13}\label{group___mmal_connection_utility_ga0cd42bb447233fed7ad46db87dc50e13}} 
\index{Port connection utility@{Port connection utility}!mmal\+\_\+connection\+\_\+acquire@{mmal\+\_\+connection\+\_\+acquire}}
\index{mmal\+\_\+connection\+\_\+acquire@{mmal\+\_\+connection\+\_\+acquire}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{mmal\+\_\+connection\+\_\+acquire()}{mmal\_connection\_acquire()}}
{\footnotesize\ttfamily void mmal\+\_\+connection\+\_\+acquire (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$}]{connection }\end{DoxyParamCaption})}

Acquire a reference on a connection. Acquiring a reference on a connection will prevent a connection from being destroyed until the acquired reference is released (by a call to \mbox{\hyperlink{group___mmal_connection_utility_ga0b872de7d96b262486ee4e5c72971513}{mmal\+\_\+connection\+\_\+destroy}}). References are internally counted so all acquired references need a matching call to release them.


\begin{DoxyParams}{Parameters}
{\em connection} & connection to acquire \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group___mmal_connection_utility_ga5d84ac4327841ca2c19f223e6314f06b}\label{group___mmal_connection_utility_ga5d84ac4327841ca2c19f223e6314f06b}} 
\index{Port connection utility@{Port connection utility}!mmal\+\_\+connection\+\_\+create@{mmal\+\_\+connection\+\_\+create}}
\index{mmal\+\_\+connection\+\_\+create@{mmal\+\_\+connection\+\_\+create}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{mmal\+\_\+connection\+\_\+create()}{mmal\_connection\_create()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} mmal\+\_\+connection\+\_\+create (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$$\ast$}]{connection,  }\item[{\mbox{\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+T}} $\ast$}]{out,  }\item[{\mbox{\hyperlink{struct_m_m_a_l___p_o_r_t___t}{M\+M\+A\+L\+\_\+\+P\+O\+R\+T\+\_\+T}} $\ast$}]{in,  }\item[{uint32\+\_\+t}]{flags }\end{DoxyParamCaption})}

Create a connection between two ports. The connection shall include a pool of buffer headers suitable for the current format of the output port. The format of the input port shall have been set to the same as that of the input port. Note that connections are reference counted and creating a connection automatically acquires a reference to it (released when \mbox{\hyperlink{group___mmal_connection_utility_ga0b872de7d96b262486ee4e5c72971513}{mmal\+\_\+connection\+\_\+destroy}} is called).


\begin{DoxyParams}{Parameters}
{\em connection} & The address of a connection pointer that will be set to point to the created connection. \\
\hline
{\em out} & The output port to use for the connection. \\
\hline
{\em in} & The input port to use for the connection. \\
\hline
{\em flags} & The flags specifying which type of connection should be created. A bitwise combination of \mbox{\hyperlink{group___mmal_connection_utility_connectionflags}{Connection flags}} values. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
M\+M\+A\+L\+\_\+\+S\+U\+C\+C\+E\+SS on success. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_connection_utility_ga0b872de7d96b262486ee4e5c72971513}\label{group___mmal_connection_utility_ga0b872de7d96b262486ee4e5c72971513}} 
\index{Port connection utility@{Port connection utility}!mmal\+\_\+connection\+\_\+destroy@{mmal\+\_\+connection\+\_\+destroy}}
\index{mmal\+\_\+connection\+\_\+destroy@{mmal\+\_\+connection\+\_\+destroy}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{mmal\+\_\+connection\+\_\+destroy()}{mmal\_connection\_destroy()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} mmal\+\_\+connection\+\_\+destroy (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$}]{connection }\end{DoxyParamCaption})}

Destroy a connection. Release an acquired reference on a connection. Only actually destroys the connection when the last reference is being released. The actual destruction of the connection will start by disabling it, if necessary. Any pool, queue, and so on owned by the connection shall then be destroyed.


\begin{DoxyParams}{Parameters}
{\em connection} & The connection to be destroyed. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
M\+M\+A\+L\+\_\+\+S\+U\+C\+C\+E\+SS on success. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_connection_utility_ga0adcf80011e99d4b2b97a45cac7a1a19}\label{group___mmal_connection_utility_ga0adcf80011e99d4b2b97a45cac7a1a19}} 
\index{Port connection utility@{Port connection utility}!mmal\+\_\+connection\+\_\+disable@{mmal\+\_\+connection\+\_\+disable}}
\index{mmal\+\_\+connection\+\_\+disable@{mmal\+\_\+connection\+\_\+disable}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{mmal\+\_\+connection\+\_\+disable()}{mmal\_connection\_disable()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} mmal\+\_\+connection\+\_\+disable (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$}]{connection }\end{DoxyParamCaption})}

Disable a connection.


\begin{DoxyParams}{Parameters}
{\em connection} & The connection to be disabled. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
M\+M\+A\+L\+\_\+\+S\+U\+C\+C\+E\+SS on success. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_connection_utility_ga89a16249fc99b996ee95515728183a12}\label{group___mmal_connection_utility_ga89a16249fc99b996ee95515728183a12}} 
\index{Port connection utility@{Port connection utility}!mmal\+\_\+connection\+\_\+enable@{mmal\+\_\+connection\+\_\+enable}}
\index{mmal\+\_\+connection\+\_\+enable@{mmal\+\_\+connection\+\_\+enable}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{mmal\+\_\+connection\+\_\+enable()}{mmal\_connection\_enable()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} mmal\+\_\+connection\+\_\+enable (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$}]{connection }\end{DoxyParamCaption})}

Enable a connection. The format of the two ports must have been committed before calling this function, although note that on creation, the connection automatically copies and commits the output port\textquotesingle{}s format to the input port.

The \mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t_ab52a9970f4c50317b86fa726b77c7a4c}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+::callback}} field must have been set if the \mbox{\hyperlink{group___mmal_connection_utility_gae4b2f9bfaef3df4f4b070158e26b9385}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+F\+L\+A\+G\+\_\+\+T\+U\+N\+N\+E\+L\+L\+I\+NG}} flag was not specified on creation. The client may also set the \mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t_a8233b30bbd265ba14aa20bb646eb35c7}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+\+T\+::user\+\_\+data}} in order to get a pointer passed, via the connection, to the callback.


\begin{DoxyParams}{Parameters}
{\em connection} & The connection to be enabled. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
M\+M\+A\+L\+\_\+\+S\+U\+C\+C\+E\+SS on success. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_connection_utility_ga21c63aa5f109a93e405d5704f80372c0}\label{group___mmal_connection_utility_ga21c63aa5f109a93e405d5704f80372c0}} 
\index{Port connection utility@{Port connection utility}!mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed@{mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed}}
\index{mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed@{mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed()}{mmal\_connection\_event\_format\_changed()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} mmal\+\_\+connection\+\_\+event\+\_\+format\+\_\+changed (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$}]{connection,  }\item[{\mbox{\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$}]{buffer }\end{DoxyParamCaption})}

Apply a format changed event to the connection. This function can be used when the client is processing buffer headers and receives a format changed event (\mbox{\hyperlink{group___mmal_events_gaba308c5d4493c39de0ddfaafdb2e7118}{M\+M\+A\+L\+\_\+\+E\+V\+E\+N\+T\+\_\+\+F\+O\+R\+M\+A\+T\+\_\+\+C\+H\+A\+N\+G\+ED}}). The connection is reconfigured, changing the format of the ports, the number of buffer headers and the size of the payload buffers as necessary.


\begin{DoxyParams}{Parameters}
{\em connection} & The connection to which the event shall be applied. \\
\hline
{\em buffer} & The buffer containing a format changed event. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
M\+M\+A\+L\+\_\+\+S\+U\+C\+C\+E\+SS on success. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_connection_utility_gaa5f301d2089944d340f2723fbdd67291}\label{group___mmal_connection_utility_gaa5f301d2089944d340f2723fbdd67291}} 
\index{Port connection utility@{Port connection utility}!mmal\+\_\+connection\+\_\+release@{mmal\+\_\+connection\+\_\+release}}
\index{mmal\+\_\+connection\+\_\+release@{mmal\+\_\+connection\+\_\+release}!Port connection utility@{Port connection utility}}
\subsubsection{\texorpdfstring{mmal\+\_\+connection\+\_\+release()}{mmal\_connection\_release()}}
{\footnotesize\ttfamily \mbox{\hyperlink{group___mmal_types_ga5ac87230bd615d2b154a9d5899bc37fd}{M\+M\+A\+L\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+T}} mmal\+\_\+connection\+\_\+release (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{struct_m_m_a_l___c_o_n_n_e_c_t_i_o_n___t}{M\+M\+A\+L\+\_\+\+C\+O\+N\+N\+E\+C\+T\+I\+O\+N\+\_\+T}} $\ast$}]{connection }\end{DoxyParamCaption})}

Release a reference on a connection Release an acquired reference on a connection. Triggers the destruction of the connection when the last reference is being released. \begin{DoxyNote}{Note}
This is in fact an alias of \mbox{\hyperlink{group___mmal_connection_utility_ga0b872de7d96b262486ee4e5c72971513}{mmal\+\_\+connection\+\_\+destroy}} which is added to make client code clearer.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em connection} & connection to release \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
M\+M\+A\+L\+\_\+\+S\+U\+C\+C\+E\+SS on success 
\end{DoxyReturn}
