\hypertarget{group___mmal_queue}{}\section{Queues of buffer headers}
\label{group___mmal_queue}\index{Queues of buffer headers@{Queues of buffer headers}}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
\hypertarget{group___mmal_queue_gaca84010261f2978ca77b608f67325bec}{}typedef struct M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T {\bfseries M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T}\label{group___mmal_queue_gaca84010261f2978ca77b608f67325bec}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$ \hyperlink{group___mmal_queue_gacafb60bc36fdb1de9b802335cb1488bc}{mmal\+\_\+queue\+\_\+create} (void)
\item 
void \hyperlink{group___mmal_queue_gaf31ecd6f4922699de7dad98e79e69a2b}{mmal\+\_\+queue\+\_\+put} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$queue, \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)
\item 
void \hyperlink{group___mmal_queue_ga31bdac01fd7173cc61663bf0b9b343b1}{mmal\+\_\+queue\+\_\+put\+\_\+back} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$queue, \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)
\item 
\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$ \hyperlink{group___mmal_queue_gae03a53a1cba809a9c42fefe1af835932}{mmal\+\_\+queue\+\_\+get} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$queue)
\item 
\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$ \hyperlink{group___mmal_queue_ga4742a4ea4b402a75559526794d8c0c07}{mmal\+\_\+queue\+\_\+wait} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$queue)
\item 
\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$ \hyperlink{group___mmal_queue_gabd56603e9eeac4203f431b204e2dce9c}{mmal\+\_\+queue\+\_\+timedwait} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$queue, V\+C\+O\+S\+\_\+\+U\+N\+S\+I\+G\+N\+E\+D timeout)
\item 
unsigned int \hyperlink{group___mmal_queue_ga710521f92c381a4ad9cfb620f0117456}{mmal\+\_\+queue\+\_\+length} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$queue)
\item 
void \hyperlink{group___mmal_queue_ga4caac58e82878025213b922cc6815863}{mmal\+\_\+queue\+\_\+destroy} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$queue)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
This provides a thread-\/safe implementation of a queue of buffer headers (\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}). The queue works in a first-\/in, first-\/out basis so the buffer headers will be dequeued in the order they have been queued. 

\subsection{Function Documentation}
\hypertarget{group___mmal_queue_gacafb60bc36fdb1de9b802335cb1488bc}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+create@{mmal\+\_\+queue\+\_\+create}}
\index{mmal\+\_\+queue\+\_\+create@{mmal\+\_\+queue\+\_\+create}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+create}]{\setlength{\rightskip}{0pt plus 5cm}M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T$\ast$ mmal\+\_\+queue\+\_\+create (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_gacafb60bc36fdb1de9b802335cb1488bc}
Create a queue 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}

