4 <title>Vorbisfile - datatype - OggVorbis_File</title>
5 <link rel=stylesheet href="style.css" type="text/css">
8 <body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
9 <table border=0 width=100%>
11 <td><p class=tiny>Vorbisfile documentation</p></td>
12 <td align=right><p class=tiny>vorbisfile version 1.2.0 - 20070723</p></td>
16 <h1>OggVorbis_File</h1>
18 <p><i>declared in "vorbis/vorbisfile.h"</i></p>
21 The OggVorbis_File structure defines an Ogg Vorbis file.
24 This structure is used in all libvorbisfile routines. Before it can
25 be used, it must be initialized by <a
26 href="ov_open.html">ov_open()</a>, <a
27 href="ov_fopen.html">ov_fopen()</a>, or <a
28 href="ov_open_callbacks.html">ov_open_callbacks()</a>. <em>Important
29 Note:</em> The use of <a href="ov_open.html">ov_open()</a> is
30 discouraged under Windows due to a peculiarity of Windows linking
31 convention; use <a href="ov_fopen.html">ov_fopen()</a> or <a
32 href="ov_open_callbacks.html">ov_open_callbacks()</a> instead. This
33 caution only applies to Windows; use of <a
34 href="ov_open.html">ov_open()</a> is appropriate for all other
35 platforms. See the <a href="ov_open.html">ov_open()</a> page for more
39 After use, the OggVorbis_File structure must be deallocated with a
40 call to <a href="ov_clear.html">ov_clear()</a>.
43 Note that once a file handle is passed to a successful <a
44 href="ov_open.html">ov_open()</a> call, the handle is owned by
45 libvorbisfile and will be closed by libvorbisfile later during the
46 call to <a href="ov_clear.html">ov_clear()</a>. The handle should not
47 be used or closed outside of the libvorbisfile API. Similarly, files
48 opened by <a href="ov_fopen.html">ov_fopen()</a> will also be closed
49 internally by vorbisfile in <a href="ov_clear.html">ov_clear()</a>.<p>
51 <a href="ov_open_callbacks.html">ov_open_callbacks()</a> allows the
52 application to choose whether libvorbisfile will or will not close the
53 handle in <a href="ov_clear.html">ov_clear()</a>; see the <a
54 href="ov_open_callbacks.html">ov_open_callbacks()</a> page for more information.<p>
56 If a call to <a href="ov_open.html">ov_open()</a> or <a
57 href="ov_open_callbacks.html">ov_open_callbacks()</a> <b>fails</b>,
58 libvorbisfile does <b>not</b> assume ownership of the handle and the
59 application is expected to close it if necessary. A failed <a
60 href="ov_fopen.html">ov_fopen()</a> call will internally close the
61 file handle if the open process fails.<p>
64 <table border=0 width=100% color=black cellspacing=0 cellpadding=7>
67 <pre><b>typedef struct {
68 void *datasource; /* Pointer to a FILE *, etc. */
74 /* If the FILE handle isn't seekable (eg, a pipe), only the current
78 ogg_int64_t *dataoffsets;
80 ogg_int64_t *pcmlengths;
84 /* Decoding working state local storage */
85 ogg_int64_t pcm_offset;
87 long current_serialno;
91 ogg_int64_t samptrack;
93 ogg_stream_state os; /* take physical pages, weld into a logical
95 vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
96 vorbis_block vb; /* local working space for packet->PCM decode */
98 <a href="ov_callbacks.html">ov_callbacks</a> callbacks;
100 } OggVorbis_File;</b></pre>
105 <h3>Relevant Struct Members</h3>
107 <dt><i>datasource</i></dt>
109 <dd>Pointer to file or other ogg source. When using stdio based
110 file/stream access, this field contains a <tt>FILE</tt> pointer. When using
111 custom IO via callbacks, libvorbisfile treats this void pointer as a
112 black box only to be passed to the callback routines provided by the
115 <dt><i>seekable</i></dt>
116 <dd>Read-only int indicating whether file is seekable. E.g., a physical file is seekable, a pipe isn't.</dd>
117 <dt><i>links</i></dt>
118 <dd>Read-only int indicating the number of logical bitstreams within the physical bitstream.</dd>
\r
119 <dt><i>ov_callbacks</i></dt>
\r
120 <dd>Collection of file manipulation routines to be used on this data source. When using stdio/FILE access via <a href="ov_open.html">ov_open()</a>, the callbacks will be filled in with stdio calls or wrappers to stdio calls.</dd>
125 <table border=0 width=100%>
127 <td><p class=tiny>copyright © 2007 Xiph.org</p></td>
128 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
130 <td><p class=tiny>Vorbisfile documentation</p></td>
131 <td align=right><p class=tiny>vorbisfile version 1.2.0 - 20070723</p></td>