ov_callbacks.html 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <html>
  2. <head>
  3. <title>Tremor - datatype - ov_callbacks</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>Tremor documentation</p></td>
  10. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  11. </tr>
  12. </table>
  13. <h1>ov_callbacks</h1>
  14. <p><i>declared in "ivorbiscodec.h"</i></p>
  15. <p>
  16. The ov_callbacks structure contains file manipulation function prototypes necessary for opening, closing, seeking, and location.
  17. <p>
  18. The ov_callbacks structure does not need to be user-defined if you are
  19. working with stdio-based file manipulation; the <a
  20. href="ov_open.html">ov_open()</a> call provides default callbacks for
  21. stdio. ov_callbacks are defined and passed to <a
  22. href="ov_open_callbacks.html">ov_open_callbacks()</a> when
  23. implementing non-stdio based stream manipulation (such as playback
  24. from a memory buffer).
  25. <p>
  26. <table border=0 width=100% color=black cellspacing=0 cellpadding=7>
  27. <tr bgcolor=#cccccc>
  28. <td>
  29. <pre><b>typedef struct {
  30. size_t (*read_func) (void *ptr, size_t size, size_t nmemb, void *datasource);
  31. int (*seek_func) (void *datasource, ogg_int64_t offset, int whence);
  32. int (*close_func) (void *datasource);
  33. long (*tell_func) (void *datasource);
  34. } ov_callbacks;</b></pre>
  35. </td>
  36. </tr>
  37. </table>
  38. <h3>Relevant Struct Members</h3>
  39. <dl>
  40. <dt><i>read_func</i></dt>
  41. <dd>Pointer to custom data reading function.</dd>
  42. <dt><i>seek_func</i></dt>
  43. <dd>Pointer to custom data seeking function. If the data source is not seekable (or the application wants the data source to be treated as unseekable at all times), the provided seek callback should always return -1 (failure).</dd>
  44. <dt><i>close_func</i></dt>
  45. <dd>Pointer to custom data source closure function.</dd>
  46. <dt><i>tell_func</i></dt>
  47. <dd>Pointer to custom data location function.</dd>
  48. </dl>
  49. <p>
  50. See <a href="callbacks.html">the callbacks and non-stdio I/O document</a> for more
  51. detailed information on required behavior of the various callback
  52. functions.<p>
  53. <br><br>
  54. <hr noshade>
  55. <table border=0 width=100%>
  56. <tr valign=top>
  57. <td><p class=tiny>copyright &copy; 2002 Xiph.org</p></td>
  58. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
  59. </tr><tr>
  60. <td><p class=tiny>Tremor documentation</p></td>
  61. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  62. </tr>
  63. </table>
  64. </body>
  65. </html>