ivorbiscodec.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. function: libvorbis codec headers
  14. ********************************************************************/
  15. #ifndef _vorbis_codec_h_
  16. #define _vorbis_codec_h_
  17. #ifdef __cplusplus
  18. extern "C"
  19. {
  20. #endif /* __cplusplus */
  21. #include "ogg.h"
  22. struct vorbis_dsp_state;
  23. typedef struct vorbis_dsp_state vorbis_dsp_state;
  24. typedef struct vorbis_info{
  25. int version;
  26. int channels;
  27. long rate;
  28. /* The below bitrate declarations are *hints*.
  29. Combinations of the three values carry the following implications:
  30. all three set to the same value:
  31. implies a fixed rate bitstream
  32. only nominal set:
  33. implies a VBR stream that averages the nominal bitrate. No hard
  34. upper/lower limit
  35. upper and or lower set:
  36. implies a VBR bitstream that obeys the bitrate limits. nominal
  37. may also be set to give a nominal rate.
  38. none set:
  39. the coder does not care to speculate.
  40. */
  41. long bitrate_upper;
  42. long bitrate_nominal;
  43. long bitrate_lower;
  44. long bitrate_window;
  45. void *codec_setup;
  46. } vorbis_info;
  47. typedef struct vorbis_comment{
  48. char **user_comments;
  49. int *comment_lengths;
  50. int comments;
  51. char *vendor;
  52. } vorbis_comment;
  53. /* Vorbis PRIMITIVES: general ***************************************/
  54. extern void vorbis_info_init(vorbis_info *vi);
  55. extern void vorbis_info_clear(vorbis_info *vi);
  56. extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
  57. extern void vorbis_comment_init(vorbis_comment *vc);
  58. extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
  59. extern void vorbis_comment_add_tag(vorbis_comment *vc,
  60. char *tag, char *contents);
  61. extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
  62. extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
  63. extern void vorbis_comment_clear(vorbis_comment *vc);
  64. /* Vorbis ERRORS and return codes ***********************************/
  65. #define OV_FALSE -1
  66. #define OV_EOF -2
  67. #define OV_HOLE -3
  68. #define OV_EREAD -128
  69. #define OV_EFAULT -129
  70. #define OV_EIMPL -130
  71. #define OV_EINVAL -131
  72. #define OV_ENOTVORBIS -132
  73. #define OV_EBADHEADER -133
  74. #define OV_EVERSION -134
  75. #define OV_ENOTAUDIO -135
  76. #define OV_EBADPACKET -136
  77. #define OV_EBADLINK -137
  78. #define OV_ENOSEEK -138
  79. #ifdef __cplusplus
  80. }
  81. #endif /* __cplusplus */
  82. #endif