annotate src/libogg-1.3.0/doc/libogg/ogg_sync_pageout.html @ 86:98c1576536ae

Bring in flac, ogg, vorbis
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 19 Mar 2013 17:37:49 +0000
parents
children
rev   line source
cannam@86 1 <html>
cannam@86 2
cannam@86 3 <head>
cannam@86 4 <title>libogg - function - ogg_sync_pageout</title>
cannam@86 5 <link rel=stylesheet href="style.css" type="text/css">
cannam@86 6 </head>
cannam@86 7
cannam@86 8 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
cannam@86 9 <table border=0 width=100%>
cannam@86 10 <tr>
cannam@86 11 <td><p class=tiny>libogg documentation</p></td>
cannam@86 12 <td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td>
cannam@86 13 </tr>
cannam@86 14 </table>
cannam@86 15
cannam@86 16 <h1>ogg_sync_pageout</h1>
cannam@86 17
cannam@86 18 <p><i>declared in "ogg/ogg.h";</i></p>
cannam@86 19
cannam@86 20 <p>This function takes the data stored in the buffer of the <a href="ogg_sync_state.html">ogg_sync_state</a> struct and inserts them into an <a href="ogg_page.html">ogg_page</a>.
cannam@86 21
cannam@86 22 <p>In an actual decoding loop, this function should be called first to ensure that the buffer is cleared. The example code below illustrates a clean reading loop which will fill and output pages.
cannam@86 23 <p><b>Caution:</b>This function should be called before reading into the buffer to ensure that data does not remain in the ogg_sync_state struct. Failing to do so may result in a memory leak. See the example code below for details.
cannam@86 24
cannam@86 25 <br><br>
cannam@86 26 <table border=0 color=black cellspacing=0 cellpadding=7>
cannam@86 27 <tr bgcolor=#cccccc>
cannam@86 28 <td>
cannam@86 29 <pre><b>
cannam@86 30 int ogg_sync_pageout(<a href="ogg_sync_state.html">ogg_sync_state</a> *oy, <a href="ogg_page.html">ogg_page</a> *og);
cannam@86 31 </b></pre>
cannam@86 32 </td>
cannam@86 33 </tr>
cannam@86 34 </table>
cannam@86 35
cannam@86 36 <h3>Parameters</h3>
cannam@86 37 <dl>
cannam@86 38 <dt><i>oy</i></dt>
cannam@86 39 <dd>Pointer to a previously declared <a href="ogg_sync_state.html">ogg_sync_state</a> struct. Normally, the internal storage of this struct should be filled with newly read data and verified using <a href="ogg_sync_wrote.html">ogg_sync_wrote</a>.</dd>
cannam@86 40 <dt><i>og</i></dt>
cannam@86 41 <dd>Pointer to page struct filled by this function.
cannam@86 42 </dl>
cannam@86 43
cannam@86 44
cannam@86 45 <h3>Return Values</h3>
cannam@86 46 <blockquote>
cannam@86 47 <li>-1 returned if stream has not yet captured sync (bytes were skipped).</li>
cannam@86 48 <li>0 returned if more data needed or an internal error occurred.</li>
cannam@86 49 <li>1 indicated a page was synced and returned.</li>
cannam@86 50 </blockquote>
cannam@86 51 <p>
cannam@86 52
cannam@86 53 <h3>Example Usage</h3>
cannam@86 54 <pre>
cannam@86 55 if (ogg_sync_pageout(&oy, &og) != 1) {
cannam@86 56 buffer = ogg_sync_buffer(&oy, 8192);
cannam@86 57 bytes = fread(buffer, 1, 8192, stdin);
cannam@86 58 ogg_sync_wrote(&oy, bytes);
cannam@86 59 }
cannam@86 60 </pre>
cannam@86 61
cannam@86 62 <br><br>
cannam@86 63 <hr noshade>
cannam@86 64 <table border=0 width=100%>
cannam@86 65 <tr valign=top>
cannam@86 66 <td><p class=tiny>copyright &copy; 2000-2011 Xiph.Org</p></td>
cannam@86 67 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
cannam@86 68 </tr><tr>
cannam@86 69 <td><p class=tiny>libogg documentation</p></td>
cannam@86 70 <td align=right><p class=tiny>libogg release 1.3.0 - 20110804</p></td>
cannam@86 71 </tr>
cannam@86 72 </table>
cannam@86 73
cannam@86 74
cannam@86 75 </body>
cannam@86 76
cannam@86 77 </html>