\doxysection{oggz\+\_\+seek.\+h File Reference}
\label{oggz__seek_8h}\index{oggz\_seek.h@{oggz\_seek.h}}


Seeking within files.  


\doxysubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef ogg\+\_\+int64\+\_\+t($\ast$ \textbf{ Oggz\+Metric}) (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno, ogg\+\_\+int64\+\_\+t granulepos, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em This is the signature of a function to correlate Ogg streams. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
ogg\+\_\+int64\+\_\+t \textbf{ oggz\+\_\+tell\+\_\+units} (\textbf{ O\+G\+GZ} $\ast$oggz)
\begin{DoxyCompactList}\small\item\em Query the current offset in milliseconds, or custom units as specified by a Metric function you have provided. \end{DoxyCompactList}\item 
ogg\+\_\+int64\+\_\+t \textbf{ oggz\+\_\+seek\+\_\+units} (\textbf{ O\+G\+GZ} $\ast$oggz, ogg\+\_\+int64\+\_\+t units, int whence)
\begin{DoxyCompactList}\small\item\em Seek to an offset in milliseconds, or custom units as specified by a Metric function you have provided. \end{DoxyCompactList}\item 
ogg\+\_\+int64\+\_\+t \textbf{ oggz\+\_\+tell\+\_\+granulepos} (\textbf{ O\+G\+GZ} $\ast$oggz)
\begin{DoxyCompactList}\small\item\em Provide the exact stored granulepos (from the page header) if relevant to the current packet, or a constructed granulepos if the stored granulepos does not belong to this packet, or -\/1 if this codec does not have support for granulepos interpolation. \end{DoxyCompactList}\item 
\textbf{ oggz\+\_\+off\+\_\+t} \textbf{ oggz\+\_\+tell} (\textbf{ O\+G\+GZ} $\ast$oggz)
\begin{DoxyCompactList}\small\item\em Query the file offset in bytes corresponding to the data read. \end{DoxyCompactList}\item 
\textbf{ oggz\+\_\+off\+\_\+t} \textbf{ oggz\+\_\+seek} (\textbf{ O\+G\+GZ} $\ast$oggz, \textbf{ oggz\+\_\+off\+\_\+t} offset, int whence)
\begin{DoxyCompactList}\small\item\em Seek to a specific byte offset. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+get\+\_\+preroll} (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno)
\begin{DoxyCompactList}\small\item\em Retrieve the preroll of a logical bitstream. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+set\+\_\+preroll} (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno, int preroll)
\begin{DoxyCompactList}\small\item\em Specify the preroll of a logical bitstream. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+get\+\_\+granuleshift} (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno)
\begin{DoxyCompactList}\small\item\em Retrieve the granuleshift of a logical bitstream. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+set\+\_\+granuleshift} (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno, int granuleshift)
\begin{DoxyCompactList}\small\item\em Specify the granuleshift of a logical bitstream. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+get\+\_\+granulerate} (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno, ogg\+\_\+int64\+\_\+t $\ast$granulerate\+\_\+n, ogg\+\_\+int64\+\_\+t $\ast$granulerate\+\_\+d)
\begin{DoxyCompactList}\small\item\em Retrieve the granulerate of a logical bitstream. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+set\+\_\+granulerate} (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno, ogg\+\_\+int64\+\_\+t granule\+\_\+rate\+\_\+numerator, ogg\+\_\+int64\+\_\+t granule\+\_\+rate\+\_\+denominator)
\begin{DoxyCompactList}\small\item\em Specify the granulerate of a logical bitstream. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+set\+\_\+metric} (\textbf{ O\+G\+GZ} $\ast$oggz, long serialno, \textbf{ Oggz\+Metric} metric, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Set the Oggz\+Metric to use for an O\+G\+GZ handle. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+set\+\_\+data\+\_\+start} (\textbf{ O\+G\+GZ} $\ast$oggz, \textbf{ oggz\+\_\+off\+\_\+t} offset)
\begin{DoxyCompactList}\small\item\em Tell Oggz to remember the given offset as the start of data. \end{DoxyCompactList}\item 
ogg\+\_\+int64\+\_\+t \textbf{ oggz\+\_\+bounded\+\_\+seek\+\_\+set} (\textbf{ O\+G\+GZ} $\ast$oggz, ogg\+\_\+int64\+\_\+t unit\+\_\+target, ogg\+\_\+int64\+\_\+t offset\+\_\+begin, ogg\+\_\+int64\+\_\+t offset\+\_\+end)
\begin{DoxyCompactList}\small\item\em Seeks Oggz to time unit\+\_\+target, but with the bounds of the offset range [offset\+\_\+begin, offset\+\_\+end]. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Seeking within files. 



\doxysubsection{Function Documentation}
\mbox{\label{oggz__seek_8h_a116cf4ae056573ab69b1161671ff6c59}} 
\index{oggz\_seek.h@{oggz\_seek.h}!oggz\_bounded\_seek\_set@{oggz\_bounded\_seek\_set}}
\index{oggz\_bounded\_seek\_set@{oggz\_bounded\_seek\_set}!oggz\_seek.h@{oggz\_seek.h}}
\doxysubsubsection{oggz\_bounded\_seek\_set()}
{\footnotesize\ttfamily ogg\+\_\+int64\+\_\+t oggz\+\_\+bounded\+\_\+seek\+\_\+set (\begin{DoxyParamCaption}\item[{\textbf{ O\+G\+GZ} $\ast$}]{oggz,  }\item[{ogg\+\_\+int64\+\_\+t}]{unit\+\_\+target,  }\item[{ogg\+\_\+int64\+\_\+t}]{offset\+\_\+begin,  }\item[{ogg\+\_\+int64\+\_\+t}]{offset\+\_\+end }\end{DoxyParamCaption})}



Seeks Oggz to time unit\+\_\+target, but with the bounds of the offset range [offset\+\_\+begin, offset\+\_\+end]. 

This is useful when seeking in network streams where only parts of a media are buffered, and retrieving unbuffered parts is expensive. 
\begin{DoxyParams}{Parameters}
{\em oggz} & An O\+G\+GZ handle previously opened for reading \\
\hline
{\em unit\+\_\+target} & The seek target, in milliseconds, or custom units \\
\hline
{\em offset\+\_\+begin} & Start of offset range to seek inside, in bytes \\
\hline
{\em offset\+\_\+end} & End of offset range to seek inside, in bytes, pass -\/1 for end of media \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The new position, in milliseconds or custom units 
\end{DoxyReturn}

\begin{DoxyRetVals}{Return values}
{\em -\/1} & on failure (unit\+\_\+target is not within range) \\
\hline
\end{DoxyRetVals}
