OggVorbis_File.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <html>
  2. <head>
  3. <title>Vorbisfile - datatype - OggVorbis_File</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>OggVorbis_File</h1>
  14. <p><i>declared in "vorbis/vorbisfile.h"</i></p>
  15. <p>
  16. The OggVorbis_File structure defines an Ogg Vorbis file.
  17. <p>
  18. This structure is used in all libvorbisfile routines. Before it can
  19. be used, it must be initialized by <a
  20. href="ov_open.html">ov_open()</a>, <a
  21. href="ov_fopen.html">ov_fopen()</a>, or <a
  22. href="ov_open_callbacks.html">ov_open_callbacks()</a>. <em>Important
  23. Note:</em> The use of <a href="ov_open.html">ov_open()</a> is
  24. discouraged under Windows due to a peculiarity of Windows linking
  25. convention; use <a href="ov_fopen.html">ov_fopen()</a> or <a
  26. href="ov_open_callbacks.html">ov_open_callbacks()</a> instead. This
  27. caution only applies to Windows; use of <a
  28. href="ov_open.html">ov_open()</a> is appropriate for all other
  29. platforms. See the <a href="ov_open.html">ov_open()</a> page for more
  30. information.
  31. <p>
  32. After use, the OggVorbis_File structure must be deallocated with a
  33. call to <a href="ov_clear.html">ov_clear()</a>.
  34. <p>
  35. Note that once a file handle is passed to a successful <a
  36. href="ov_open.html">ov_open()</a> call, the handle is owned by
  37. libvorbisfile and will be closed by libvorbisfile later during the
  38. call to <a href="ov_clear.html">ov_clear()</a>. The handle should not
  39. be used or closed outside of the libvorbisfile API. Similarly, files
  40. opened by <a href="ov_fopen.html">ov_fopen()</a> will also be closed
  41. internally by vorbisfile in <a href="ov_clear.html">ov_clear()</a>.<p>
  42. <a href="ov_open_callbacks.html">ov_open_callbacks()</a> allows the
  43. application to choose whether libvorbisfile will or will not close the
  44. handle in <a href="ov_clear.html">ov_clear()</a>; see the <a
  45. href="ov_open_callbacks.html">ov_open_callbacks()</a> page for more information.<p>
  46. If a call to <a href="ov_open.html">ov_open()</a> or <a
  47. href="ov_open_callbacks.html">ov_open_callbacks()</a> <b>fails</b>,
  48. libvorbisfile does <b>not</b> assume ownership of the handle and the
  49. application is expected to close it if necessary. A failed <a
  50. href="ov_fopen.html">ov_fopen()</a> call will internally close the
  51. file handle if the open process fails.<p>
  52. <br><br>
  53. <table border=0 width=100% color=black cellspacing=0 cellpadding=7>
  54. <tr bgcolor=#cccccc>
  55. <td>
  56. <pre><b>typedef struct {
  57. void *datasource; /* Pointer to a FILE *, etc. */
  58. int seekable;
  59. ogg_int64_t offset;
  60. ogg_int64_t end;
  61. ogg_sync_state oy;
  62. /* If the FILE handle isn't seekable (eg, a pipe), only the current
  63. stream appears */
  64. int links;
  65. ogg_int64_t *offsets;
  66. ogg_int64_t *dataoffsets;
  67. long *serialnos;
  68. ogg_int64_t *pcmlengths;
  69. vorbis_info *vi;
  70. vorbis_comment *vc;
  71. /* Decoding working state local storage */
  72. ogg_int64_t pcm_offset;
  73. int ready_state;
  74. long current_serialno;
  75. int current_link;
  76. ogg_int64_t bittrack;
  77. ogg_int64_t samptrack;
  78. ogg_stream_state os; /* take physical pages, weld into a logical
  79. stream of packets */
  80. vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
  81. vorbis_block vb; /* local working space for packet->PCM decode */
  82. <a href="ov_callbacks.html">ov_callbacks</a> callbacks;
  83. } OggVorbis_File;</b></pre>
  84. </td>
  85. </tr>
  86. </table>
  87. <h3>Relevant Struct Members</h3>
  88. <dl>
  89. <dt><i>datasource</i></dt>
  90. <dd>Pointer to file or other ogg source. When using stdio based
  91. file/stream access, this field contains a <tt>FILE</tt> pointer. When using
  92. custom IO via callbacks, libvorbisfile treats this void pointer as a
  93. black box only to be passed to the callback routines provided by the
  94. application.</dd>
  95. <dt><i>seekable</i></dt>
  96. <dd>Read-only int indicating whether file is seekable. E.g., a physical file is seekable, a pipe isn't.</dd>
  97. <dt><i>links</i></dt>
  98. <dd>Read-only int indicating the number of logical bitstreams within the physical bitstream.</dd>
  99. <dt><i>ov_callbacks</i></dt>
  100. <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>
  101. </dl>
  102. <br><br>
  103. <hr noshade>
  104. <table border=0 width=100%>
  105. <tr valign=top>
  106. <td><p class=tiny>copyright &copy; 2007 Xiph.org</p></td>
  107. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
  108. </tr><tr>
  109. <td><p class=tiny>Vorbisfile documentation</p></td>
  110. <td align=right><p class=tiny>vorbisfile version 1.2.0 - 20070723</p></td>
  111. </tr>
  112. </table>
  113. </body>
  114. </html>