Home | History | Annotate | Download | only in libogg
      1 <html>
      2 
      3 <head>
      4 <title>libogg - function - ogg_stream_packetpeek</title>
      5 <link rel=stylesheet href="style.css" type="text/css">
      6 </head>
      7 
      8 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
      9 <table border=0 width=100%>
     10 <tr>
     11 <td><p class=tiny>libogg documentation</p></td>
     12 <td align=right><p class=tiny>libogg release 1.2.0 - 20100325</p></td>
     13 </tr>
     14 </table>
     15 
     16 <h1>ogg_stream_packetpeek</h1>
     17 
     18 <p><i>declared in "ogg/ogg.h";</i></p>
     19 
     20 <p>This function attempts to assemble a raw data packet and returns
     21 it without advancing decoding.</p>
     22 
     23 <p>In a typical situation, this would be called
     24 speculatively after <a
     25 href="ogg_stream_pagein.html">ogg_stream_pagein()</a> to check
     26 the packet contents before handing it off to a codec for 
     27 decompression. To advance page decoding and remove
     28 the packet from the sync structure, call 
     29 <a href="ogg_stream_packetout.html">ogg_stream_packetout()</a>.</p>
     30 
     31 <br><br>
     32 
     33 <table border=0 color=black cellspacing=0 cellpadding=7>
     34 <tr bgcolor=#cccccc>
     35 	<td>
     36 <pre><b>
     37 int ogg_stream_packetpeek(ogg_stream_state *os,ogg_packet *op);
     38 </b></pre>
     39 	</td>
     40 </tr>
     41 </table>
     42 
     43 <h3>Parameters</h3>
     44 <dl>
     45 <dt><i>os</i></dt>
     46 <dd>Pointer to a previously declared 
     47 <a href="ogg_stream_state.html">ogg_stream_state</a> struct.  Before this
     48 function is called, an <a href="ogg_page.html">ogg_page</a> should be
     49 submitted to the stream using 
     50 <a href="ogg_stream_pagein.html">ogg_stream_pagein()</a>.</dd>
     51 <dt><i>op</i></dt>
     52 <dd>Pointer to the next packet available in the bitstream, if
     53 any. A NULL value may be passed in the case of a simple "is there a 
     54 packet?" check.</dd>
     55 </dl>
     56 
     57 
     58 <h3>Return Values</h3>
     59 <blockquote>
     60 <ul>
     61 <li>-1 if there's no packet available due to lost sync or a hole in the data.</li>
     62 <li>0 if there is insufficient data available to complete a packet, or on unrecoverable internal error occurred.</li>
     63 <li>1 if a packet is available.</li>
     64 </ul>
     65 </blockquote>
     66 
     67 
     68 <br><br>
     69 
     70 <hr noshade>
     71 
     72 <table border=0 width=100%>
     73 <tr valign=top>
     74 <td><p class=tiny>copyright &copy; 2000-2010 Xiph.Org</p></td>
     75 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
     76 </tr><tr>
     77 <td><p class=tiny>libogg documentation</p></td>
     78 <td align=right><p class=tiny>libogg release 1.2.0 - 20100325</p></td>
     79 </tr>
     80 </table>
     81 
     82 
     83 </body>
     84 
     85 </html>
     86