Chris@1: <html>
Chris@1: 
Chris@1: <head>
Chris@1: <title>libogg - Decoding</title>
Chris@1: <link rel=stylesheet href="style.css" type="text/css">
Chris@1: </head>
Chris@1: 
Chris@1: <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
Chris@1: <table border=0 width=100%>
Chris@1: <tr>
Chris@1: <td><p class=tiny>libogg documentation</p></td>
Chris@1: <td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td>
Chris@1: </tr>
Chris@1: </table>
Chris@1: 
Chris@1: <h1>Decoding</h1>
Chris@1: <p>Libogg contains a set of functions used in the decoding process.
Chris@1: <p>
Chris@1: All the <b>libogg</b> specific functions are declared in "ogg/ogg.h".
Chris@1: <p>
Chris@1: <p>Decoding is based around the ogg synchronization layer.  The <a href="ogg_sync_state.html">ogg_sync_state</a> struct coordinates between incoming data and the decoder.  We read data into the synchronization layer, submit the data to the stream, and output raw packets to the decoder.
Chris@1: <p>Decoding through the Ogg layer follows a specific logical sequence.  A read loop follows these logical steps:
Chris@1: <ul>
Chris@1: <li>Expose a buffer using <a href="ogg_sync_buffer.html">ogg_sync_buffer()</a>.
Chris@1: <li>Read data into the buffer, using fread() or a similar function.
Chris@1: <li>Call <a href="ogg_sync_wrote.html">ogg_sync_wrote()</a> to tell the synchronization layer how many bytes you wrote into the buffer.
Chris@1: <li>Write out the data using <a href="ogg_sync_pageout.html">ogg_sync_pageout</a>.
Chris@1: <li>Submit the completed page to the streaming layer with <a href="ogg_stream_pagein.html">ogg_stream_pagein</a>.
Chris@1: <li>Output a packet of data to the codec-specific decoding layer using <a href="ogg_stream_packetout.html">ogg_stream_packetout</a>.
Chris@1: </ul>
Chris@1: <p>In practice, streams are more complex, and Ogg also must handle headers, incomplete or dropped pages, and other errors in input.
Chris@1: <br><br>
Chris@1: 
Chris@1: <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
Chris@1: <tr bgcolor=#cccccc>
Chris@1: 	<td><b>function</b></td>
Chris@1: 	<td><b>purpose</b></td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_init.html">ogg_sync_init</a></td>
Chris@1: 	<td>Initializes an Ogg bitstream.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_clear.html">ogg_sync_clear</a></td>
Chris@1: 	<td>Clears the status information from the synchronization struct.<td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_reset.html">ogg_sync_reset</a></td>
Chris@1: 	<td>Resets the synchronization status to initial values.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_destroy.html">ogg_sync_destroy</a></td>
Chris@1: 	<td>Frees the synchronization struct.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_check.html">ogg_sync_check</a></td>
Chris@1: 	<td>Check for asynchronous errors.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_buffer.html">ogg_sync_buffer</a></td>
Chris@1: 	<td>Exposes a buffer from the synchronization layer in order to read data.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_wrote.html">ogg_sync_wrote</a></td>
Chris@1: 	<td>Tells the synchronization layer how many bytes were written into the buffer.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_pageseek.html">ogg_sync_pageseek</a></td>
Chris@1: 	<td>Finds the borders of pages and resynchronizes the stream.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_sync_pageout.html">ogg_sync_pageout</a></td>
Chris@1: 	<td>Outputs a page from the synchronization layer.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_stream_pagein.html">ogg_stream_pagein</a></td>
Chris@1: 	<td>Submits a complete page to the stream layer.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_stream_packetout.html">ogg_stream_packetout</a></td>
Chris@1: 	<td>Outputs a packet to the codec-specific decoding engine.</td>
Chris@1: </tr>
Chris@1: <tr valign=top>
Chris@1: <td><a href="ogg_stream_packetpeek.html">ogg_stream_packetpeek</a></td>
Chris@1: 	<td>Provides access to the next packet in the bitstream without
Chris@1: advancing decoding.</td>
Chris@1: </tr>
Chris@1: </table>
Chris@1: 
Chris@1: <br><br>
Chris@1: <hr noshade>
Chris@1: <table border=0 width=100%>
Chris@1: <tr valign=top>
Chris@1: <td><p class=tiny>copyright &copy; 2000-2011 Xiph.Org</p></td>
Chris@1: <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
Chris@1: </tr><tr>
Chris@1: <td><p class=tiny>libogg documentation</p></td>
Chris@1: <td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td>
Chris@1: </tr>
Chris@1: </table>
Chris@1: 
Chris@1: </body>
Chris@1: 
Chris@1: </html>