OggVorbis_File.html 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <html>
  2. <head>
  3. <title>Tremor - 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>Tremor documentation</p></td>
  10. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  11. </tr>
  12. </table>
  13. <h1>OggVorbis_File</h1>
  14. <p><i>declared in "ivorbisfile.h"</i></p>
  15. <p>
  16. The OggVorbis_File structure defines an Ogg Vorbis file.
  17. <p>
  18. This structure is used in all libvorbisidec routines. Before it can be used,
  19. it must be initialized by <a href="ov_open.html">ov_open()</a> or <a
  20. href="ov_open_callbacks.html">ov_open_callbacks()</a>.
  21. <p>
  22. After use, the OggVorbis_File structure must be deallocated with a
  23. call to <a href="ov_clear.html">ov_clear()</a>.
  24. <p>
  25. Once a file or data source is opened successfully by libvorbisidec
  26. (using <a href="ov_open.html">ov_open()</a> or <a
  27. href="ov_open_callbacks.html">ov_open_callbacks()</a>), it is owned by
  28. libvorbisidec. The file should not be used by any other applications or
  29. functions outside of the libvorbisidec API. The file must not be closed
  30. directly by the application at any time after a successful open;
  31. libvorbisidec expects to close the file within <a
  32. href="ov_clear.html">ov_clear()</a>.
  33. <p>
  34. If the call to <a href="ov_open.html">ov_open()</a> or <a
  35. href="ov_open_callbacks.html">ov_open_callbacks()</a> <b>fails</b>,
  36. libvorbisidec does <b>not</b> assume ownership of the file and the
  37. application is expected to close it if necessary.
  38. <br><br>
  39. <table border=0 width=100% color=black cellspacing=0 cellpadding=7>
  40. <tr bgcolor=#cccccc>
  41. <td>
  42. <pre><b>typedef struct {
  43. void *datasource; /* Pointer to a FILE *, etc. */
  44. int seekable;
  45. ogg_int64_t offset;
  46. ogg_int64_t end;
  47. ogg_sync_state oy;
  48. /* If the FILE handle isn't seekable (eg, a pipe), only the current
  49. stream appears */
  50. int links;
  51. ogg_int64_t *offsets;
  52. ogg_int64_t *dataoffsets;
  53. long *serialnos;
  54. ogg_int64_t *pcmlengths;
  55. vorbis_info *vi;
  56. vorbis_comment *vc;
  57. /* Decoding working state local storage */
  58. ogg_int64_t pcm_offset;
  59. int ready_state;
  60. long current_serialno;
  61. int current_link;
  62. ogg_int64_t bittrack;
  63. ogg_int64_t samptrack;
  64. ogg_stream_state os; /* take physical pages, weld into a logical
  65. stream of packets */
  66. vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
  67. vorbis_block vb; /* local working space for packet->PCM decode */
  68. <a href="ov_callbacks.html">ov_callbacks</a> callbacks;
  69. } OggVorbis_File;</b></pre>
  70. </td>
  71. </tr>
  72. </table>
  73. <h3>Relevant Struct Members</h3>
  74. <dl>
  75. <dt><i>datasource</i></dt>
  76. <dd>Pointer to file or other ogg source. When using stdio based
  77. file/stream access, this field contains a <tt>FILE</tt> pointer. When using
  78. custom IO via callbacks, libvorbisidec treats this void pointer as a
  79. black box only to be passed to the callback routines provided by the
  80. application.</dd>
  81. <dt><i>seekable</i></dt>
  82. <dd>Read-only int indicating whether file is seekable. E.g., a physical file is seekable, a pipe isn't.</dd>
  83. <dt><i>links</i></dt>
  84. <dd>Read-only int indicating the number of logical bitstreams within the physical bitstream.</dd>
  85. <dt><i>ov_callbacks</i></dt>
  86. <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>
  87. </dl>
  88. <h3>Notes</h3>
  89. <p>Tremor requires a native 64 bit integer type to compile and
  90. function; The GNU build system will locate and typedef
  91. <tt>ogg_int64_t</tt> to the appropriate native type. If not using the
  92. GNU build tools, you will need to define <tt>ogg_int64_t</tt> as a
  93. 64-bit type inside your system's project file/Makefile, etc. On win32,
  94. for example, this should be defined as <tt>__int64</tt>.
  95. <p>
  96. <br><br>
  97. <hr noshade>
  98. <table border=0 width=100%>
  99. <tr valign=top>
  100. <td><p class=tiny>copyright &copy; 2002 Xiph.org</p></td>
  101. <td align=right><p class=tiny><a href="http://www.xiph.org/ogg/vorbis/">Ogg Vorbis</a></p></td>
  102. </tr><tr>
  103. <td><p class=tiny>Tremor documentation</p></td>
  104. <td align=right><p class=tiny>Tremor version 1.0 - 20020403</p></td>
  105. </tr>
  106. </table>
  107. </body>
  108. </html>