ov_test_callbacks.html 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <html>
  2. <head>
  3. <title>Vorbisfile - function - ov_test_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>Vorbisfile documentation</p></td>
  10. <td align=right><p class=tiny>vorbisfile version 1.2.0 - 20070723</p></td>
  11. </tr>
  12. </table>
  13. <h1>ov_test_callbacks</h1>
  14. <p><i>declared in "vorbis/vorbisfile.h";</i></p>
  15. <p>This is an alternative function used to open and test an OggVorbis_File
  16. structure when using a data source other than a file,
  17. when its necessary to modify default file access behavior, or to
  18. test for Vorbis content from a <tt>FILE *</tt> pointer under
  19. Windows where <a href="ov_open.html">ov_test()</a> cannot be used. It
  20. allows the application to specify custom file manipulation routines
  21. and sets up all the related decoding structures.
  22. <p>Once this has been called, the same <tt>OggVorbis_File</tt>
  23. struct should be passed to all the libvorbisfile functions.
  24. <p>
  25. <br><br>
  26. <table border=0 color=black cellspacing=0 cellpadding=7>
  27. <tr bgcolor=#cccccc>
  28. <td>
  29. <pre><b>
  30. int ov_test_callbacks(void *datasource, <a href="OggVorbis_File.html">OggVorbis_File</a> *vf, char *initial, long ibytes, <a href="ov_callbacks.html">ov_callbacks</a> callbacks);
  31. </b></pre>
  32. </td>
  33. </tr>
  34. </table>
  35. <h3>Parameters</h3>
  36. <dl>
  37. <dt><i>f</i></dt>
  38. <dd>File pointer to an already opened file
  39. or pipe (it need not be seekable--though this obviously restricts what
  40. can be done with the bitstream).</dd>
  41. <dt><i>vf</i></dt>
  42. <dd>A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile
  43. functions. Once this has been called, the same <tt>OggVorbis_File</tt>
  44. struct should be passed to all the libvorbisfile functions.</dd>
  45. <dt><i>initial</i></dt>
  46. <dd>Typically set to NULL. This parameter is useful if some data has already been
  47. read from the file and the stream is not seekable. It is used in conjunction with <tt>ibytes</tt>. In this case, <tt>initial</tt>
  48. should be a pointer to a buffer containing the data read.</dd>
  49. <dt><i>ibytes</i></dt>
  50. <dd>Typically set to 0. This parameter is useful if some data has already been
  51. read from the file and the stream is not seekable. In this case, <tt>ibytes</tt>
  52. should contain the length (in bytes) of the buffer. Used together with <tt>initial</tt>.</dd>
  53. <dt><i>callbacks</i></dt>
  54. <dd>A completed <a href="ov_callbacks.html">ov_callbacks</a> struct which indicates desired custom file manipulation routines. vorbisfile.h defines several preprovided callback sets; see <a href="ov_callbacks.html">ov_callbacks</a> for details.</dd>
  55. </dl>
  56. <h3>Return Values</h3>
  57. <blockquote>
  58. <li>0 for success</li>
  59. <li>less than zero for failure:</li>
  60. <ul>
  61. <li>OV_EREAD - A read from media returned an error.</li>
  62. <li>OV_ENOTVORBIS - Bitstream contains no Vorbis data.</li>
  63. <li>OV_EVERSION - Vorbis version mismatch.</li>
  64. <li>OV_EBADHEADER - Invalid Vorbis bitstream header.</li>
  65. <li>OV_EFAULT - Internal logic fault; indicates a bug or heap/stack corruption.</li>
  66. </ul>
  67. </blockquote>
  68. <p>
  69. <h3>Notes</h3>
  70. <dl>
  71. <dt><b>[a] Windows and use as an ov_test() substitute</b><p> Windows
  72. applications should not use <a href="ov_test.html">ov_test()</a> due
  73. to the likelihood of <a href="ov_open.html#winfoot">CRT linking
  74. mismatches and runtime protection faults
  75. [ov_open:a]</a>. ov_test_callbacks() is a safe substitute; specifically:
  76. <pre><tt>ov_test_callbacks(f, vf, initial, ibytes, OV_CALLBACKS_DEFAULT);</tt>
  77. </pre>
  78. ... provides exactly the same functionality as <a
  79. href="ov_test.html">ov_test()</a> but will always work correctly under
  80. Windows, regardless of linking setup details.<p>
  81. </dl>
  82. <br><br>
  83. <hr noshade>
  84. <table border=0 width=100%>
  85. <tr valign=top>
  86. <td><p class=tiny>copyright &copy; 2007 Xiph.org</p></td>
  87. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
  88. </tr><tr>
  89. <td><p class=tiny>Vorbisfile documentation</p></td>
  90. <td align=right><p class=tiny>vorbisfile version 1.2.0 - 20070723</p></td>
  91. </tr>
  92. </table>
  93. </body>
  94. </html>