\hypertarget{gwavi_8h}{}\doxysection{inc/gwavi.h File Reference}
\label{gwavi_8h}\index{inc/gwavi.h@{inc/gwavi.h}}
{\ttfamily \#include $<$stddef.\+h$>$}\newline
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
struct gwavi\+\_\+t $\ast$ \mbox{\hyperlink{gwavi_8h_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open}} (const char $\ast$filename, unsigned int width, unsigned int height, const char $\ast$fourcc, unsigned int fps, struct gwavi\+\_\+audio\+\_\+t $\ast$audio)
\begin{DoxyCompactList}\small\item\em This is the first function you should call when using gwavi library. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{gwavi_8h_a2da2ded4d05d1b188ca933c9e0f45436}{gwavi\+\_\+add\+\_\+frame}} (struct gwavi\+\_\+t $\ast$gwavi, unsigned char $\ast$buffer, size\+\_\+t len)
\begin{DoxyCompactList}\small\item\em This function allows you to add an encoded video frame to the A\+VI file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{gwavi_8h_a69d79a1c63064fbd315cf4363d4d5ab9}{gwavi\+\_\+add\+\_\+audio}} (struct gwavi\+\_\+t $\ast$gwavi, unsigned char $\ast$buffer, size\+\_\+t len)
\begin{DoxyCompactList}\small\item\em This function allows you to add the audio track to your A\+VI file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{gwavi_8h_a86a0a631350a3dc8d9768f43accfbbf3}{gwavi\+\_\+close}} (struct gwavi\+\_\+t $\ast$gwavi)
\begin{DoxyCompactList}\small\item\em This function should be called when the program is done adding video and/or audio frames to the A\+VI file. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{gwavi_8h_ad0288ca3ca578aae593d1d199302d05d}{gwavi\+\_\+set\+\_\+framerate}} (struct gwavi\+\_\+t $\ast$gwavi, unsigned int fps)
\begin{DoxyCompactList}\small\item\em This function allows you to reset the framerate. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{gwavi_8h_a74274aa8941b63b47c844299415c45c7}{gwavi\+\_\+set\+\_\+codec}} (struct gwavi\+\_\+t $\ast$gwavi, const char $\ast$fourcc)
\begin{DoxyCompactList}\small\item\em This function allows you to reset the video codec. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{gwavi_8h_a7791e9cd35e04e8da0e73d656813257b}{gwavi\+\_\+set\+\_\+size}} (struct gwavi\+\_\+t $\ast$gwavi, unsigned int width, unsigned int height)
\begin{DoxyCompactList}\small\item\em This function allows you to reset the video size. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{gwavi_8h_a69d79a1c63064fbd315cf4363d4d5ab9}\label{gwavi_8h_a69d79a1c63064fbd315cf4363d4d5ab9}} 
\index{gwavi.h@{gwavi.h}!gwavi\_add\_audio@{gwavi\_add\_audio}}
\index{gwavi\_add\_audio@{gwavi\_add\_audio}!gwavi.h@{gwavi.h}}
\doxysubsubsection{\texorpdfstring{gwavi\_add\_audio()}{gwavi\_add\_audio()}}
{\footnotesize\ttfamily int gwavi\+\_\+add\+\_\+audio (\begin{DoxyParamCaption}\item[{struct gwavi\+\_\+t $\ast$}]{gwavi,  }\item[{unsigned char $\ast$}]{buffer,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}



This function allows you to add the audio track to your A\+VI file. 


\begin{DoxyParams}{Parameters}
{\em gwavi} & Main gwavi structure initialized with \mbox{\hyperlink{gwavi_8c_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open()}}-\/ \\
\hline
{\em buffer} & Audio buffer size. \\
\hline
{\em len} & Audio buffer length.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on error. 
\end{DoxyReturn}
\mbox{\Hypertarget{gwavi_8h_a2da2ded4d05d1b188ca933c9e0f45436}\label{gwavi_8h_a2da2ded4d05d1b188ca933c9e0f45436}} 
\index{gwavi.h@{gwavi.h}!gwavi\_add\_frame@{gwavi\_add\_frame}}
\index{gwavi\_add\_frame@{gwavi\_add\_frame}!gwavi.h@{gwavi.h}}
\doxysubsubsection{\texorpdfstring{gwavi\_add\_frame()}{gwavi\_add\_frame()}}
{\footnotesize\ttfamily int gwavi\+\_\+add\+\_\+frame (\begin{DoxyParamCaption}\item[{struct gwavi\+\_\+t $\ast$}]{gwavi,  }\item[{unsigned char $\ast$}]{buffer,  }\item[{size\+\_\+t}]{len }\end{DoxyParamCaption})}



This function allows you to add an encoded video frame to the A\+VI file. 


\begin{DoxyParams}{Parameters}
{\em gwavi} & Main gwavi structure initialized with \mbox{\hyperlink{gwavi_8c_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open()}}-\/ \\
\hline
{\em buffer} & Video buffer size. \\
\hline
{\em len} & Video buffer length.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on error. 
\end{DoxyReturn}
\mbox{\Hypertarget{gwavi_8h_a86a0a631350a3dc8d9768f43accfbbf3}\label{gwavi_8h_a86a0a631350a3dc8d9768f43accfbbf3}} 
\index{gwavi.h@{gwavi.h}!gwavi\_close@{gwavi\_close}}
\index{gwavi\_close@{gwavi\_close}!gwavi.h@{gwavi.h}}
\doxysubsubsection{\texorpdfstring{gwavi\_close()}{gwavi\_close()}}
{\footnotesize\ttfamily int gwavi\+\_\+close (\begin{DoxyParamCaption}\item[{struct gwavi\+\_\+t $\ast$}]{gwavi }\end{DoxyParamCaption})}



This function should be called when the program is done adding video and/or audio frames to the A\+VI file. 

It frees memory allocated for \mbox{\hyperlink{gwavi_8c_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open()}} for the main gwavi\+\_\+t structure. It also properly closes the output file.


\begin{DoxyParams}{Parameters}
{\em gwavi} & Main gwavi structure initialized with \mbox{\hyperlink{gwavi_8c_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open()}}-\/\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on error. 
\end{DoxyReturn}
\mbox{\Hypertarget{gwavi_8h_a770c50b59f23aacbd3eb01f837715e2d}\label{gwavi_8h_a770c50b59f23aacbd3eb01f837715e2d}} 
\index{gwavi.h@{gwavi.h}!gwavi\_open@{gwavi\_open}}
\index{gwavi\_open@{gwavi\_open}!gwavi.h@{gwavi.h}}
\doxysubsubsection{\texorpdfstring{gwavi\_open()}{gwavi\_open()}}
{\footnotesize\ttfamily struct gwavi\+\_\+t$\ast$ gwavi\+\_\+open (\begin{DoxyParamCaption}\item[{const char $\ast$}]{filename,  }\item[{unsigned int}]{width,  }\item[{unsigned int}]{height,  }\item[{const char $\ast$}]{fourcc,  }\item[{unsigned int}]{fps,  }\item[{struct gwavi\+\_\+audio\+\_\+t $\ast$}]{audio }\end{DoxyParamCaption})}



This is the first function you should call when using gwavi library. 

It allocates memory for a gwavi\+\_\+t structure and returns it and takes care of initializing the A\+VI header with the provided information.

When you\textquotesingle{}re done creating your A\+VI file, you should call \mbox{\hyperlink{gwavi_8c_a86a0a631350a3dc8d9768f43accfbbf3}{gwavi\+\_\+close()}} function to free memory allocated for the gwavi\+\_\+t structure and properly close the output file.


\begin{DoxyParams}{Parameters}
{\em filename} & This is the name of the A\+VI file which will be generated by this library. \\
\hline
{\em width} & Width of a frame. \\
\hline
{\em height} & Height of a frame. \\
\hline
{\em fourcc} & Four\+CC representing the codec of the video encoded stream. a Four\+CC is a sequence of four chars used to uniquely identify data formats. For more information, you can visit www.\+fourcc.\+org. \\
\hline
{\em fps} & Number of frames per second of your video. It needs to be $>$ 0. \\
\hline
{\em audio} & This parameter is optionnal. It is used for the audio track. If you do not want to add an audio track to your A\+VI file, simply pass N\+U\+LL for this argument.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Structure containing required information in order to create the A\+VI file. If an error occured, N\+U\+LL is returned. 
\end{DoxyReturn}
\mbox{\Hypertarget{gwavi_8h_a74274aa8941b63b47c844299415c45c7}\label{gwavi_8h_a74274aa8941b63b47c844299415c45c7}} 
\index{gwavi.h@{gwavi.h}!gwavi\_set\_codec@{gwavi\_set\_codec}}
\index{gwavi\_set\_codec@{gwavi\_set\_codec}!gwavi.h@{gwavi.h}}
\doxysubsubsection{\texorpdfstring{gwavi\_set\_codec()}{gwavi\_set\_codec()}}
{\footnotesize\ttfamily int gwavi\+\_\+set\+\_\+codec (\begin{DoxyParamCaption}\item[{struct gwavi\+\_\+t $\ast$}]{gwavi,  }\item[{const char $\ast$}]{fourcc }\end{DoxyParamCaption})}



This function allows you to reset the video codec. 

In a standard use case, you should not need to call it. However, if you need to, you can call it to reset the video codec after you are done adding frames to your A\+VI file and before you call \mbox{\hyperlink{gwavi_8c_a86a0a631350a3dc8d9768f43accfbbf3}{gwavi\+\_\+close()}}.


\begin{DoxyParams}{Parameters}
{\em gwavi} & Main gwavi structure initialized with \mbox{\hyperlink{gwavi_8c_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open()}}-\/ \\
\hline
{\em fourcc} & Four\+CC representing the codec of the video encoded stream. a\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on error. 
\end{DoxyReturn}
\mbox{\Hypertarget{gwavi_8h_ad0288ca3ca578aae593d1d199302d05d}\label{gwavi_8h_ad0288ca3ca578aae593d1d199302d05d}} 
\index{gwavi.h@{gwavi.h}!gwavi\_set\_framerate@{gwavi\_set\_framerate}}
\index{gwavi\_set\_framerate@{gwavi\_set\_framerate}!gwavi.h@{gwavi.h}}
\doxysubsubsection{\texorpdfstring{gwavi\_set\_framerate()}{gwavi\_set\_framerate()}}
{\footnotesize\ttfamily int gwavi\+\_\+set\+\_\+framerate (\begin{DoxyParamCaption}\item[{struct gwavi\+\_\+t $\ast$}]{gwavi,  }\item[{unsigned int}]{fps }\end{DoxyParamCaption})}



This function allows you to reset the framerate. 

In a standard use case, you should not need to call it. However, if you need to, you can call it to reset the framerate after you are done adding frames to your A\+VI file and before you call \mbox{\hyperlink{gwavi_8c_a86a0a631350a3dc8d9768f43accfbbf3}{gwavi\+\_\+close()}}.


\begin{DoxyParams}{Parameters}
{\em gwavi} & Main gwavi structure initialized with \mbox{\hyperlink{gwavi_8c_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open()}}-\/ \\
\hline
{\em fps} & Number of frames per second of your video.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on error. 
\end{DoxyReturn}
\mbox{\Hypertarget{gwavi_8h_a7791e9cd35e04e8da0e73d656813257b}\label{gwavi_8h_a7791e9cd35e04e8da0e73d656813257b}} 
\index{gwavi.h@{gwavi.h}!gwavi\_set\_size@{gwavi\_set\_size}}
\index{gwavi\_set\_size@{gwavi\_set\_size}!gwavi.h@{gwavi.h}}
\doxysubsubsection{\texorpdfstring{gwavi\_set\_size()}{gwavi\_set\_size()}}
{\footnotesize\ttfamily int gwavi\+\_\+set\+\_\+size (\begin{DoxyParamCaption}\item[{struct gwavi\+\_\+t $\ast$}]{gwavi,  }\item[{unsigned int}]{width,  }\item[{unsigned int}]{height }\end{DoxyParamCaption})}



This function allows you to reset the video size. 

In a standard use case, you should not need to call it. However, if you need to, you can call it to reset the video height and width set in the A\+VI file after you are done adding frames to your A\+VI file and before you call \mbox{\hyperlink{gwavi_8c_a86a0a631350a3dc8d9768f43accfbbf3}{gwavi\+\_\+close()}}.


\begin{DoxyParams}{Parameters}
{\em gwavi} & Main gwavi structure initialized with \mbox{\hyperlink{gwavi_8c_a770c50b59f23aacbd3eb01f837715e2d}{gwavi\+\_\+open()}}-\/ \\
\hline
{\em width} & Width of a frame. \\
\hline
{\em height} & Height of a frame.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on error. 
\end{DoxyReturn}
