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


Seeking within files.  


\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef ogg\+\_\+int64\+\_\+t($\ast$ \textbf{ Oggz\+Metric}) (\textbf{ OGGZ} $\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}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
ogg\+\_\+int64\+\_\+t \textbf{ oggz\+\_\+tell\+\_\+units} (\textbf{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\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{ OGGZ} $\ast$oggz, long serialno, \textbf{ Oggz\+Metric} metric, void $\ast$user\+\_\+data)
\begin{DoxyCompactList}\small\item\em Set the \doxyref{Oggz\+Metric}{p.}{group__metric_ga6e060f8616a8f8b3c76cb829a8227938} to use for an \doxyref{OGGZ}{p.}{oggz_8h_a672d218df13da45a4b41d5366211bfee} handle. \end{DoxyCompactList}\item 
int \textbf{ oggz\+\_\+set\+\_\+data\+\_\+start} (\textbf{ OGGZ} $\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{ OGGZ} $\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}
\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 \label{oggz__seek_8h_a116cf4ae056573ab69b1161671ff6c59} 
ogg\+\_\+int64\+\_\+t oggz\+\_\+bounded\+\_\+seek\+\_\+set (\begin{DoxyParamCaption}\item[{\textbf{ OGGZ} $\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 \doxyref{OGGZ}{p.}{oggz_8h_a672d218df13da45a4b41d5366211bfee} 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}
