\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 
\mbox{\Hypertarget{group___mmal_queue_gaca84010261f2978ca77b608f67325bec}\label{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}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$ \mbox{\hyperlink{group___mmal_queue_gacafb60bc36fdb1de9b802335cb1488bc}{mmal\+\_\+queue\+\_\+create}} (void)
\item 
void \mbox{\hyperlink{group___mmal_queue_gaf31ecd6f4922699de7dad98e79e69a2b}{mmal\+\_\+queue\+\_\+put}} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$queue, \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)
\item 
void \mbox{\hyperlink{group___mmal_queue_ga31bdac01fd7173cc61663bf0b9b343b1}{mmal\+\_\+queue\+\_\+put\+\_\+back}} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$queue, \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)
\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$ \mbox{\hyperlink{group___mmal_queue_gae03a53a1cba809a9c42fefe1af835932}{mmal\+\_\+queue\+\_\+get}} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$queue)
\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$ \mbox{\hyperlink{group___mmal_queue_ga4742a4ea4b402a75559526794d8c0c07}{mmal\+\_\+queue\+\_\+wait}} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$queue)
\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$ \mbox{\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\+ED timeout)
\item 
unsigned int \mbox{\hyperlink{group___mmal_queue_ga710521f92c381a4ad9cfb620f0117456}{mmal\+\_\+queue\+\_\+length}} (M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$queue)
\item 
void \mbox{\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 (\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}}). 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}
\mbox{\Hypertarget{group___mmal_queue_gacafb60bc36fdb1de9b802335cb1488bc}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+create()}{mmal\_queue\_create()}}
{\footnotesize\ttfamily M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T$\ast$ mmal\+\_\+queue\+\_\+create (\begin{DoxyParamCaption}\item[{void}]{ }\end{DoxyParamCaption})}

Create a queue of \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}}

\begin{DoxyReturn}{Returns}
Pointer to the newly created queue or N\+U\+LL on failure. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_queue_ga4caac58e82878025213b922cc6815863}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+destroy()}{mmal\_queue\_destroy()}}
{\footnotesize\ttfamily void mmal\+\_\+queue\+\_\+destroy (\begin{DoxyParamCaption}\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$}]{queue }\end{DoxyParamCaption})}

Destroy a queue of \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}}.


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group___mmal_queue_gae03a53a1cba809a9c42fefe1af835932}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+get()}{mmal\_queue\_get()}}
{\footnotesize\ttfamily \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$ mmal\+\_\+queue\+\_\+get (\begin{DoxyParamCaption}\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$}]{queue }\end{DoxyParamCaption})}

Get a \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}} from a queue


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to the next \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}} or N\+U\+LL if the queue is empty. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_queue_ga710521f92c381a4ad9cfb620f0117456}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+length()}{mmal\_queue\_length()}}
{\footnotesize\ttfamily unsigned int mmal\+\_\+queue\+\_\+length (\begin{DoxyParamCaption}\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$}]{queue }\end{DoxyParamCaption})}

Get the number of \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}} 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}
\mbox{\Hypertarget{group___mmal_queue_gaf31ecd6f4922699de7dad98e79e69a2b}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+put()}{mmal\_queue\_put()}}
{\footnotesize\ttfamily void mmal\+\_\+queue\+\_\+put (\begin{DoxyParamCaption}\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$}]{queue,  }\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})}

Put a \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}} into a queue


\begin{DoxyParams}{Parameters}
{\em queue} & Pointer to a queue \\
\hline
{\em buffer} & Pointer to the \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}} to add to the queue \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group___mmal_queue_ga31bdac01fd7173cc61663bf0b9b343b1}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+put\+\_\+back()}{mmal\_queue\_put\_back()}}
{\footnotesize\ttfamily void mmal\+\_\+queue\+\_\+put\+\_\+back (\begin{DoxyParamCaption}\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$}]{queue,  }\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})}

Put a \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}} 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 \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}} to add to the queue \\
\hline
\end{DoxyParams}
\mbox{\Hypertarget{group___mmal_queue_gabd56603e9eeac4203f431b204e2dce9c}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+timedwait()}{mmal\_queue\_timedwait()}}
{\footnotesize\ttfamily \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$ 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\+ED}]{timeout }\end{DoxyParamCaption})}

Wait for a \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}} 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 \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}}. 
\end{DoxyReturn}
\mbox{\Hypertarget{group___mmal_queue_ga4742a4ea4b402a75559526794d8c0c07}\label{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{\texorpdfstring{mmal\+\_\+queue\+\_\+wait()}{mmal\_queue\_wait()}}
{\footnotesize\ttfamily \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$ mmal\+\_\+queue\+\_\+wait (\begin{DoxyParamCaption}\item[{M\+M\+A\+L\+\_\+\+Q\+U\+E\+U\+E\+\_\+T $\ast$}]{queue }\end{DoxyParamCaption})}

Wait for a \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}} 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 \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}}. 
\end{DoxyReturn}
