Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 2946d6d651bbdb069ce8220554506190 > files > 35

liboggz-devel-1.0.0-1mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>liboggz: Writing with OggzHungry callbacks</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.6 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Writing with OggzHungry callbacks</h1>An OggzHungry callback will:<ul>
<li>Create an <em>ogg_packet</em> structure</li><li>Add it to the packet queue with <a class="el" href="group__write__api.html#g6ccaceb107db1fd2eae047dbdbaa5889" title="Add a packet to oggz&#39;s packet queue.">oggz_write_feed()</a></li></ul>
<p>
Once you have set such a callback with <a class="el" href="group__write__api.html#gf362c030bc7a7f57cb23f2b863a59389" title="Set a callback for Oggz to call when oggz is hungry .">oggz_write_set_hungry_callback()</a>, simply call <a class="el" href="group__write__api.html#g3c97d94ea425d64546adf9c368b71904" title="Write n bytes from an OGGZ handle.">oggz_write()</a> or <a class="el" href="group__write__api.html#g5606dff01964caec4582eb172fde0c1c" title="Output data from an OGGZ handle.">oggz_write_output()</a> repeatedly, and Oggz will call your callback to provide packets when it is hungry.<p>
This process is illustrated in the following diagram:<p>
<div align="center">
<img src="hungry.png" alt="hungry.png">
</div>
 <p>
The following example code generates a stream of ten packets, each containing a single byte ('A', 'B', ... , 'J'):<p>
<div class="fragment"><pre class="fragment"></pre></div> 
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
</table>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Tue Sep 15 08:06:11 2009 for liboggz by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>