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