examples/SFExamples/oggvorbiscodec/src/libogg/doc/ogg/decoding.html

00001 <html>
00002 
00003 <head>
00004 <title>libogg - Decoding</title>
00005 <link rel=stylesheet href="style.css" type="text/css">
00006 </head>
00007 
00008 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
00009 <table border=0 width=100%>
00010 <tr>
00011 <td><p class=tiny>libogg documentation</p></td>
00012 <td align=right><p class=tiny>libogg release 1.0 - 20000615</p></td>
00013 </tr>
00014 </table>
00015 
00016 <h1>Decoding</h1>
00017 <p>Libogg contains a set of functions used in the decoding process.
00018 <p>
00019 All the <b>libogg</b> specific functions are declared in "ogg/ogg.h".
00020 <p>
00021 <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.
00022 <p>Decoding through the Ogg layer follows a specific logical sequence.  A read loop follows these logical steps:
00023 <ul>
00024 <li>Expose a buffer using <a href="ogg_sync_buffer.html">ogg_sync_buffer()</a>.
00025 <li>Read data into the buffer, using fread() or a similar function.
00026 <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.
00027 <li>Write out the data using <a href="ogg_sync_pageout.html">ogg_sync_pageout</a>.
00028 <li>Submit the completed page to the streaming layer with <a href="ogg_stream_pagein.html">ogg_stream_pagein</a>.
00029 <li>Output a packet of data to the codec-specific decoding layer using <a href="ogg_stream_packetout.html">ogg_stream_packetout</a>.
00030 </ul>
00031 <p>In practice, streams are more complex, and Ogg also must handle headers, incomplete or dropped pages, and other errors in input.
00032 <br><br>
00033 
00034 <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
00035 <tr bgcolor=#cccccc>
00036         <td><b>function</b></td>
00037         <td><b>purpose</b></td>
00038 </tr>
00039 <tr valign=top>
00040 <td><a href="ogg_sync_init.html">ogg_sync_init</a></td>
00041         <td>Initializes an Ogg bitstream.</td>
00042 </tr>
00043 <tr valign=top>
00044 <td><a href="ogg_sync_clear.html">ogg_sync_clear</a></td>
00045         <td>Clears the status information from the synchronization struct.<td>
00046 </tr>
00047 <tr valign=top>
00048 <td><a href="ogg_sync_reset.html">ogg_sync_reset</a></td>
00049         <td>Resets the synchronization status to initial values.</td>
00050 </tr>
00051 <tr valign=top>
00052 <td><a href="ogg_sync_destroy.html">ogg_sync_destroy</a></td>
00053         <td>Frees the synchronization struct.</td>
00054 </tr>
00055 <tr valign=top>
00056 <td><a href="ogg_sync_buffer.html">ogg_sync_buffer</a></td>
00057         <td>Exposes a buffer from the synchronization layer in order to read data.</td>
00058 </tr>
00059 <tr valign=top>
00060 <td><a href="ogg_sync_wrote.html">ogg_sync_wrote</a></td>
00061         <td>Tells the synchronization layer how many bytes were written into the buffer.</td>
00062 </tr>
00063 <tr valign=top>
00064 <td><a href="ogg_sync_pageseek.html">ogg_sync_pageseek</a></td>
00065         <td>Finds the borders of pages and resynchronizes the stream.</td>
00066 </tr>
00067 <tr valign=top>
00068 <td><a href="ogg_sync_pageout.html">ogg_sync_pageout</a></td>
00069         <td>Outputs a page from the synchronization layer.</td>
00070 </tr>
00071 <tr valign=top>
00072 <td><a href="ogg_stream_pagein.html">ogg_stream_pagein</a></td>
00073         <td>Submits a complete page to the stream layer.</td>
00074 </tr>
00075 <tr valign=top>
00076 <td><a href="ogg_stream_packetout.html">ogg_stream_packetout</a></td>
00077         <td>Outputs a packet to the codec-specific decoding engine.</td>
00078 </tr>
00079 <tr valign=top>
00080 <td><a href="ogg_stream_packetpeek.html">ogg_stream_packetpeek</a></td>
00081         <td>Provides access to the next packet in the bitstream without
00082 advancing decoding.</td>
00083 </tr>
00084 </table>
00085 
00086 <br><br>
00087 <hr noshade>
00088 <table border=0 width=100%>
00089 <tr valign=top>
00090 <td><p class=tiny>copyright &copy; 2000 xiph.org</p></td>
00091 <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>
00092 </tr><tr>
00093 <td><p class=tiny>libogg documentation</p></td>
00094 <td align=right><p class=tiny>libogg release 1.0 - 20000615</p></td>
00095 </tr>
00096 </table>
00097 
00098 </body>
00099 
00100 </html>

Generated by  doxygen 1.6.2