4 <title>libogg - Decoding</title>
5 <link rel=stylesheet href="style.css" type="text/css">
8 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
9 <table border=0 width=100%>
11 <td><p class=tiny>libogg documentation</p></td>
12 <td align=right><p class=tiny>libogg release 1.0 - 20000615</p></td>
17 <p>Libogg contains a set of functions used in the decoding process.
19 All the <b>libogg</b> specific functions are declared in "ogg/ogg.h".
21 <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.
22 <p>Decoding through the Ogg layer follows a specific logical sequence. A read loop follows these logical steps:
24 <li>Expose a buffer using <a href="ogg_sync_buffer.html">ogg_sync_buffer()</a>.
25 <li>Read data into the buffer, using fread() or a similar function.
26 <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.
27 <li>Write out the data using <a href="ogg_sync_pageout.html">ogg_sync_pageout</a>.
28 <li>Submit the completed page to the streaming layer with <a href="ogg_stream_pagein.html">ogg_stream_pagein</a>.
29 <li>Output a packet of data to the codec-specific decoding layer using <a href="ogg_stream_packetout.html">ogg_stream_packetout</a>.
31 <p>In practice, streams are more complex, and Ogg also must handle headers, incomplete or dropped pages, and other errors in input.
34 <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
36 <td><b>function</b></td>
37 <td><b>purpose</b></td>
40 <td><a href="ogg_sync_init.html">ogg_sync_init</a></td>
41 <td>Initializes an Ogg bitstream.</td>
44 <td><a href="ogg_sync_clear.html">ogg_sync_clear</a></td>
45 <td>Clears the status information from the synchronization struct.<td>
48 <td><a href="ogg_sync_reset.html">ogg_sync_reset</a></td>
49 <td>Resets the synchronization status to initial values.</td>
52 <td><a href="ogg_sync_destroy.html">ogg_sync_destroy</a></td>
53 <td>Frees the synchronization struct.</td>
56 <td><a href="ogg_sync_buffer.html">ogg_sync_buffer</a></td>
57 <td>Exposes a buffer from the synchronization layer in order to read data.</td>
60 <td><a href="ogg_sync_wrote.html">ogg_sync_wrote</a></td>
61 <td>Tells the synchronization layer how many bytes were written into the buffer.</td>
64 <td><a href="ogg_sync_pageseek.html">ogg_sync_pageseek</a></td>
65 <td>Finds the borders of pages and resynchronizes the stream.</td>
68 <td><a href="ogg_sync_pageout.html">ogg_sync_pageout</a></td>
69 <td>Outputs a page from the synchronization layer.</td>
72 <td><a href="ogg_stream_pagein.html">ogg_stream_pagein</a></td>
73 <td>Submits a complete page to the stream layer.</td>
76 <td><a href="ogg_stream_packetout.html">ogg_stream_packetout</a></td>
77 <td>Outputs a packet to the codec-specific decoding engine.</td>
80 <td><a href="ogg_stream_packetpeek.html">ogg_stream_packetpeek</a></td>
81 <td>Provides access to the next packet in the bitstream without
82 advancing decoding.</td>
88 <table border=0 width=100%>
90 <td><p class=tiny>copyright © 2000 xiph.org</p></td>
91 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a><br><a href="mailto:team@xiph.org">team@xiph.org</a></p></td>
93 <td><p class=tiny>libogg documentation</p></td>
94 <td align=right><p class=tiny>libogg release 1.0 - 20000615</p></td>