/Code/Angel/Libraries/libogg-1.2.0/doc/libogg/decoding.html

http://angel-engine.googlecode.com/ · HTML · 104 lines · 97 code · 7 blank · 0 comment · 0 complexity · 0a2ffc8c8d761d148d9bb8e3a6bc32e0 MD5 · raw file

  1. <html>
  2. <head>
  3. <title>libogg - Decoding</title>
  4. <link rel=stylesheet href="style.css" type="text/css">
  5. </head>
  6. <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
  7. <table border=0 width=100%>
  8. <tr>
  9. <td><p class=tiny>libogg documentation</p></td>
  10. <td align=right><p class=tiny>libogg release 1.2.0 - 20100325</p></td>
  11. </tr>
  12. </table>
  13. <h1>Decoding</h1>
  14. <p>Libogg contains a set of functions used in the decoding process.
  15. <p>
  16. All the <b>libogg</b> specific functions are declared in "ogg/ogg.h".
  17. <p>
  18. <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.
  19. <p>Decoding through the Ogg layer follows a specific logical sequence. A read loop follows these logical steps:
  20. <ul>
  21. <li>Expose a buffer using <a href="ogg_sync_buffer.html">ogg_sync_buffer()</a>.
  22. <li>Read data into the buffer, using fread() or a similar function.
  23. <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.
  24. <li>Write out the data using <a href="ogg_sync_pageout.html">ogg_sync_pageout</a>.
  25. <li>Submit the completed page to the streaming layer with <a href="ogg_stream_pagein.html">ogg_stream_pagein</a>.
  26. <li>Output a packet of data to the codec-specific decoding layer using <a href="ogg_stream_packetout.html">ogg_stream_packetout</a>.
  27. </ul>
  28. <p>In practice, streams are more complex, and Ogg also must handle headers, incomplete or dropped pages, and other errors in input.
  29. <br><br>
  30. <table border=1 color=black width=50% cellspacing=0 cellpadding=7>
  31. <tr bgcolor=#cccccc>
  32. <td><b>function</b></td>
  33. <td><b>purpose</b></td>
  34. </tr>
  35. <tr valign=top>
  36. <td><a href="ogg_sync_init.html">ogg_sync_init</a></td>
  37. <td>Initializes an Ogg bitstream.</td>
  38. </tr>
  39. <tr valign=top>
  40. <td><a href="ogg_sync_clear.html">ogg_sync_clear</a></td>
  41. <td>Clears the status information from the synchronization struct.<td>
  42. </tr>
  43. <tr valign=top>
  44. <td><a href="ogg_sync_reset.html">ogg_sync_reset</a></td>
  45. <td>Resets the synchronization status to initial values.</td>
  46. </tr>
  47. <tr valign=top>
  48. <td><a href="ogg_sync_destroy.html">ogg_sync_destroy</a></td>
  49. <td>Frees the synchronization struct.</td>
  50. </tr>
  51. <tr valign=top>
  52. <td><a href="ogg_sync_check.html">ogg_sync_check</a></td>
  53. <td>Check for asynchronous errors.</td>
  54. </tr>
  55. <tr valign=top>
  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>
  58. </tr>
  59. <tr valign=top>
  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>
  62. </tr>
  63. <tr valign=top>
  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>
  66. </tr>
  67. <tr valign=top>
  68. <td><a href="ogg_sync_pageout.html">ogg_sync_pageout</a></td>
  69. <td>Outputs a page from the synchronization layer.</td>
  70. </tr>
  71. <tr valign=top>
  72. <td><a href="ogg_stream_pagein.html">ogg_stream_pagein</a></td>
  73. <td>Submits a complete page to the stream layer.</td>
  74. </tr>
  75. <tr valign=top>
  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>
  78. </tr>
  79. <tr valign=top>
  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>
  83. </tr>
  84. </table>
  85. <br><br>
  86. <hr noshade>
  87. <table border=0 width=100%>
  88. <tr valign=top>
  89. <td><p class=tiny>copyright &copy; 2000-2010 Xiph.Org</p></td>
  90. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
  91. </tr><tr>
  92. <td><p class=tiny>libogg documentation</p></td>
  93. <td align=right><p class=tiny>libogg release 1.2.0 - 20100325</p></td>
  94. </tr>
  95. </table>
  96. </body>
  97. </html>