annotate Plugins/Input/aac/mp4ff/mp4ffint.h @ 1020:d70514b3b436 trunk

[svn] - stuff
author nenolod
date Wed, 10 May 2006 14:41:23 -0700
parents
children ddd7946bdd8f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1020
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
1 /*
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
2 ** FAAD2 - Freeware Advanced Audio (AAC) Decoder including SBR decoding
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
3 ** Copyright (C) 2003-2004 M. Bakker, Ahead Software AG, http://www.nero.com
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
4 **
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
5 ** This program is free software; you can redistribute it and/or modify
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
6 ** it under the terms of the GNU General Public License as published by
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
7 ** the Free Software Foundation; either version 2 of the License, or
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
8 ** (at your option) any later version.
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
9 **
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
10 ** This program is distributed in the hope that it will be useful,
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
13 ** GNU General Public License for more details.
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
14 **
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
15 ** You should have received a copy of the GNU General Public License
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
16 ** along with this program; if not, write to the Free Software
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
17 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
18 **
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
19 ** Any non-GPL usage of this software or parts of this software is strictly
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
20 ** forbidden.
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
21 **
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
22 ** Commercial non-GPL licensing of this software is possible.
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
23 ** For more info contact Ahead Software through Mpeg4AAClicense@nero.com.
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
24 **
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
25 ** $Id: mp4ffint.h,v 1.15 2004/01/14 20:50:22 menno Exp $
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
26 **/
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
27
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
28 #ifndef MP4FF_INTERNAL_H
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
29 #define MP4FF_INTERNAL_H
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
30
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
31 #ifdef __cplusplus
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
32 extern "C" {
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
33 #endif /* __cplusplus */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
34
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
35 #include "mp4ff_int_types.h"
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
36
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
37
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
38 #ifdef _WIN32
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
39 #define ITUNES_DRM
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
40 #endif
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
41
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
42
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
43 #define MAX_TRACKS 1024
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
44 #define TRACK_UNKNOWN 0
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
45 #define TRACK_AUDIO 1
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
46 #define TRACK_VIDEO 2
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
47 #define TRACK_SYSTEM 3
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
48
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
49
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
50 #define SUBATOMIC 128
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
51
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
52 /* atoms without subatoms */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
53 #define ATOM_FTYP 129
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
54 #define ATOM_MDAT 130
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
55 #define ATOM_MVHD 131
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
56 #define ATOM_TKHD 132
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
57 #define ATOM_TREF 133
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
58 #define ATOM_MDHD 134
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
59 #define ATOM_VMHD 135
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
60 #define ATOM_SMHD 136
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
61 #define ATOM_HMHD 137
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
62 #define ATOM_STSD 138
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
63 #define ATOM_STTS 139
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
64 #define ATOM_STSZ 140
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
65 #define ATOM_STZ2 141
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
66 #define ATOM_STCO 142
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
67 #define ATOM_STSC 143
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
68 #define ATOM_MP4A 144
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
69 #define ATOM_MP4V 145
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
70 #define ATOM_MP4S 146
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
71 #define ATOM_ESDS 147
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
72 #define ATOM_META 148 /* iTunes Metadata box */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
73 #define ATOM_NAME 149 /* iTunes Metadata name box */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
74 #define ATOM_DATA 150 /* iTunes Metadata data box */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
75 #define ATOM_CTTS 151
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
76 #define ATOM_FRMA 152
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
77 #define ATOM_IVIV 153
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
78 #define ATOM_PRIV 154
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
79
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
80 #define ATOM_UNKNOWN 255
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
81 #define ATOM_FREE ATOM_UNKNOWN
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
82 #define ATOM_SKIP ATOM_UNKNOWN
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
83
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
84 /* atoms with subatoms */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
85 #define ATOM_MOOV 1
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
86 #define ATOM_TRAK 2
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
87 #define ATOM_EDTS 3
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
88 #define ATOM_MDIA 4
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
89 #define ATOM_MINF 5
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
90 #define ATOM_STBL 6
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
91 #define ATOM_UDTA 7
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
92 #define ATOM_ILST 8 /* iTunes Metadata list */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
93 #define ATOM_TITLE 9
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
94 #define ATOM_ARTIST 10
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
95 #define ATOM_WRITER 11
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
96 #define ATOM_ALBUM 12
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
97 #define ATOM_DATE 13
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
98 #define ATOM_TOOL 14
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
99 #define ATOM_COMMENT 15
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
100 #define ATOM_GENRE1 16
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
101 #define ATOM_TRACK 17
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
102 #define ATOM_DISC 18
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
103 #define ATOM_COMPILATION 19
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
104 #define ATOM_GENRE2 20
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
105 #define ATOM_TEMPO 21
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
106 #define ATOM_COVER 22
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
107 #define ATOM_DRMS 23
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
108 #define ATOM_SINF 24
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
109 #define ATOM_SCHI 25
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
110
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
111 #ifdef HAVE_CONFIG_H
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
112 #include "config.h"
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
113 #endif
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
114
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
115 #ifndef _WIN32
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
116 #define stricmp strcasecmp
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
117 #endif
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
118
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
119 /* file callback structure */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
120 typedef struct
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
121 {
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
122 uint32_t (*read)(void *user_data, void *buffer, uint32_t length);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
123 uint32_t (*write)(void *udata, void *buffer, uint32_t length);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
124 uint32_t (*seek)(void *user_data, uint64_t position);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
125 uint32_t (*truncate)(void *user_data);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
126 void *user_data;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
127 } mp4ff_callback_t;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
128
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
129
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
130 /* metadata tag structure */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
131 typedef struct
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
132 {
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
133 char *item;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
134 char *value;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
135 } mp4ff_tag_t;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
136
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
137 /* metadata list structure */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
138 typedef struct
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
139 {
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
140 mp4ff_tag_t *tags;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
141 uint32_t count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
142 } mp4ff_metadata_t;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
143
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
144
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
145 typedef struct
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
146 {
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
147 int32_t type;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
148 int32_t channelCount;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
149 int32_t sampleSize;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
150 uint16_t sampleRate;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
151 int32_t audioType;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
152
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
153 /* stsd */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
154 int32_t stsd_entry_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
155
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
156 /* stsz */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
157 int32_t stsz_sample_size;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
158 int32_t stsz_sample_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
159 int32_t *stsz_table;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
160
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
161 /* stts */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
162 int32_t stts_entry_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
163 int32_t *stts_sample_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
164 int32_t *stts_sample_delta;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
165
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
166 /* stsc */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
167 int32_t stsc_entry_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
168 int32_t *stsc_first_chunk;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
169 int32_t *stsc_samples_per_chunk;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
170 int32_t *stsc_sample_desc_index;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
171
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
172 /* stsc */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
173 int32_t stco_entry_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
174 int32_t *stco_chunk_offset;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
175
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
176 /* ctts */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
177 int32_t ctts_entry_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
178 int32_t *ctts_sample_count;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
179 int32_t *ctts_sample_offset;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
180
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
181 /* esde */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
182 uint8_t *decoderConfig;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
183 int32_t decoderConfigLen;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
184
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
185 uint32_t maxBitrate;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
186 uint32_t avgBitrate;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
187
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
188 uint32_t timeScale;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
189 uint64_t duration;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
190
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
191 #ifdef ITUNES_DRM
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
192 /* drms */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
193 void *p_drms;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
194 #endif
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
195
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
196 } mp4ff_track_t;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
197
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
198 /* mp4 main file structure */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
199 typedef struct
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
200 {
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
201 /* stream to read from */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
202 mp4ff_callback_t *stream;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
203 int64_t current_position;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
204
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
205 int32_t moov_read;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
206 uint64_t moov_offset;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
207 uint64_t moov_size;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
208 uint8_t last_atom;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
209 uint64_t file_size;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
210
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
211 /* mvhd */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
212 int32_t time_scale;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
213 int32_t duration;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
214
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
215 /* incremental track index while reading the file */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
216 int32_t total_tracks;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
217
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
218 /* track data */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
219 mp4ff_track_t *track[MAX_TRACKS];
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
220
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
221 /* metadata */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
222 mp4ff_metadata_t tags;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
223 } mp4ff_t;
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
224
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
225
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
226
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
227
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
228 /* mp4util.c */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
229 int32_t mp4ff_read_data(mp4ff_t *f, int8_t *data, uint32_t size);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
230 int32_t mp4ff_write_data(mp4ff_t *f, int8_t *data, uint32_t size);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
231 uint64_t mp4ff_read_int64(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
232 uint32_t mp4ff_read_int32(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
233 uint32_t mp4ff_read_int24(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
234 uint16_t mp4ff_read_int16(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
235 uint8_t mp4ff_read_char(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
236 int32_t mp4ff_write_int32(mp4ff_t *f,const uint32_t data);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
237 uint32_t mp4ff_read_mp4_descr_length(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
238 int64_t mp4ff_position(const mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
239 int32_t mp4ff_set_position(mp4ff_t *f, const int64_t position);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
240 int32_t mp4ff_truncate(mp4ff_t * f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
241 char * mp4ff_read_string(mp4ff_t * f,uint32_t length);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
242
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
243 /* mp4atom.c */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
244 int32_t mp4ff_atom_get_size(const int8_t *data);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
245 int32_t mp4ff_atom_compare(const int8_t a1, const int8_t b1, const int8_t c1, const int8_t d1,
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
246 const int8_t a2, const int8_t b2, const int8_t c2, const int8_t d2);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
247 uint8_t mp4ff_atom_name_to_type(const int8_t a, const int8_t b, const int8_t c, const int8_t d);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
248 uint64_t mp4ff_atom_read_header(mp4ff_t *f, uint8_t *atom_type, uint8_t *header_size);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
249 int32_t mp4ff_read_stsz(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
250 int32_t mp4ff_read_esds(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
251 int32_t mp4ff_read_mp4a(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
252 int32_t mp4ff_read_stsd(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
253 int32_t mp4ff_read_stsc(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
254 int32_t mp4ff_read_stco(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
255 int32_t mp4ff_read_stts(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
256 #ifdef USE_TAGGING
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
257 int32_t mp4ff_read_meta(mp4ff_t *f, const uint64_t size);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
258 #endif
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
259 int32_t mp4ff_atom_read(mp4ff_t *f, const int32_t size, const uint8_t atom_type);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
260
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
261 /* mp4sample.c */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
262 int32_t mp4ff_chunk_of_sample(const mp4ff_t *f, const int32_t track, const int32_t sample,
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
263 int32_t *chunk_sample, int32_t *chunk);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
264 int32_t mp4ff_chunk_to_offset(const mp4ff_t *f, const int32_t track, const int32_t chunk);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
265 int32_t mp4ff_sample_range_size(const mp4ff_t *f, const int32_t track,
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
266 const int32_t chunk_sample, const int32_t sample);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
267 int32_t mp4ff_sample_to_offset(const mp4ff_t *f, const int32_t track, const int32_t sample);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
268 int32_t mp4ff_audio_frame_size(const mp4ff_t *f, const int32_t track, const int32_t sample);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
269 int32_t mp4ff_set_sample_position(mp4ff_t *f, const int32_t track, const int32_t sample);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
270
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
271 #ifdef USE_TAGGING
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
272 /* mp4meta.c */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
273 int32_t mp4ff_tag_add_field(mp4ff_metadata_t *tags, const char *item, const char *value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
274 int32_t mp4ff_tag_set_field(mp4ff_metadata_t *tags, const char *item, const char *value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
275 int32_t mp4ff_set_metadata_name(mp4ff_t *f, const uint8_t atom_type, char **name);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
276 int32_t mp4ff_parse_tag(mp4ff_t *f, const uint8_t parent_atom_type, const int32_t size);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
277 int32_t mp4ff_meta_find_by_name(const mp4ff_t *f, const char *item, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
278 int32_t mp4ff_parse_metadata(mp4ff_t *f, const int32_t size);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
279 int32_t mp4ff_tag_delete(mp4ff_metadata_t *tags);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
280 int32_t mp4ff_meta_get_num_items(const mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
281 int32_t mp4ff_meta_get_by_index(const mp4ff_t *f, uint32_t index,
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
282 char **item, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
283 int32_t mp4ff_meta_get_title(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
284 int32_t mp4ff_meta_get_artist(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
285 int32_t mp4ff_meta_get_writer(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
286 int32_t mp4ff_meta_get_album(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
287 int32_t mp4ff_meta_get_date(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
288 int32_t mp4ff_meta_get_tool(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
289 int32_t mp4ff_meta_get_comment(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
290 int32_t mp4ff_meta_get_genre(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
291 int32_t mp4ff_meta_get_track(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
292 int32_t mp4ff_meta_get_disc(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
293 int32_t mp4ff_meta_get_compilation(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
294 int32_t mp4ff_meta_get_tempo(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
295 int32_t mp4ff_meta_get_coverart(const mp4ff_t *f, char **value);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
296 #endif
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
297
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
298 /* mp4ff.c */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
299 mp4ff_t *mp4ff_open_read(mp4ff_callback_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
300 #ifdef USE_TAGGING
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
301 mp4ff_t *mp4ff_open_edit(mp4ff_callback_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
302 #endif
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
303 void mp4ff_close(mp4ff_t *ff);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
304 void mp4ff_track_add(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
305 int32_t parse_sub_atoms(mp4ff_t *f, const uint64_t total_size);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
306 int32_t parse_atoms(mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
307
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
308 int32_t mp4ff_get_sample_duration(const mp4ff_t *f, const int32_t track, const int32_t sample);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
309 int64_t mp4ff_get_sample_position(const mp4ff_t *f, const int32_t track, const int32_t sample);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
310 int32_t mp4ff_get_sample_offset(const mp4ff_t *f, const int32_t track, const int32_t sample);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
311 int32_t mp4ff_find_sample(const mp4ff_t *f, const int32_t track, const int64_t offset,int32_t * toskip);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
312
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
313 int32_t mp4ff_read_sample(mp4ff_t *f, const int32_t track, const int32_t sample,
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
314 uint8_t **audio_buffer, uint32_t *bytes);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
315 int32_t mp4ff_get_decoder_config(const mp4ff_t *f, const int32_t track,
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
316 uint8_t** ppBuf, uint32_t* pBufSize);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
317 int32_t mp4ff_total_tracks(const mp4ff_t *f);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
318 int32_t mp4ff_time_scale(const mp4ff_t *f, const int32_t track);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
319 int32_t mp4ff_num_samples(const mp4ff_t *f, const int32_t track);
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
320
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
321 uint32_t mp4ff_meta_genre_to_index(const char * genrestr);//returns 1-based index, 0 if not found
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
322 const char * mp4ff_meta_index_to_genre(uint32_t idx);//returns pointer to string
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
323
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
324
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
325 #ifdef __cplusplus
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
326 }
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
327 #endif /* __cplusplus */
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
328
d70514b3b436 [svn] - stuff
nenolod
parents:
diff changeset
329 #endif