examples/sfexamples/oggvorbiscodec/src/libvorbis/include/vorbis/vorbisfile.h

00001 /********************************************************************
00002  *                                                                  *
00003  * THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE.   *
00004  * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS     *
00005  * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
00006  * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING.       *
00007  *                                                                  *
00008  * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2001             *
00009  * by the XIPHOPHORUS Company http://www.xiph.org/                  *
00010  *                                                                  *
00011  ********************************************************************
00012 
00013  function: stdio-based convenience library for opening/seeking/decoding
00014  last mod: $Id: vorbisfile.h 7485 2004-08-05 14:54:23Z thomasvs $
00015 
00016  ********************************************************************/
00017 
00018 #ifndef _OV_FILE_H_
00019 #define _OV_FILE_H_
00020 
00021 #ifndef __SYMBIAN32__
00022 # define IMPORT_C extern
00023 # define EXPORT_C
00024 #else
00025 # ifndef __cplusplus
00026 #ifndef __X86GCC__
00027 #  undef IMPORT_C
00028 #  define IMPORT_C __declspec(dllexport)
00029 #  define EXPORT_C __declspec(dllexport)
00030 # endif
00031 # endif
00032 #endif
00033 #ifdef __cplusplus
00034 extern "C"
00035 {
00036 #endif /* __cplusplus */
00037 
00038 #include <stdio.h>
00039 #include "vorbis\codec.h"
00040 
00041 /* The function prototypes for the callbacks are basically the same as for
00042  * the stdio functions fread, fseek, fclose, ftell.
00043  * The one difference is that the FILE * arguments have been replaced with
00044  * a void * - this is to be used as a pointer to whatever internal data these
00045  * functions might need. In the stdio case, it's just a FILE * cast to a void *
00046  *
00047  * If you use other functions, check the docs for these functions and return
00048  * the right values. For seek_func(), you *MUST* return -1 if the stream is
00049  * unseekable
00050  */
00051 typedef struct {
00052   size_t (*read_func)  (void *ptr, size_t size, size_t nmemb, void *datasource);
00053   int    (*seek_func)  (void *datasource, ogg_int64_t offset, int whence);
00054   int    (*close_func) (void *datasource);
00055   long   (*tell_func)  (void *datasource);
00056 } ov_callbacks;
00057 
00058 #define  NOTOPEN   0
00059 #define  PARTOPEN  1
00060 #define  OPENED    2
00061 #define  STREAMSET 3
00062 #define  INITSET   4
00063 
00064 typedef struct OggVorbis_File {
00065   void            *datasource; /* Pointer to a FILE *, etc. */
00066   int              seekable;
00067   ogg_int64_t      offset;
00068   ogg_int64_t      end;
00069   ogg_sync_state   oy;
00070 
00071   /* If the FILE handle isn't seekable (eg, a pipe), only the current
00072      stream appears */
00073   int              links;
00074   ogg_int64_t     *offsets;
00075   ogg_int64_t     *dataoffsets;
00076   long            *serialnos;
00077   ogg_int64_t     *pcmlengths; /* overloaded to maintain binary
00078                                   compatability; x2 size, stores both
00079                                   beginning and end values */
00080   vorbis_info     *vi;
00081   vorbis_comment  *vc;
00082 
00083   /* Decoding working state local storage */
00084   ogg_int64_t      pcm_offset;
00085   int              ready_state;
00086   long             current_serialno;
00087   int              current_link;
00088 
00089   double           bittrack;
00090   double           samptrack;
00091 
00092   ogg_stream_state os; /* take physical pages, weld into a logical
00093                           stream of packets */
00094   vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
00095   vorbis_block     vb; /* local working space for packet->PCM decode */
00096 
00097   ov_callbacks callbacks;
00098 
00099 } OggVorbis_File;
00100 
00101 IMPORT_C int ov_clear(OggVorbis_File *vf);
00102 IMPORT_C int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
00103 IMPORT_C int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
00104                 char *initial, long ibytes, ov_callbacks callbacks);
00105 
00106 IMPORT_C int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
00107 IMPORT_C int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
00108                 char *initial, long ibytes, ov_callbacks callbacks);
00109 IMPORT_C int ov_test_open(OggVorbis_File *vf);
00110 
00111 IMPORT_C long ov_bitrate(OggVorbis_File *vf,int i);
00112 IMPORT_C long ov_bitrate_instant(OggVorbis_File *vf);
00113 IMPORT_C long ov_streams(OggVorbis_File *vf);
00114 IMPORT_C long ov_seekable(OggVorbis_File *vf);
00115 IMPORT_C long ov_serialnumber(OggVorbis_File *vf,int i);
00116 
00117 IMPORT_C ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
00118 IMPORT_C ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
00119 IMPORT_C double ov_time_total(OggVorbis_File *vf,int i);
00120 
00121 IMPORT_C int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
00122 IMPORT_C int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
00123 IMPORT_C int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
00124 IMPORT_C int ov_time_seek(OggVorbis_File *vf,double pos);
00125 IMPORT_C int ov_time_seek_page(OggVorbis_File *vf,double pos);
00126 
00127 IMPORT_C int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
00128 IMPORT_C int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
00129 IMPORT_C int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
00130 IMPORT_C int ov_time_seek_lap(OggVorbis_File *vf,double pos);
00131 IMPORT_C int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
00132 
00133 IMPORT_C ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
00134 IMPORT_C ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
00135 IMPORT_C double ov_time_tell(OggVorbis_File *vf);
00136 
00137 IMPORT_C vorbis_info *ov_info(OggVorbis_File *vf,int link);
00138 IMPORT_C vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
00139 
00140 IMPORT_C long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
00141                           int *bitstream);
00142 IMPORT_C long ov_read(OggVorbis_File *vf,char *buffer,int length,
00143                     int bigendianp,int word,int sgned,int *bitstream);
00144 IMPORT_C int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
00145 
00146 IMPORT_C int ov_halfrate(OggVorbis_File *vf,int flag);
00147 IMPORT_C int ov_halfrate_p(OggVorbis_File *vf);
00148 
00149 #ifdef __cplusplus
00150 }
00151 #endif /* __cplusplus */
00152 
00153 #endif
00154 
00155 

Generated by  doxygen 1.6.2