1 /******************************************************************** 2 * * 3 * THIS FILE IS PART OF THE OggVorbis 'TREMOR' CODEC SOURCE CODE. * 4 * * 5 * USE, DISTRIBUTION AND REPRODUCTION OF THIS LIBRARY SOURCE IS * 6 * GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE * 7 * IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. * 8 * * 9 * THE OggVorbis 'TREMOR' SOURCE CODE IS (C) COPYRIGHT 1994-2002 * 10 * BY THE Xiph.Org FOUNDATION http://www.xiph.org/ * 11 * * 12 ******************************************************************** 13 14 function: libvorbis codec headers 15 16 ********************************************************************/ 17 18 #ifndef _vorbis_codec_h_ 19 #define _vorbis_codec_h_ 20 21 #ifdef __cplusplus 22 extern "C" 23 { 24 #endif /* __cplusplus */ 25 26 #include "ogg.h" 27 28 struct vorbis_dsp_state; 29 typedef struct vorbis_dsp_state vorbis_dsp_state; 30 31 typedef struct vorbis_info{ 32 int version; 33 int channels; 34 long rate; 35 36 /* The below bitrate declarations are *hints*. 37 Combinations of the three values carry the following implications: 38 39 all three set to the same value: 40 implies a fixed rate bitstream 41 only nominal set: 42 implies a VBR stream that averages the nominal bitrate. No hard 43 upper/lower limit 44 upper and or lower set: 45 implies a VBR bitstream that obeys the bitrate limits. nominal 46 may also be set to give a nominal rate. 47 none set: 48 the coder does not care to speculate. 49 */ 50 51 long bitrate_upper; 52 long bitrate_nominal; 53 long bitrate_lower; 54 long bitrate_window; 55 56 void *codec_setup; 57 } vorbis_info; 58 59 typedef struct vorbis_comment{ 60 char **user_comments; 61 int *comment_lengths; 62 int comments; 63 char *vendor; 64 65 } vorbis_comment; 66 67 68 /* Vorbis PRIMITIVES: general ***************************************/ 69 70 extern void vorbis_info_init(vorbis_info *vi); 71 extern void vorbis_info_clear(vorbis_info *vi); 72 extern int vorbis_info_blocksize(vorbis_info *vi,int zo); 73 extern void vorbis_comment_init(vorbis_comment *vc); 74 extern void vorbis_comment_add(vorbis_comment *vc, char *comment); 75 extern void vorbis_comment_add_tag(vorbis_comment *vc, 76 char *tag, char *contents); 77 extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count); 78 extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag); 79 extern void vorbis_comment_clear(vorbis_comment *vc); 80 81 /* Vorbis ERRORS and return codes ***********************************/ 82 83 #define OV_FALSE -1 84 #define OV_EOF -2 85 #define OV_HOLE -3 86 87 #define OV_EREAD -128 88 #define OV_EFAULT -129 89 #define OV_EIMPL -130 90 #define OV_EINVAL -131 91 #define OV_ENOTVORBIS -132 92 #define OV_EBADHEADER -133 93 #define OV_EVERSION -134 94 #define OV_ENOTAUDIO -135 95 #define OV_EBADPACKET -136 96 #define OV_EBADLINK -137 97 #define OV_ENOSEEK -138 98 99 #ifdef __cplusplus 100 } 101 #endif /* __cplusplus */ 102 103 #endif 104 105