Main Page   Modules   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

/home/rdbrown/doxygen/cse125g1/ov-win32/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,v 1.1 2005/04/19 17:44:01 rdbrown Exp $
00015 
00016  ********************************************************************/
00017 
00018 #ifndef _OV_FILE_H_
00019 #define _OV_FILE_H_
00020 
00021 #ifdef __cplusplus
00022 extern "C"
00023 {
00024 #endif /* __cplusplus */
00025 
00026 #include <stdio.h>
00027 #include "codec.h"
00028 
00029 /* The function prototypes for the callbacks are basically the same as for
00030  * the stdio functions fread, fseek, fclose, ftell. 
00031  * The one difference is that the FILE * arguments have been replaced with
00032  * a void * - this is to be used as a pointer to whatever internal data these
00033  * functions might need. In the stdio case, it's just a FILE * cast to a void *
00034  * 
00035  * If you use other functions, check the docs for these functions and return
00036  * the right values. For seek_func(), you *MUST* return -1 if the stream is
00037  * unseekable
00038  */
00039 typedef struct {
00040   size_t (*read_func)  (void *ptr, size_t size, size_t nmemb, void *datasource);
00041   int    (*seek_func)  (void *datasource, ogg_int64_t offset, int whence);
00042   int    (*close_func) (void *datasource);
00043   long   (*tell_func)  (void *datasource);
00044 } ov_callbacks;
00045 
00046 #define  NOTOPEN   0
00047 #define  PARTOPEN  1
00048 #define  OPENED    2
00049 #define  STREAMSET 3
00050 #define  INITSET   4
00051 
00052 typedef struct OggVorbis_File {
00053   void            *datasource; /* Pointer to a FILE *, etc. */
00054   int              seekable;
00055   ogg_int64_t      offset;
00056   ogg_int64_t      end;
00057   ogg_sync_state   oy; 
00058 
00059   /* If the FILE handle isn't seekable (eg, a pipe), only the current
00060      stream appears */
00061   int              links;
00062   ogg_int64_t     *offsets;
00063   ogg_int64_t     *dataoffsets;
00064   long            *serialnos;
00065   ogg_int64_t     *pcmlengths; /* overloaded to maintain binary
00066                                   compatability; x2 size, stores both
00067                                   beginning and end values */
00068   vorbis_info     *vi;
00069   vorbis_comment  *vc;
00070 
00071   /* Decoding working state local storage */
00072   ogg_int64_t      pcm_offset;
00073   int              ready_state;
00074   long             current_serialno;
00075   int              current_link;
00076 
00077   double           bittrack;
00078   double           samptrack;
00079 
00080   ogg_stream_state os; /* take physical pages, weld into a logical
00081                           stream of packets */
00082   vorbis_dsp_state vd; /* central working state for the packet->PCM decoder */
00083   vorbis_block     vb; /* local working space for packet->PCM decode */
00084 
00085   ov_callbacks callbacks;
00086 
00087 } OggVorbis_File;
00088 
00089 extern int ov_clear(OggVorbis_File *vf);
00090 extern int ov_open(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
00091 extern int ov_open_callbacks(void *datasource, OggVorbis_File *vf,
00092                 char *initial, long ibytes, ov_callbacks callbacks);
00093 
00094 extern int ov_test(FILE *f,OggVorbis_File *vf,char *initial,long ibytes);
00095 extern int ov_test_callbacks(void *datasource, OggVorbis_File *vf,
00096                 char *initial, long ibytes, ov_callbacks callbacks);
00097 extern int ov_test_open(OggVorbis_File *vf);
00098 
00099 extern long ov_bitrate(OggVorbis_File *vf,int i);
00100 extern long ov_bitrate_instant(OggVorbis_File *vf);
00101 extern long ov_streams(OggVorbis_File *vf);
00102 extern long ov_seekable(OggVorbis_File *vf);
00103 extern long ov_serialnumber(OggVorbis_File *vf,int i);
00104 
00105 extern ogg_int64_t ov_raw_total(OggVorbis_File *vf,int i);
00106 extern ogg_int64_t ov_pcm_total(OggVorbis_File *vf,int i);
00107 extern double ov_time_total(OggVorbis_File *vf,int i);
00108 
00109 extern int ov_raw_seek(OggVorbis_File *vf,ogg_int64_t pos);
00110 extern int ov_pcm_seek(OggVorbis_File *vf,ogg_int64_t pos);
00111 extern int ov_pcm_seek_page(OggVorbis_File *vf,ogg_int64_t pos);
00112 extern int ov_time_seek(OggVorbis_File *vf,double pos);
00113 extern int ov_time_seek_page(OggVorbis_File *vf,double pos);
00114 
00115 extern int ov_raw_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
00116 extern int ov_pcm_seek_lap(OggVorbis_File *vf,ogg_int64_t pos);
00117 extern int ov_pcm_seek_page_lap(OggVorbis_File *vf,ogg_int64_t pos);
00118 extern int ov_time_seek_lap(OggVorbis_File *vf,double pos);
00119 extern int ov_time_seek_page_lap(OggVorbis_File *vf,double pos);
00120 
00121 extern ogg_int64_t ov_raw_tell(OggVorbis_File *vf);
00122 extern ogg_int64_t ov_pcm_tell(OggVorbis_File *vf);
00123 extern double ov_time_tell(OggVorbis_File *vf);
00124 
00125 extern vorbis_info *ov_info(OggVorbis_File *vf,int link);
00126 extern vorbis_comment *ov_comment(OggVorbis_File *vf,int link);
00127 
00128 extern long ov_read_float(OggVorbis_File *vf,float ***pcm_channels,int samples,
00129                           int *bitstream);
00130 extern long ov_read(OggVorbis_File *vf,char *buffer,int length,
00131                     int bigendianp,int word,int sgned,int *bitstream);
00132 extern int ov_crosslap(OggVorbis_File *vf1,OggVorbis_File *vf2);
00133 
00134 extern int ov_halfrate(OggVorbis_File *vf,int flag);
00135 extern int ov_halfrate_p(OggVorbis_File *vf);
00136 
00137 #ifdef __cplusplus
00138 }
00139 #endif /* __cplusplus */
00140 
00141 #endif
00142 
00143 

Generated on Thu Aug 18 16:03:07 2005 for Robin Hood: Thieves & Knights by doxygen1.2.18