ogg_stream_packetpeek.html 2.3 KB

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