ivorbiscodec.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. /************************************************************************
  2. * Copyright (C) 2002-2009, Xiph.org Foundation
  3. * Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. *
  10. * * Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * * Redistributions in binary form must reproduce the above
  13. * copyright notice, this list of conditions and the following disclaimer
  14. * in the documentation and/or other materials provided with the
  15. * distribution.
  16. * * Neither the names of the Xiph.org Foundation nor Pinknoise
  17. * Productions Ltd nor the names of its contributors may be used to
  18. * endorse or promote products derived from this software without
  19. * specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  24. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  25. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  26. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  27. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  28. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  29. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  30. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  31. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  32. ************************************************************************
  33. function: libvorbis codec headers
  34. ************************************************************************/
  35. #ifndef _vorbis_codec_h_
  36. #define _vorbis_codec_h_
  37. #ifdef __cplusplus
  38. extern "C"
  39. {
  40. #endif /* __cplusplus */
  41. #include "ogg.h"
  42. struct vorbis_dsp_state;
  43. typedef struct vorbis_dsp_state vorbis_dsp_state;
  44. typedef struct vorbis_info{
  45. int version;
  46. int channels;
  47. long rate;
  48. /* The below bitrate declarations are *hints*.
  49. Combinations of the three values carry the following implications:
  50. all three set to the same value:
  51. implies a fixed rate bitstream
  52. only nominal set:
  53. implies a VBR stream that averages the nominal bitrate. No hard
  54. upper/lower limit
  55. upper and or lower set:
  56. implies a VBR bitstream that obeys the bitrate limits. nominal
  57. may also be set to give a nominal rate.
  58. none set:
  59. the coder does not care to speculate.
  60. */
  61. long bitrate_upper;
  62. long bitrate_nominal;
  63. long bitrate_lower;
  64. long bitrate_window;
  65. void *codec_setup;
  66. } vorbis_info;
  67. typedef struct vorbis_comment{
  68. char **user_comments;
  69. int *comment_lengths;
  70. int comments;
  71. char *vendor;
  72. } vorbis_comment;
  73. /* Vorbis PRIMITIVES: general ***************************************/
  74. extern void vorbis_info_init(vorbis_info *vi);
  75. extern void vorbis_info_clear(vorbis_info *vi);
  76. extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
  77. extern void vorbis_comment_init(vorbis_comment *vc);
  78. extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
  79. extern void vorbis_comment_add_tag(vorbis_comment *vc,
  80. char *tag, char *contents);
  81. extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
  82. extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
  83. extern void vorbis_comment_clear(vorbis_comment *vc);
  84. /* Vorbis ERRORS and return codes ***********************************/
  85. #define OV_FALSE -1
  86. #define OV_EOF -2
  87. #define OV_HOLE -3
  88. #define OV_EREAD -128
  89. #define OV_EFAULT -129
  90. #define OV_EIMPL -130
  91. #define OV_EINVAL -131
  92. #define OV_ENOTVORBIS -132
  93. #define OV_EBADHEADER -133
  94. #define OV_EVERSION -134
  95. #define OV_ENOTAUDIO -135
  96. #define OV_EBADPACKET -136
  97. #define OV_EBADLINK -137
  98. #define OV_ENOSEEK -138
  99. #ifdef __cplusplus
  100. }
  101. #endif /* __cplusplus */
  102. #endif