\begin{DoxyReturn}{Returns}
Pointer to the newly created queue or N\+U\+L\+L on failure. 
\end{DoxyReturn}
\hypertarget{group___mmal_queue_ga4caac58e82878025213b922cc6815863}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+destroy@{mmal\+\_\+queue\+\_\+destroy}}
\index{mmal\+\_\+queue\+\_\+destroy@{mmal\+\_\+queue\+\_\+destroy}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+destroy}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+queue\+\_\+destroy (
\begin{DoxyParamCaption}
\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$}]{queue}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_ga4caac58e82878025213b922cc6815863}
Destroy a queue 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}.


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_queue_gae03a53a1cba809a9c42fefe1af835932}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+get@{mmal\+\_\+queue\+\_\+get}}
\index{mmal\+\_\+queue\+\_\+get@{mmal\+\_\+queue\+\_\+get}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+get}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T}$\ast$ mmal\+\_\+queue\+\_\+get (
\begin{DoxyParamCaption}
\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$}]{queue}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_gae03a53a1cba809a9c42fefe1af835932}
Get a \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} from a queue


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to the next \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} or N\+U\+L\+L if the queue is empty. 
\end{DoxyReturn}
\hypertarget{group___mmal_queue_ga710521f92c381a4ad9cfb620f0117456}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+length@{mmal\+\_\+queue\+\_\+length}}
\index{mmal\+\_\+queue\+\_\+length@{mmal\+\_\+queue\+\_\+length}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+length}]{\setlength{\rightskip}{0pt plus 5cm}unsigned int mmal\+\_\+queue\+\_\+length (
\begin{DoxyParamCaption}
\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$}]{queue}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_ga710521f92c381a4ad9cfb620f0117456}
Get the number 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} currently in a queue.


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
length (in elements) of the queue. 
\end{DoxyReturn}
\hypertarget{group___mmal_queue_gaf31ecd6f4922699de7dad98e79e69a2b}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+put@{mmal\+\_\+queue\+\_\+put}}
\index{mmal\+\_\+queue\+\_\+put@{mmal\+\_\+queue\+\_\+put}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+put}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+queue\+\_\+put (
\begin{DoxyParamCaption}
\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$}]{queue, }
\item[{{\bf M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$}]{buffer}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_gaf31ecd6f4922699de7dad98e79e69a2b}
Put a \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} into a queue


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue \\
\hline
{\em buffer} & Pointer to the \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} to add to the queue \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_queue_ga31bdac01fd7173cc61663bf0b9b343b1}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+put\+\_\+back@{mmal\+\_\+queue\+\_\+put\+\_\+back}}
\index{mmal\+\_\+queue\+\_\+put\+\_\+back@{mmal\+\_\+queue\+\_\+put\+\_\+back}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+put\+\_\+back}]{\setlength{\rightskip}{0pt plus 5cm}void mmal\+\_\+queue\+\_\+put\+\_\+back (
\begin{DoxyParamCaption}
\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$}]{queue, }
\item[{{\bf M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T} $\ast$}]{buffer}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_ga31bdac01fd7173cc61663bf0b9b343b1}
Put a \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} back at the start of a queue. This is used when a buffer header was removed from the queue but not fully processed and needs to be put back where it was originally taken.


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue \\
\hline
{\em buffer} & Pointer to the \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} to add to the queue \\
\hline
\end{DoxyParams}
\hypertarget{group___mmal_queue_gabd56603e9eeac4203f431b204e2dce9c}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+timedwait@{mmal\+\_\+queue\+\_\+timedwait}}
\index{mmal\+\_\+queue\+\_\+timedwait@{mmal\+\_\+queue\+\_\+timedwait}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+timedwait}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T}$\ast$ mmal\+\_\+queue\+\_\+timedwait (
\begin{DoxyParamCaption}
\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$}]{queue, }
\item[{V\+C\+O\+S\+\_\+\+U\+N\+S\+I\+G\+N\+E\+D}]{timeout}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_gabd56603e9eeac4203f431b204e2dce9c}
Wait for a \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} from a queue, up to a given timeout. This is the same as a wait, except that it will abort in case of timeout.


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue \\
\hline
{\em timeout} & Number of milliseconds to wait before returning if the semaphore can\textquotesingle{}t be acquired.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to the next \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}. 
\end{DoxyReturn}
\hypertarget{group___mmal_queue_ga4742a4ea4b402a75559526794d8c0c07}{}\index{Queues of buffer headers@{Queues of buffer headers}!mmal\+\_\+queue\+\_\+wait@{mmal\+\_\+queue\+\_\+wait}}
\index{mmal\+\_\+queue\+\_\+wait@{mmal\+\_\+queue\+\_\+wait}!Queues of buffer headers@{Queues of buffer headers}}
\subsubsection[{mmal\+\_\+queue\+\_\+wait}]{\setlength{\rightskip}{0pt plus 5cm}{\bf M\+M\+A\+L\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+H\+E\+A\+D\+E\+R\+\_\+\+T}$\ast$ mmal\+\_\+queue\+\_\+wait (
\begin{DoxyParamCaption}
\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+\+T $\ast$}]{queue}
\end{DoxyParamCaption}
)}\label{group___mmal_queue_ga4742a4ea4b402a75559526794d8c0c07}
Wait for a \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} from a queue. This is the same as a get except that this will block until a buffer header is available.


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to the next \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}. 
\end{DoxyReturn}
