blob: 5d1bf950b010f11dbe4a6c575a5210de13a10ed8 [file] [log] [blame]
Gloria Wang37fe1582010-03-12 14:53:20 -08001/************************************************************************
Gloria Wang2da723a2010-03-18 15:56:16 -07002 * Copyright (C) 2002-2009, Xiph.org Foundation
3 * Copyright (C) 2010, Robin Watts for Pinknoise Productions Ltd
Gloria Wang37fe1582010-03-12 14:53:20 -08004 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
Gloria Wang2da723a2010-03-18 15:56:16 -07007 * modification, are permitted provided that the following conditions
8 * are met:
Gloria Wang37fe1582010-03-12 14:53:20 -08009 *
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.
Gloria Wang2da723a2010-03-18 15:56:16 -070016 * * 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.
Gloria Wang37fe1582010-03-12 14:53:20 -080020 *
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 ************************************************************************
Gloria Wang79130732010-02-08 14:41:04 -080033
34 function: libvorbis codec headers
35
Gloria Wang37fe1582010-03-12 14:53:20 -080036 ************************************************************************/
Gloria Wang79130732010-02-08 14:41:04 -080037
38#ifndef _vorbis_codec_h_
39#define _vorbis_codec_h_
40
41#ifdef __cplusplus
42extern "C"
43{
44#endif /* __cplusplus */
45
46#include "ogg.h"
47
48struct vorbis_dsp_state;
49typedef struct vorbis_dsp_state vorbis_dsp_state;
50
51typedef struct vorbis_info{
52 int version;
53 int channels;
54 long rate;
55
56 /* The below bitrate declarations are *hints*.
57 Combinations of the three values carry the following implications:
58
59 all three set to the same value:
60 implies a fixed rate bitstream
61 only nominal set:
62 implies a VBR stream that averages the nominal bitrate. No hard
63 upper/lower limit
64 upper and or lower set:
65 implies a VBR bitstream that obeys the bitrate limits. nominal
66 may also be set to give a nominal rate.
67 none set:
68 the coder does not care to speculate.
69 */
70
71 long bitrate_upper;
72 long bitrate_nominal;
73 long bitrate_lower;
74 long bitrate_window;
75
76 void *codec_setup;
77} vorbis_info;
78
79typedef struct vorbis_comment{
80 char **user_comments;
81 int *comment_lengths;
82 int comments;
83 char *vendor;
84
85} vorbis_comment;
86
87
88/* Vorbis PRIMITIVES: general ***************************************/
89
90extern void vorbis_info_init(vorbis_info *vi);
91extern void vorbis_info_clear(vorbis_info *vi);
92extern int vorbis_info_blocksize(vorbis_info *vi,int zo);
93extern void vorbis_comment_init(vorbis_comment *vc);
94extern void vorbis_comment_add(vorbis_comment *vc, char *comment);
95extern void vorbis_comment_add_tag(vorbis_comment *vc,
96 char *tag, char *contents);
97extern char *vorbis_comment_query(vorbis_comment *vc, char *tag, int count);
98extern int vorbis_comment_query_count(vorbis_comment *vc, char *tag);
99extern void vorbis_comment_clear(vorbis_comment *vc);
100
101/* Vorbis ERRORS and return codes ***********************************/
102
103#define OV_FALSE -1
104#define OV_EOF -2
105#define OV_HOLE -3
106
107#define OV_EREAD -128
108#define OV_EFAULT -129
109#define OV_EIMPL -130
110#define OV_EINVAL -131
111#define OV_ENOTVORBIS -132
112#define OV_EBADHEADER -133
113#define OV_EVERSION -134
114#define OV_ENOTAUDIO -135
115#define OV_EBADPACKET -136
116#define OV_EBADLINK -137
117#define OV_ENOSEEK -138
118
119#ifdef __cplusplus
120}
121#endif /* __cplusplus */
122
123#endif
124