\section{oggz\_\-seek.h File Reference}
\label{oggz__seek_8h}\index{oggz\_\-seek.h@{oggz\_\-seek.h}}
Seeking within files.  


\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef ogg\_\-int64\_\-t($\ast$ {\bf OggzMetric} )({\bf OGGZ} $\ast$oggz, long serialno, ogg\_\-int64\_\-t granulepos, void $\ast$user\_\-data)
\begin{CompactList}\small\item\em This is the signature of a function to correlate Ogg streams. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
ogg\_\-int64\_\-t {\bf oggz\_\-tell\_\-units} ({\bf OGGZ} $\ast$oggz)
\begin{CompactList}\small\item\em Query the current offset in milliseconds, or custom units as specified by a Metric function you have provided. \item\end{CompactList}\item 
ogg\_\-int64\_\-t {\bf oggz\_\-seek\_\-units} ({\bf OGGZ} $\ast$oggz, ogg\_\-int64\_\-t units, int whence)
\begin{CompactList}\small\item\em Seek to an offset in milliseconds, or custom units as specified by a Metric function you have provided. \item\end{CompactList}\item 
ogg\_\-int64\_\-t {\bf oggz\_\-tell\_\-granulepos} ({\bf OGGZ} $\ast$oggz)
\begin{CompactList}\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. \item\end{CompactList}\item 
{\bf oggz\_\-off\_\-t} {\bf oggz\_\-tell} ({\bf OGGZ} $\ast$oggz)
\begin{CompactList}\small\item\em Query the file offset in bytes corresponding to the data read. \item\end{CompactList}\item 
{\bf oggz\_\-off\_\-t} {\bf oggz\_\-seek} ({\bf OGGZ} $\ast$oggz, {\bf oggz\_\-off\_\-t} offset, int whence)
\begin{CompactList}\small\item\em Seek to a specific byte offset. \item\end{CompactList}\item 
int {\bf oggz\_\-get\_\-preroll} ({\bf OGGZ} $\ast$oggz, long serialno)
\begin{CompactList}\small\item\em Retrieve the preroll of a logical bitstream. \item\end{CompactList}\item 
int {\bf oggz\_\-set\_\-preroll} ({\bf OGGZ} $\ast$oggz, long serialno, int preroll)
\begin{CompactList}\small\item\em Specify the preroll of a logical bitstream. \item\end{CompactList}\item 
int {\bf oggz\_\-get\_\-granuleshift} ({\bf OGGZ} $\ast$oggz, long serialno)
\begin{CompactList}\small\item\em Retrieve the granuleshift of a logical bitstream. \item\end{CompactList}\item 
int {\bf oggz\_\-set\_\-granuleshift} ({\bf OGGZ} $\ast$oggz, long serialno, int granuleshift)
\begin{CompactList}\small\item\em Specify the granuleshift of a logical bitstream. \item\end{CompactList}\item 
int {\bf oggz\_\-get\_\-granulerate} ({\bf OGGZ} $\ast$oggz, long serialno, ogg\_\-int64\_\-t $\ast$granulerate\_\-n, ogg\_\-int64\_\-t $\ast$granulerate\_\-d)
\begin{CompactList}\small\item\em Retrieve the granulerate of a logical bitstream. \item\end{CompactList}\item 
int {\bf oggz\_\-set\_\-granulerate} ({\bf OGGZ} $\ast$oggz, long serialno, ogg\_\-int64\_\-t granule\_\-rate\_\-numerator, ogg\_\-int64\_\-t granule\_\-rate\_\-denominator)
\begin{CompactList}\small\item\em Specify the granulerate of a logical bitstream. \item\end{CompactList}\item 
int {\bf oggz\_\-set\_\-metric} ({\bf OGGZ} $\ast$oggz, long serialno, {\bf OggzMetric} metric, void $\ast$user\_\-data)
\begin{CompactList}\small\item\em Set the OggzMetric to use for an OGGZ handle. \item\end{CompactList}\item 
int {\bf oggz\_\-set\_\-data\_\-start} ({\bf OGGZ} $\ast$oggz, {\bf oggz\_\-off\_\-t} offset)
\begin{CompactList}\small\item\em Tell Oggz to remember the given offset as the start of data. \item\end{CompactList}\item 
ogg\_\-int64\_\-t {\bf oggz\_\-bounded\_\-seek\_\-set} ({\bf OGGZ} $\ast$oggz, ogg\_\-int64\_\-t unit\_\-target, ogg\_\-int64\_\-t offset\_\-begin, ogg\_\-int64\_\-t offset\_\-end)
\begin{CompactList}\small\item\em Seeks Oggz to time unit\_\-target, but with the bounds of the offset range [offset\_\-begin, offset\_\-end]. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Seeking within files. 



\subsection{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}}
\subsubsection[{oggz\_\-bounded\_\-seek\_\-set}]{\setlength{\rightskip}{0pt plus 5cm}ogg\_\-int64\_\-t oggz\_\-bounded\_\-seek\_\-set ({\bf OGGZ} $\ast$ {\em oggz}, \/  ogg\_\-int64\_\-t {\em unit\_\-target}, \/  ogg\_\-int64\_\-t {\em offset\_\-begin}, \/  ogg\_\-int64\_\-t {\em offset\_\-end})}\label{oggz__seek_8h_116cf4ae056573ab69b1161671ff6c59}


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{Desc}
\item[Parameters:]
\begin{description}
\item[{\em oggz}]An OGGZ handle previously opened for reading \item[{\em unit\_\-target}]The seek target, in milliseconds, or custom units \item[{\em offset\_\-begin}]Start of offset range to seek inside, in bytes \item[{\em offset\_\-end}]End of offset range to seek inside, in bytes, pass -1 for end of media \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]The new position, in milliseconds or custom units \end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em -1}]on failure (unit\_\-target is not within range) \end{description}
\end{Desc}
