annotate src/libvorbis-1.3.3/doc/vorbisfile/ov_fopen.html @ 86:98c1576536ae

Bring in flac, ogg, vorbis
author Chris Cannam <cannam@all-day-breakfast.com>
date Tue, 19 Mar 2013 17:37:49 +0000
parents
children
rev   line source
cannam@86 1 <html>
cannam@86 2
cannam@86 3 <head>
cannam@86 4 <title>Vorbisfile - function - ov_fopen</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_fopen</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 the simplest function used to open and initialize an OggVorbis_File
cannam@86 21 structure. It sets up all the related decoding structure.
cannam@86 22 <p>The first argument is a file path suitable
cannam@86 23 for passing to fopen(). <tt>vf</tt> should be a pointer to an empty
cannam@86 24 OggVorbis_File structure -- this is used for ALL the externally visible
cannam@86 25 libvorbisfile functions. Once this has been called, the same <a
cannam@86 26 href="OggVorbis_File.html">OggVorbis_File</a> struct should be passed
cannam@86 27 to all the libvorbisfile functions.
cannam@86 28 <p>The <tt>vf</tt> structure initialized using ov_fopen() must
cannam@86 29 eventually be cleaned using <a href="ov_clear.html">ov_clear()</a>.
cannam@86 30
cannam@86 31 <p>
cannam@86 32 It is often useful to call <tt>ov_fopen()</tt> simply to determine
cannam@86 33 whether a given file is a Vorbis bitstream. If the <tt>ov_fopen()</tt>
cannam@86 34 call fails, then the file is either inaccessable (errno is set) or not
cannam@86 35 recognizable as Vorbis (errno unchanged). If the call succeeds but
cannam@86 36 the initialized <tt>vf</tt> structure will not be used, the
cannam@86 37 application is responsible for calling <a
cannam@86 38 href="ov_clear.html">ov_clear()</a> to clear the decoder's buffers and
cannam@86 39 close the file.<p>
cannam@86 40
cannam@86 41 <br><br>
cannam@86 42 <table border=0 color=black cellspacing=0 cellpadding=7>
cannam@86 43 <tr bgcolor=#cccccc>
cannam@86 44 <td>
cannam@86 45 <pre><b>
cannam@86 46 int ov_fopen(char *path,<a href="OggVorbis_File.html">OggVorbis_File</a> *vf);
cannam@86 47 </b></pre>
cannam@86 48 </td>
cannam@86 49 </tr>
cannam@86 50 </table>
cannam@86 51
cannam@86 52 <h3>Parameters</h3>
cannam@86 53 <dl>
cannam@86 54 <dt><i>path</i></dt>
cannam@86 55 <dd>Null terminated string containing a file path suitable for passing to <tt>fopen()</tt>.
cannam@86 56 </dd>
cannam@86 57 <dt><i>vf</i></dt>
cannam@86 58 <dd>A pointer to the OggVorbis_File structure--this is used for ALL the externally visible libvorbisfile
cannam@86 59 functions. Once this has been called, the same <tt>OggVorbis_File</tt>
cannam@86 60 struct should be passed to all the libvorbisfile functions.</dd>
cannam@86 61 </dl>
cannam@86 62
cannam@86 63
cannam@86 64 <h3>Return Values</h3>
cannam@86 65 <blockquote>
cannam@86 66 <li>0 indicates success</li>
cannam@86 67
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 does not contain any 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] Threaded decode</b><p>
cannam@86 83 <dd>If your decoder is threaded, it is recommended that you NOT call
cannam@86 84 <tt>ov_open_callbacks()</tt>
cannam@86 85 in the main control thread--instead, call <tt>ov_open_callbacks()</tt> in your decode/playback
cannam@86 86 thread. This is important because <tt>ov_open_callbacks()</tt> may be a fairly time-consuming
cannam@86 87 call, given that the full structure of the file is determined at this point,
cannam@86 88 which may require reading large parts of the file under certain circumstances
cannam@86 89 (determining all the logical bitstreams in one physical bitstream, for
cannam@86 90 example). See <a href="threads.html">Thread Safety</a> for other information on using libvorbisfile with threads.
cannam@86 91 <p>
cannam@86 92
cannam@86 93 <dt><b>[b] Mixed media streams</b><p>
cannam@86 94 <dd>
cannam@86 95 As of Vorbisfile release 1.2.0, Vorbisfile is able to access the
cannam@86 96 Vorbis content in mixed-media Ogg streams, not just Vorbis-only
cannam@86 97 streams. For example, Vorbisfile may be used to open and access the
cannam@86 98 audio from an Ogg stream consisting of Theora video and Vorbis audio.
cannam@86 99 Vorbisfile 1.2.0 decodes the first logical audio stream of each
cannam@86 100 physical stream section.<p>
cannam@86 101
cannam@86 102 <dt><b>[c] Faster testing for Vorbis files</b><p>
cannam@86 103 <dd><a href="ov_test.html">ov_test()</a> and <a
cannam@86 104 href="ov_test_callbacks.html">ov_test_callbacks()</a> provide less
cannam@86 105 computationally expensive ways to test a file for Vorbisness, but
cannam@86 106 require more setup code.<p>
cannam@86 107
cannam@86 108 </dl>
cannam@86 109
cannam@86 110 <br><br>
cannam@86 111 <hr noshade>
cannam@86 112 <table border=0 width=100%>
cannam@86 113 <tr valign=top>
cannam@86 114 <td><p class=tiny>copyright &copy; 2000-2010 Xiph.Org</p></td>
cannam@86 115 <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
cannam@86 116 </tr><tr>
cannam@86 117 <td><p class=tiny>Vorbisfile documentation</p></td>
cannam@86 118 <td align=right><p class=tiny>vorbisfile version 1.3.2 - 20101101</p></td>
cannam@86 119 </tr>
cannam@86 120 </table>
cannam@86 121
cannam@86 122 </body>
cannam@86 123
cannam@86 124 </html>