sl@0
|
1 |
// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#ifndef _MP4ATOM_H
|
sl@0
|
17 |
#define _MP4ATOM_H
|
sl@0
|
18 |
|
sl@0
|
19 |
#include <3gplibrary/mp4config.h>
|
sl@0
|
20 |
#include <3gplibrary/mp4lib.h>
|
sl@0
|
21 |
#include "mp4list.h"
|
sl@0
|
22 |
#include "filewriter.h" /* Async buffering filewriter */
|
sl@0
|
23 |
#include "metadatafilewriter.h" /* Async buffering filewriter */
|
sl@0
|
24 |
#include "asyncfileparser.h" /*Async file reader for parsing */
|
sl@0
|
25 |
|
sl@0
|
26 |
#define ATOMTYPE_FTYP 0x66747970 /* 'ftyp' */
|
sl@0
|
27 |
#define ATOMTYPE_MOOV 0x6d6f6f76 /* 'moov' */
|
sl@0
|
28 |
#define ATOMTYPE_MDAT 0x6d646174 /* 'mdat' */
|
sl@0
|
29 |
#define ATOMTYPE_FREE 0x66726565 /* 'free' */
|
sl@0
|
30 |
#define ATOMTYPE_SKIP 0x736b6970 /* 'skip' */
|
sl@0
|
31 |
#define ATOMTYPE_UDTA 0x75647461 /* 'udta' */
|
sl@0
|
32 |
#define ATOMTYPE_MVHD 0x6d766864 /* 'mvhd' */
|
sl@0
|
33 |
#define ATOMTYPE_IODS 0x696f6473 /* 'iods' */
|
sl@0
|
34 |
#define ATOMTYPE_TRAK 0x7472616b /* 'trak' */
|
sl@0
|
35 |
#define ATOMTYPE_TKHD 0x746b6864 /* 'tkhd' */
|
sl@0
|
36 |
#define ATOMTYPE_MDIA 0x6d646961 /* 'mdia' */
|
sl@0
|
37 |
#define ATOMTYPE_MDHD 0x6d646864 /* 'mdhd' */
|
sl@0
|
38 |
#define ATOMTYPE_HDLR 0x68646c72 /* 'hdlr' */
|
sl@0
|
39 |
#define ATOMTYPE_MINF 0x6d696e66 /* 'minf' */
|
sl@0
|
40 |
#define ATOMTYPE_VMHD 0x766d6864 /* 'vmhd' */
|
sl@0
|
41 |
#define ATOMTYPE_SMHD 0x736d6864 /* 'smhd' */
|
sl@0
|
42 |
#define ATOMTYPE_DINF 0x64696e66 /* 'dinf' */
|
sl@0
|
43 |
#define ATOMTYPE_DREF 0x64726566 /* 'dref' */
|
sl@0
|
44 |
#define ATOMTYPE_TREF 0x74726566 /* 'tref' */
|
sl@0
|
45 |
#define ATOMTYPE_STBL 0x7374626c /* 'stbl' */
|
sl@0
|
46 |
#define ATOMTYPE_STTS 0x73747473 /* 'stts' */
|
sl@0
|
47 |
#define ATOMTYPE_CTTS 0x63747473 /* 'ctts' */
|
sl@0
|
48 |
#define ATOMTYPE_STSS 0x73747373 /* 'stss' */
|
sl@0
|
49 |
#define ATOMTYPE_STSD 0x73747364 /* 'stsd' */
|
sl@0
|
50 |
#define ATOMTYPE_STSZ 0x7374737a /* 'stsz' */
|
sl@0
|
51 |
#define ATOMTYPE_STZ2 0x73747a32 /* 'stz2' */
|
sl@0
|
52 |
#define ATOMTYPE_STSC 0x73747363 /* 'stsc' */
|
sl@0
|
53 |
#define ATOMTYPE_STCO 0x7374636f /* 'stco' */
|
sl@0
|
54 |
#define ATOMTYPE_CO64 0x636f3634 /* 'co64' */
|
sl@0
|
55 |
#define ATOMTYPE_MP4V 0x6d703476 /* 'mp4v' */
|
sl@0
|
56 |
#define ATOMTYPE_MP4A 0x6d703461 /* 'mp4a' */
|
sl@0
|
57 |
#define ATOMTYPE_MP4S 0x6d703473 /* 'mp4s' */
|
sl@0
|
58 |
#define ATOMTYPE_S263 0x73323633 /* 's263' */
|
sl@0
|
59 |
#define ATOMTYPE_D263 0x64323633 /* 'd263' */
|
sl@0
|
60 |
#define ATOMTYPE_BITR 0x62697472 /* 'bitr' */
|
sl@0
|
61 |
#define ATOMTYPE_SAMR 0x73616d72 /* 'samr' */
|
sl@0
|
62 |
#define ATOMTYPE_SAWB 0x73617762 /* 'sawb' */
|
sl@0
|
63 |
#define ATOMTYPE_DAMR 0x64616d72 /* 'damr' */
|
sl@0
|
64 |
#define ATOMTYPE_ESD 0x65736473 /* 'esds' */
|
sl@0
|
65 |
#define ATOMTYPE_URL 0x75726c20 /* 'url ' */
|
sl@0
|
66 |
#define ATOMTYPE_URN 0x75726e20 /* 'urn ' */
|
sl@0
|
67 |
#define ATOMTYPE_UUID 0x75756964 /* 'uuid' */
|
sl@0
|
68 |
#define ATOMTYPE_EDTS 0x65647473 /* 'edts' */
|
sl@0
|
69 |
#define ATOMTYPE_META 0x6d657461 /* 'meta' */
|
sl@0
|
70 |
/* AVC Additions */
|
sl@0
|
71 |
#define ATOMTYPE_AVCC 0x61766343 /* 'avcC' */
|
sl@0
|
72 |
#define ATOMTYPE_BTRT 0x62747274 /* 'btrt' */
|
sl@0
|
73 |
#define ATOMTYPE_AVC1 0x61766331 /* 'avc1' */
|
sl@0
|
74 |
#define ATOMTYPE_M4DS 0x6d346473 /* 'm4ds' */
|
sl@0
|
75 |
#define ATOMTYPE_SDTP 0x73647470 /* 'sdtp' */
|
sl@0
|
76 |
#define ATOMTYPE_AVCP 0x61766370 /* 'avcp' */
|
sl@0
|
77 |
/* QCELP 13K Additions */
|
sl@0
|
78 |
#define ATOMTYPE_SQCP 0x73716370 /* 'sqcp' */
|
sl@0
|
79 |
#define ATOMTYPE_DQCP 0x64716370 /* 'dqcp' */
|
sl@0
|
80 |
/* inline Addition */
|
sl@0
|
81 |
#define ATOMTYPE_ID32 0x49443332 /* 'ID32' */
|
sl@0
|
82 |
|
sl@0
|
83 |
#define HANDLERTYPE_ODSM 0x6f64736d /* 'odsm' */
|
sl@0
|
84 |
#define HANDLERTYPE_VIDE 0x76696465 /* 'vide' */
|
sl@0
|
85 |
#define HANDLERTYPE_SOUN 0x736f756e /* 'soun' */
|
sl@0
|
86 |
|
sl@0
|
87 |
|
sl@0
|
88 |
|
sl@0
|
89 |
#define FTYP_SIZE 24 /* Size of FTYP box in bytes */
|
sl@0
|
90 |
|
sl@0
|
91 |
#define READBUFSIZE 8192 /* Size of file reading buffer */
|
sl@0
|
92 |
#define WRITEBUFSIZE 2048 /* Size of file writing buffer */
|
sl@0
|
93 |
|
sl@0
|
94 |
#define BLOCK_LIMIT 200 /* Max number of metadata blocks to keep in memory */
|
sl@0
|
95 |
|
sl@0
|
96 |
#define MAXSAMPLESPERSECOND 150 /* magic number used to try validate input data to parser from possibly corrupted file */
|
sl@0
|
97 |
|
sl@0
|
98 |
|
sl@0
|
99 |
#define METADATAFILE_VIDEO_STTS_SAMPLE_COUNT 0
|
sl@0
|
100 |
#define METADATAFILE_VIDEO_STTS_SAMPLE_DELTA 1
|
sl@0
|
101 |
#define METADATAFILE_VIDEO_STSZ_ENTRY_SIZE 2
|
sl@0
|
102 |
#define METADATAFILE_VIDEO_STCO_CHUNK_OFFSET 3
|
sl@0
|
103 |
#define METADATAFILE_VIDEO_STSS_SAMPLE_NUMBER 4
|
sl@0
|
104 |
#define METADATAFILE_AUDIO_STTS_SAMPLE_COUNT 5
|
sl@0
|
105 |
#define METADATAFILE_AUDIO_STTS_SAMPLE_DELTA 6
|
sl@0
|
106 |
#define METADATAFILE_AUDIO_STSZ_ENTRY_SIZE 7
|
sl@0
|
107 |
#define METADATAFILE_AUDIO_STCO_CHUNK_OFFSET 8
|
sl@0
|
108 |
#define METADATAFILE_VIDEO_SDTP_SAMPLE_DEPENDENCY 9
|
sl@0
|
109 |
|
sl@0
|
110 |
/* Multiple Sample Entry Inclusion */
|
sl@0
|
111 |
#define STSDMAXSAMPLEENTRYCOUNT 10 /* defined the maximum number of sample entried allowed in a Sample Description Box */
|
sl@0
|
112 |
|
sl@0
|
113 |
|
sl@0
|
114 |
typedef struct atomHeader
|
sl@0
|
115 |
{
|
sl@0
|
116 |
mp4_u32 size;
|
sl@0
|
117 |
mp4_u32 type;
|
sl@0
|
118 |
mp4_u64 largeSize;
|
sl@0
|
119 |
mp4_u8 extendedType[16];
|
sl@0
|
120 |
mp4_u8 version;
|
sl@0
|
121 |
mp4_u8 flags[3];
|
sl@0
|
122 |
} atomHeader;
|
sl@0
|
123 |
|
sl@0
|
124 |
|
sl@0
|
125 |
typedef struct fileTypeAtom
|
sl@0
|
126 |
{
|
sl@0
|
127 |
atomHeader *atomhdr;
|
sl@0
|
128 |
mp4_u32 majorBrand;
|
sl@0
|
129 |
mp4_u32 minorVersion;
|
sl@0
|
130 |
mp4_u32 *compatibleBrands;
|
sl@0
|
131 |
} fileTypeAtom;
|
sl@0
|
132 |
|
sl@0
|
133 |
|
sl@0
|
134 |
typedef struct movieHeaderAtom
|
sl@0
|
135 |
{
|
sl@0
|
136 |
atomHeader *atomhdr;
|
sl@0
|
137 |
mp4_u32 creationTime;
|
sl@0
|
138 |
mp4_u32 modificationTime;
|
sl@0
|
139 |
mp4_u32 timeScale;
|
sl@0
|
140 |
mp4_u32 duration;
|
sl@0
|
141 |
mp4_u32 nextTrackID;
|
sl@0
|
142 |
mp4_u64 creationTime64;
|
sl@0
|
143 |
mp4_u64 modificationTime64;
|
sl@0
|
144 |
mp4_u64 duration64;
|
sl@0
|
145 |
} movieHeaderAtom;
|
sl@0
|
146 |
|
sl@0
|
147 |
|
sl@0
|
148 |
typedef struct objectDescriptorAtom
|
sl@0
|
149 |
{
|
sl@0
|
150 |
atomHeader *atomhdr;
|
sl@0
|
151 |
mp4_u8 tag;
|
sl@0
|
152 |
mp4_u32 sizeOfInstance;
|
sl@0
|
153 |
mp4_u16 flags;
|
sl@0
|
154 |
mp4_u8 ODProfileLevelIndication;
|
sl@0
|
155 |
mp4_u8 SceneProfileLevelIndication;
|
sl@0
|
156 |
mp4_u8 AudioProfileLevelIndication;
|
sl@0
|
157 |
mp4_u8 VisualProfileLevelIndication;
|
sl@0
|
158 |
mp4_u8 GraphicsProfileLevelIndication;
|
sl@0
|
159 |
} objectDescriptorAtom;
|
sl@0
|
160 |
|
sl@0
|
161 |
|
sl@0
|
162 |
typedef struct trackHeaderAtom
|
sl@0
|
163 |
{
|
sl@0
|
164 |
atomHeader *atomhdr;
|
sl@0
|
165 |
mp4_u32 creationTime;
|
sl@0
|
166 |
mp4_u32 modificationTime;
|
sl@0
|
167 |
mp4_u32 trackID;
|
sl@0
|
168 |
mp4_u32 reserved;
|
sl@0
|
169 |
mp4_u32 duration;
|
sl@0
|
170 |
mp4_u64 creationTime64;
|
sl@0
|
171 |
mp4_u64 modificationTime64;
|
sl@0
|
172 |
mp4_u64 duration64;
|
sl@0
|
173 |
mp4_u16 width;
|
sl@0
|
174 |
mp4_u16 height;
|
sl@0
|
175 |
mp4_bool isAudio;
|
sl@0
|
176 |
mp4_bool isVisual;
|
sl@0
|
177 |
} trackHeaderAtom;
|
sl@0
|
178 |
|
sl@0
|
179 |
|
sl@0
|
180 |
typedef struct mediaHeaderAtom
|
sl@0
|
181 |
{
|
sl@0
|
182 |
atomHeader *atomhdr;
|
sl@0
|
183 |
mp4_u32 creationTime;
|
sl@0
|
184 |
mp4_u32 modificationTime;
|
sl@0
|
185 |
mp4_u32 timeScale;
|
sl@0
|
186 |
mp4_u32 duration;
|
sl@0
|
187 |
mp4_u64 creationTime64;
|
sl@0
|
188 |
mp4_u64 modificationTime64;
|
sl@0
|
189 |
mp4_u64 duration64;
|
sl@0
|
190 |
} mediaHeaderAtom;
|
sl@0
|
191 |
|
sl@0
|
192 |
|
sl@0
|
193 |
typedef struct handlerAtom
|
sl@0
|
194 |
{
|
sl@0
|
195 |
atomHeader *atomhdr;
|
sl@0
|
196 |
mp4_u32 handlerType;
|
sl@0
|
197 |
mp4_u8 *name;
|
sl@0
|
198 |
} handlerAtom;
|
sl@0
|
199 |
|
sl@0
|
200 |
|
sl@0
|
201 |
typedef struct dataEntryURLAtom
|
sl@0
|
202 |
{
|
sl@0
|
203 |
atomHeader *atomhdr;
|
sl@0
|
204 |
} dataEntryURLAtom;
|
sl@0
|
205 |
|
sl@0
|
206 |
|
sl@0
|
207 |
typedef struct dataEntryURNAtom
|
sl@0
|
208 |
{
|
sl@0
|
209 |
atomHeader *atomhdr;
|
sl@0
|
210 |
} dataEntryURNAtom;
|
sl@0
|
211 |
|
sl@0
|
212 |
|
sl@0
|
213 |
typedef struct dataReferenceAtom
|
sl@0
|
214 |
{
|
sl@0
|
215 |
atomHeader *atomhdr;
|
sl@0
|
216 |
mp4_u32 entryCount;
|
sl@0
|
217 |
dataEntryURLAtom *url;
|
sl@0
|
218 |
dataEntryURNAtom *urn;
|
sl@0
|
219 |
} dataReferenceAtom;
|
sl@0
|
220 |
|
sl@0
|
221 |
|
sl@0
|
222 |
typedef struct dataInformationAtom
|
sl@0
|
223 |
{
|
sl@0
|
224 |
atomHeader *atomhdr;
|
sl@0
|
225 |
dataReferenceAtom *dref;
|
sl@0
|
226 |
} dataInformationAtom;
|
sl@0
|
227 |
|
sl@0
|
228 |
|
sl@0
|
229 |
typedef struct timeToSampleAtom
|
sl@0
|
230 |
{
|
sl@0
|
231 |
atomHeader *atomhdr;
|
sl@0
|
232 |
mp4_u32 entryCount;
|
sl@0
|
233 |
mp4_u32 *sampleCount;
|
sl@0
|
234 |
mp4_i32 *sampleDelta;
|
sl@0
|
235 |
} timeToSampleAtom;
|
sl@0
|
236 |
|
sl@0
|
237 |
|
sl@0
|
238 |
typedef struct compositionTimeToSampleAtom
|
sl@0
|
239 |
{
|
sl@0
|
240 |
atomHeader *atomhdr;
|
sl@0
|
241 |
mp4_u32 entryCount;
|
sl@0
|
242 |
mp4_u32 *sampleCount;
|
sl@0
|
243 |
mp4_u32 *sampleOffset;
|
sl@0
|
244 |
} compositionTimeToSampleAtom;
|
sl@0
|
245 |
|
sl@0
|
246 |
|
sl@0
|
247 |
typedef struct ESDAtom
|
sl@0
|
248 |
{
|
sl@0
|
249 |
atomHeader *atomhdr;
|
sl@0
|
250 |
mp4_u8 esDescrTag;
|
sl@0
|
251 |
mp4_u32 size;
|
sl@0
|
252 |
mp4_u16 ESID;
|
sl@0
|
253 |
mp4_u8 flags;
|
sl@0
|
254 |
mp4_u16 dependsOnESID;
|
sl@0
|
255 |
mp4_u8 URLLength;
|
sl@0
|
256 |
mp4_u8 *URLString;
|
sl@0
|
257 |
mp4_u16 OCRESID;
|
sl@0
|
258 |
mp4_u8 decConfDescrTag;
|
sl@0
|
259 |
mp4_u32 decConfDescrSize;
|
sl@0
|
260 |
mp4_u8 objectTypeIndication;
|
sl@0
|
261 |
mp4_u8 stream;
|
sl@0
|
262 |
mp4_u32 bufferSizeDB;
|
sl@0
|
263 |
mp4_u32 maxBitrate;
|
sl@0
|
264 |
mp4_u32 avgBitrate;
|
sl@0
|
265 |
mp4_u8 decSpecificInfoTag;
|
sl@0
|
266 |
mp4_u32 decSpecificInfoSize;
|
sl@0
|
267 |
mp4_u8 *decSpecificInfo;
|
sl@0
|
268 |
} ESDAtom;
|
sl@0
|
269 |
|
sl@0
|
270 |
|
sl@0
|
271 |
typedef struct visualSampleEntry
|
sl@0
|
272 |
{
|
sl@0
|
273 |
atomHeader *atomhdr;
|
sl@0
|
274 |
mp4_u16 dataReferenceIndex;
|
sl@0
|
275 |
mp4_u16 width;
|
sl@0
|
276 |
mp4_u16 height;
|
sl@0
|
277 |
ESDAtom *esd;
|
sl@0
|
278 |
} visualSampleEntry;
|
sl@0
|
279 |
|
sl@0
|
280 |
|
sl@0
|
281 |
typedef struct audioSampleEntry
|
sl@0
|
282 |
{
|
sl@0
|
283 |
atomHeader *atomhdr;
|
sl@0
|
284 |
mp4_u16 dataReferenceIndex;
|
sl@0
|
285 |
mp4_u16 timeScale;
|
sl@0
|
286 |
ESDAtom *esd;
|
sl@0
|
287 |
} audioSampleEntry;
|
sl@0
|
288 |
|
sl@0
|
289 |
|
sl@0
|
290 |
typedef struct mpegSampleEntry
|
sl@0
|
291 |
{
|
sl@0
|
292 |
atomHeader *atomhdr;
|
sl@0
|
293 |
mp4_u16 dataReferenceIndex;
|
sl@0
|
294 |
ESDAtom *esd;
|
sl@0
|
295 |
} mpegSampleEntry;
|
sl@0
|
296 |
|
sl@0
|
297 |
|
sl@0
|
298 |
typedef struct bitrateAtom
|
sl@0
|
299 |
{
|
sl@0
|
300 |
atomHeader *atomhdr;
|
sl@0
|
301 |
mp4_u32 avgBitrate;
|
sl@0
|
302 |
mp4_u32 maxBitrate;
|
sl@0
|
303 |
} bitrateAtom;
|
sl@0
|
304 |
|
sl@0
|
305 |
|
sl@0
|
306 |
typedef struct h263SpecificAtom
|
sl@0
|
307 |
{
|
sl@0
|
308 |
atomHeader *atomhdr;
|
sl@0
|
309 |
mp4_u32 vendor;
|
sl@0
|
310 |
mp4_u8 decoderVersion;
|
sl@0
|
311 |
mp4_u8 h263Level;
|
sl@0
|
312 |
mp4_u8 h263Profile;
|
sl@0
|
313 |
bitrateAtom *bitr;
|
sl@0
|
314 |
} h263SpecificAtom;
|
sl@0
|
315 |
|
sl@0
|
316 |
|
sl@0
|
317 |
typedef struct h263SampleEntry
|
sl@0
|
318 |
{
|
sl@0
|
319 |
atomHeader *atomhdr;
|
sl@0
|
320 |
mp4_u16 dataReferenceIndex;
|
sl@0
|
321 |
mp4_u16 width;
|
sl@0
|
322 |
mp4_u16 height;
|
sl@0
|
323 |
h263SpecificAtom *d263;
|
sl@0
|
324 |
} h263SampleEntry;
|
sl@0
|
325 |
|
sl@0
|
326 |
|
sl@0
|
327 |
typedef struct amrDecSpecStruc
|
sl@0
|
328 |
{
|
sl@0
|
329 |
atomHeader *atomhdr;
|
sl@0
|
330 |
mp4_u32 vendor;
|
sl@0
|
331 |
mp4_u8 decoderVersion;
|
sl@0
|
332 |
mp4_u16 modeSet;
|
sl@0
|
333 |
mp4_u8 modeChangePeriod;
|
sl@0
|
334 |
mp4_u8 framesPerSample;
|
sl@0
|
335 |
} amrDecSpecStruc;
|
sl@0
|
336 |
|
sl@0
|
337 |
|
sl@0
|
338 |
typedef struct amrSampleEntry
|
sl@0
|
339 |
{
|
sl@0
|
340 |
atomHeader *atomhdr;
|
sl@0
|
341 |
mp4_u16 dataReferenceIndex;
|
sl@0
|
342 |
mp4_u16 timeScale;
|
sl@0
|
343 |
amrDecSpecStruc *damr;
|
sl@0
|
344 |
} amrSampleEntry;
|
sl@0
|
345 |
|
sl@0
|
346 |
typedef struct avcConfigurationAtom
|
sl@0
|
347 |
{
|
sl@0
|
348 |
atomHeader *atomhdr;
|
sl@0
|
349 |
mp4_u8 *avcConfig;
|
sl@0
|
350 |
mp4_u32 avcConfigSize;
|
sl@0
|
351 |
} avcConfigurationAtom;
|
sl@0
|
352 |
|
sl@0
|
353 |
typedef struct mpeg4BitrateAtom
|
sl@0
|
354 |
{
|
sl@0
|
355 |
atomHeader *atomhdr;
|
sl@0
|
356 |
mp4_u32 bufferSizeDB;
|
sl@0
|
357 |
mp4_u32 maxBitRate;
|
sl@0
|
358 |
mp4_u32 avgBitrate;
|
sl@0
|
359 |
} mpeg4BitrateAtom;
|
sl@0
|
360 |
|
sl@0
|
361 |
typedef struct mpeg4ExtensionDescriptorsAtom
|
sl@0
|
362 |
{
|
sl@0
|
363 |
atomHeader *atomhdr;
|
sl@0
|
364 |
mp4_u8 *descr;
|
sl@0
|
365 |
mp4_u32 descrSize;
|
sl@0
|
366 |
} mpeg4ExtensionDescriptorsAtom;
|
sl@0
|
367 |
|
sl@0
|
368 |
typedef struct avcSampleEntry
|
sl@0
|
369 |
{
|
sl@0
|
370 |
atomHeader *atomhdr;
|
sl@0
|
371 |
mp4_u16 dataReferenceIndex;
|
sl@0
|
372 |
mp4_u16 width;
|
sl@0
|
373 |
mp4_u16 height;
|
sl@0
|
374 |
avcConfigurationAtom *avcc;
|
sl@0
|
375 |
mpeg4BitrateAtom *btrt;
|
sl@0
|
376 |
mpeg4ExtensionDescriptorsAtom *m4ds;
|
sl@0
|
377 |
} avcSampleEntry;
|
sl@0
|
378 |
|
sl@0
|
379 |
typedef struct qcelpDecSpecStruc
|
sl@0
|
380 |
{
|
sl@0
|
381 |
atomHeader *atomhdr;
|
sl@0
|
382 |
mp4_u32 vendor;
|
sl@0
|
383 |
mp4_u8 decoderVersion;
|
sl@0
|
384 |
mp4_u8 framesPerSample;
|
sl@0
|
385 |
} qcelpDecSpecStruc;
|
sl@0
|
386 |
|
sl@0
|
387 |
typedef struct qcelpSampleEntry
|
sl@0
|
388 |
{
|
sl@0
|
389 |
atomHeader *atomhdr;
|
sl@0
|
390 |
mp4_u16 dataReferenceIndex;
|
sl@0
|
391 |
mp4_u16 timeScale;
|
sl@0
|
392 |
qcelpDecSpecStruc *dqcp;
|
sl@0
|
393 |
} qcelpSampleEntry;
|
sl@0
|
394 |
|
sl@0
|
395 |
typedef struct avcParameterSampleEntry
|
sl@0
|
396 |
{
|
sl@0
|
397 |
|
sl@0
|
398 |
} avcParameterSampleEntry;
|
sl@0
|
399 |
|
sl@0
|
400 |
typedef struct sampleDescriptionAtom
|
sl@0
|
401 |
{
|
sl@0
|
402 |
atomHeader *atomhdr;
|
sl@0
|
403 |
mp4_u32 entryCount;
|
sl@0
|
404 |
visualSampleEntry *mp4v[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
405 |
audioSampleEntry *mp4a[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
406 |
mpegSampleEntry *mp4s[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
407 |
h263SampleEntry *s263[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
408 |
amrSampleEntry *samr[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
409 |
amrSampleEntry *sawb[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
410 |
/* AVC addition */
|
sl@0
|
411 |
avcSampleEntry *avc1[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
412 |
/* QCELP 13K addition */
|
sl@0
|
413 |
qcelpSampleEntry *sqcp[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
414 |
avcParameterSampleEntry *avcp[STSDMAXSAMPLEENTRYCOUNT];
|
sl@0
|
415 |
} sampleDescriptionAtom;
|
sl@0
|
416 |
|
sl@0
|
417 |
|
sl@0
|
418 |
typedef struct sampleSizeAtom
|
sl@0
|
419 |
{
|
sl@0
|
420 |
atomHeader *atomhdr;
|
sl@0
|
421 |
mp4_u32 sampleSize;
|
sl@0
|
422 |
mp4_u32 sampleCount;
|
sl@0
|
423 |
mp4_u32 *entrySize;
|
sl@0
|
424 |
} sampleSizeAtom;
|
sl@0
|
425 |
|
sl@0
|
426 |
|
sl@0
|
427 |
typedef struct sampleToChunkAtom
|
sl@0
|
428 |
{
|
sl@0
|
429 |
atomHeader *atomhdr;
|
sl@0
|
430 |
mp4_u32 entryCount;
|
sl@0
|
431 |
mp4_u32 *firstChunk;
|
sl@0
|
432 |
mp4_u32 *samplesPerChunk;
|
sl@0
|
433 |
mp4_u32 *sampleDescriptionIndex;
|
sl@0
|
434 |
} sampleToChunkAtom;
|
sl@0
|
435 |
|
sl@0
|
436 |
|
sl@0
|
437 |
typedef struct chunkOffsetAtom
|
sl@0
|
438 |
{
|
sl@0
|
439 |
atomHeader *atomhdr;
|
sl@0
|
440 |
mp4_u32 entryCount;
|
sl@0
|
441 |
mp4_u32 *chunkOffset;
|
sl@0
|
442 |
} chunkOffsetAtom;
|
sl@0
|
443 |
|
sl@0
|
444 |
typedef struct chunkOffset64Atom
|
sl@0
|
445 |
{
|
sl@0
|
446 |
atomHeader *atomhdr;
|
sl@0
|
447 |
mp4_u32 entryCount;
|
sl@0
|
448 |
mp4_u64 *chunkOffset;
|
sl@0
|
449 |
} chunkOffset64Atom;
|
sl@0
|
450 |
|
sl@0
|
451 |
|
sl@0
|
452 |
typedef struct syncSampleAtom
|
sl@0
|
453 |
{
|
sl@0
|
454 |
atomHeader *atomhdr;
|
sl@0
|
455 |
mp4_u32 entryCount;
|
sl@0
|
456 |
mp4_u32 *sampleNumber;
|
sl@0
|
457 |
} syncSampleAtom;
|
sl@0
|
458 |
|
sl@0
|
459 |
|
sl@0
|
460 |
typedef struct shadowSyncSampleAtom
|
sl@0
|
461 |
{
|
sl@0
|
462 |
atomHeader *atomhdr;
|
sl@0
|
463 |
} shadowSyncSampleAtom;
|
sl@0
|
464 |
|
sl@0
|
465 |
typedef struct sampleDependency
|
sl@0
|
466 |
{
|
sl@0
|
467 |
mp4_u8 sDependsOn;
|
sl@0
|
468 |
mp4_u8 sIsDependentOn;
|
sl@0
|
469 |
mp4_u8 sHasRedundancy;
|
sl@0
|
470 |
} sampleDependency;
|
sl@0
|
471 |
|
sl@0
|
472 |
typedef struct sampleDependencyAtom
|
sl@0
|
473 |
{
|
sl@0
|
474 |
atomHeader *atomhdr;
|
sl@0
|
475 |
mp4_u32 sampleCount;
|
sl@0
|
476 |
sampleDependency *dep;
|
sl@0
|
477 |
} sampleDependencyAtom;
|
sl@0
|
478 |
|
sl@0
|
479 |
typedef struct sampleTableAtom
|
sl@0
|
480 |
{
|
sl@0
|
481 |
atomHeader *atomhdr;
|
sl@0
|
482 |
timeToSampleAtom *stts;
|
sl@0
|
483 |
compositionTimeToSampleAtom *ctts;
|
sl@0
|
484 |
sampleDescriptionAtom *stsd;
|
sl@0
|
485 |
sampleSizeAtom *stsz;
|
sl@0
|
486 |
sampleToChunkAtom *stsc;
|
sl@0
|
487 |
mp4_bool is32BitOffsets;
|
sl@0
|
488 |
union
|
sl@0
|
489 |
{
|
sl@0
|
490 |
chunkOffsetAtom *stco;
|
sl@0
|
491 |
chunkOffset64Atom *stco64;
|
sl@0
|
492 |
};
|
sl@0
|
493 |
syncSampleAtom *stss;
|
sl@0
|
494 |
shadowSyncSampleAtom *stsh;
|
sl@0
|
495 |
sampleDependencyAtom *sdtp;
|
sl@0
|
496 |
} sampleTableAtom;
|
sl@0
|
497 |
|
sl@0
|
498 |
|
sl@0
|
499 |
typedef struct videoMediaHeaderAtom
|
sl@0
|
500 |
{
|
sl@0
|
501 |
atomHeader *atomhdr;
|
sl@0
|
502 |
} videoMediaHeaderAtom;
|
sl@0
|
503 |
|
sl@0
|
504 |
|
sl@0
|
505 |
typedef struct soundMediaHeaderAtom
|
sl@0
|
506 |
{
|
sl@0
|
507 |
atomHeader *atomhdr;
|
sl@0
|
508 |
} soundMediaHeaderAtom;
|
sl@0
|
509 |
|
sl@0
|
510 |
|
sl@0
|
511 |
typedef struct mediaInformationAtom
|
sl@0
|
512 |
{
|
sl@0
|
513 |
atomHeader *atomhdr;
|
sl@0
|
514 |
videoMediaHeaderAtom *vmhd;
|
sl@0
|
515 |
soundMediaHeaderAtom *smhd;
|
sl@0
|
516 |
dataInformationAtom *dinf;
|
sl@0
|
517 |
sampleTableAtom *stbl;
|
sl@0
|
518 |
} mediaInformationAtom;
|
sl@0
|
519 |
|
sl@0
|
520 |
|
sl@0
|
521 |
typedef struct mediaAtom
|
sl@0
|
522 |
{
|
sl@0
|
523 |
atomHeader *atomhdr;
|
sl@0
|
524 |
mediaHeaderAtom *mdhd;
|
sl@0
|
525 |
handlerAtom *hdlr;
|
sl@0
|
526 |
mediaInformationAtom *minf;
|
sl@0
|
527 |
} mediaAtom;
|
sl@0
|
528 |
|
sl@0
|
529 |
|
sl@0
|
530 |
typedef struct trackReferenceAtom
|
sl@0
|
531 |
{
|
sl@0
|
532 |
atomHeader *atomhdr;
|
sl@0
|
533 |
} trackReferenceAtom;
|
sl@0
|
534 |
|
sl@0
|
535 |
|
sl@0
|
536 |
typedef struct editListContainerAtom
|
sl@0
|
537 |
{
|
sl@0
|
538 |
atomHeader *atomhdr;
|
sl@0
|
539 |
} editListContainerAtom;
|
sl@0
|
540 |
|
sl@0
|
541 |
|
sl@0
|
542 |
typedef struct copyrightAtom
|
sl@0
|
543 |
{
|
sl@0
|
544 |
void *p;
|
sl@0
|
545 |
} copyrightAtom;
|
sl@0
|
546 |
|
sl@0
|
547 |
typedef struct userDataAtom
|
sl@0
|
548 |
{
|
sl@0
|
549 |
atomHeader *atomhdr;
|
sl@0
|
550 |
mp4_u64 atomcontentloc; //used for parsing
|
sl@0
|
551 |
mp4_u32 atomcontentsize; //used for parsing and composing
|
sl@0
|
552 |
mp4_u8 *contentdata; //used for composing
|
sl@0
|
553 |
} userDataAtom;
|
sl@0
|
554 |
|
sl@0
|
555 |
typedef struct trackAtom
|
sl@0
|
556 |
{
|
sl@0
|
557 |
atomHeader *atomhdr;
|
sl@0
|
558 |
trackHeaderAtom *tkhd;
|
sl@0
|
559 |
trackReferenceAtom *tref;
|
sl@0
|
560 |
editListContainerAtom *edts;
|
sl@0
|
561 |
mediaAtom *mdia;
|
sl@0
|
562 |
userDataAtom *udta;
|
sl@0
|
563 |
} trackAtom;
|
sl@0
|
564 |
|
sl@0
|
565 |
typedef struct ID32Atom
|
sl@0
|
566 |
{
|
sl@0
|
567 |
atomHeader *atomhdr;
|
sl@0
|
568 |
mp4_u64 atomcontentloc;
|
sl@0
|
569 |
mp4_u16 language; // top bit is padding, remaining 15 bits is Packed ISO-639-2/T language code
|
sl@0
|
570 |
} ID32Atom;
|
sl@0
|
571 |
|
sl@0
|
572 |
typedef struct metaAtom
|
sl@0
|
573 |
{
|
sl@0
|
574 |
atomHeader *atomhdr;
|
sl@0
|
575 |
handlerAtom *hdlr;
|
sl@0
|
576 |
ID32Atom *ID32;
|
sl@0
|
577 |
} metaAtom;
|
sl@0
|
578 |
|
sl@0
|
579 |
typedef struct movieAtom
|
sl@0
|
580 |
{
|
sl@0
|
581 |
atomHeader *atomhdr;
|
sl@0
|
582 |
movieHeaderAtom *mvhd;
|
sl@0
|
583 |
trackAtom *trakAudio; // audio
|
sl@0
|
584 |
trackAtom *trakVideo; // video
|
sl@0
|
585 |
objectDescriptorAtom *iods;
|
sl@0
|
586 |
userDataAtom *udta;
|
sl@0
|
587 |
metaAtom *meta;
|
sl@0
|
588 |
} movieAtom;
|
sl@0
|
589 |
|
sl@0
|
590 |
|
sl@0
|
591 |
typedef struct mediaDataAtom
|
sl@0
|
592 |
{
|
sl@0
|
593 |
atomHeader *atomhdr;
|
sl@0
|
594 |
mp4_u8 *data;
|
sl@0
|
595 |
} mediaDataAtom;
|
sl@0
|
596 |
|
sl@0
|
597 |
|
sl@0
|
598 |
typedef struct sampleTable
|
sl@0
|
599 |
{
|
sl@0
|
600 |
mp4_u32 currentChunk;
|
sl@0
|
601 |
|
sl@0
|
602 |
/* Decoding time to sample */
|
sl@0
|
603 |
mp4_u32 sttsEntryCount;
|
sl@0
|
604 |
mp4_u32 *sttsSampleCount;
|
sl@0
|
605 |
mp4_u32 *sttsSampleDelta;
|
sl@0
|
606 |
mp4_u32 sttsMaxEntryCount;
|
sl@0
|
607 |
mp4_u32 sttsCurrentEntryCount;
|
sl@0
|
608 |
|
sl@0
|
609 |
/* Sample size */
|
sl@0
|
610 |
mp4_u32 stszSampleSize;
|
sl@0
|
611 |
mp4_u32 stszSampleCount;
|
sl@0
|
612 |
mp4_u32 *stszEntrySize;
|
sl@0
|
613 |
mp4_u32 stszMaxSampleCount;
|
sl@0
|
614 |
mp4_u32 stszCurrentSampleCount;
|
sl@0
|
615 |
|
sl@0
|
616 |
/* Sample to chunk */
|
sl@0
|
617 |
mp4_u32 stscEntryCount;
|
sl@0
|
618 |
mp4_u32 *stscFirstChunk;
|
sl@0
|
619 |
mp4_u32 *stscSamplesPerChunk;
|
sl@0
|
620 |
mp4_u32 *stscSampleDescriptionIndex;
|
sl@0
|
621 |
mp4_u32 stscMaxEntryCount;
|
sl@0
|
622 |
mp4_u32 stscCurrentEntryCount;
|
sl@0
|
623 |
|
sl@0
|
624 |
/* Chunk offset */
|
sl@0
|
625 |
mp4_u32 stcoEntryCount;
|
sl@0
|
626 |
mp4_u64 *stcoChunkOffset;
|
sl@0
|
627 |
mp4_u32 stcoMaxEntryCount;
|
sl@0
|
628 |
mp4_u32 stcoCurrentEntryCount;
|
sl@0
|
629 |
mp4_bool stcoNeed64Bits;
|
sl@0
|
630 |
|
sl@0
|
631 |
/* Sync sample */
|
sl@0
|
632 |
mp4_u32 stssEntryCount;
|
sl@0
|
633 |
mp4_u32 *stssSampleNumber;
|
sl@0
|
634 |
mp4_u32 stssMaxEntryCount;
|
sl@0
|
635 |
mp4_u32 stssCurrentEntryCount;
|
sl@0
|
636 |
/* Sample Dependency */
|
sl@0
|
637 |
mp4_u32 sdtpEntryCount;
|
sl@0
|
638 |
mp4_u8 *sdtpSampleDependency;
|
sl@0
|
639 |
mp4_u32 sdtpMaxEntryCount;
|
sl@0
|
640 |
mp4_u32 sdtpCurrentEntryCount;
|
sl@0
|
641 |
} sampleTable;
|
sl@0
|
642 |
|
sl@0
|
643 |
|
sl@0
|
644 |
typedef struct MP4HandleStruct
|
sl@0
|
645 |
{
|
sl@0
|
646 |
mp4_u8 sourceType; /* Determines the type of the source file (CAF or RFile64) */
|
sl@0
|
647 |
void *file; /* FILE * of possible file */
|
sl@0
|
648 |
void *fs; /* File server */
|
sl@0
|
649 |
void *rfile; /* File handle */
|
sl@0
|
650 |
ContentAccess::CData *cfile; /* used when reading via the CAF and not the file based interfaces */
|
sl@0
|
651 |
mp4_i32 cafError; /* variable to store possible CAF error to be reported to client */
|
sl@0
|
652 |
void *tmpfile; /* FILE * of temporary output file */
|
sl@0
|
653 |
void *metaDataFile[NUM_MDF]; /* File handles for metadata files */
|
sl@0
|
654 |
MP4FileName metaDataFileName[NUM_MDF]; /* Names of the temporary meta data files */
|
sl@0
|
655 |
MP4FileName fileName; /* Name of the file */
|
sl@0
|
656 |
MP4FileName tmpFileName; /* Name of the temporary file */
|
sl@0
|
657 |
mp4_u64 bytesInTmpFile; /* Number of bytes in temporary file */
|
sl@0
|
658 |
mp4_u64 mediaDataBytes; /* Number of media data bytes */
|
sl@0
|
659 |
mp4_bool ftypWritten; /* Has FTYP been written */
|
sl@0
|
660 |
mp4_u32 flags; /* Composing flags */
|
sl@0
|
661 |
mp4_u32 type; /* Type of audio/video */
|
sl@0
|
662 |
list_s *mem; /* Memory list */
|
sl@0
|
663 |
mp4_u32 position; /* Current position in memory */
|
sl@0
|
664 |
mp4_u32 absPosition; /* Current absolute position in memory */
|
sl@0
|
665 |
mp4_u64 lastAccessedPosInFile; /* Last accessed position in a file */
|
sl@0
|
666 |
mp4_u8 *buf; /* Temporary buffer space */
|
sl@0
|
667 |
mp4_u8 *diskReadBuf; /* Memory for file buffering */
|
sl@0
|
668 |
mp4_u32 diskReadPos; /* Reading position in the file */
|
sl@0
|
669 |
mp4_u64 diskReadBufStart; /* Position of the start of the buffer */
|
sl@0
|
670 |
mp4_u32 diskReadBufPos; /* Reading position inside buffer */
|
sl@0
|
671 |
mp4_u32 diskReadSize; /* Number of bytes in buffer */
|
sl@0
|
672 |
mp4_u8 *diskWriteBuf; /* Memory for file buffering */
|
sl@0
|
673 |
mp4_bool ftypRead; /* FTYP atom has been read */
|
sl@0
|
674 |
fileTypeAtom *ftyp; /* Pointer to file type atom structure */
|
sl@0
|
675 |
mp4_bool metaDataComplete; /* Metadata has been completeley read */
|
sl@0
|
676 |
movieAtom *moov; /* Pointer to movie atom structure */
|
sl@0
|
677 |
mp4_u32 videoSampleNum; /* Current video sample number */
|
sl@0
|
678 |
mp4_u64 videoFrameOffset; /* Absolute position of current video frame */
|
sl@0
|
679 |
mp4_u32 videoFrameSize; /* Size of current video frame in bytes */
|
sl@0
|
680 |
mp4_bool videoLast; /* Has last video sample been read */
|
sl@0
|
681 |
mp4_u32 videoTimeScale; /* Video timescale */
|
sl@0
|
682 |
mp4_u64 videoDuration; /* Duration of video when composing */
|
sl@0
|
683 |
mp4_u16 videoWidth; /* Video image width */
|
sl@0
|
684 |
mp4_u16 videoHeight; /* Video image height */
|
sl@0
|
685 |
mp4_u32 videoMaxBitrate; /* MPEG-4 video maximum bitrate */
|
sl@0
|
686 |
mp4_u32 videoAvgBitrate; /* MPEG-4 video average bitrate */
|
sl@0
|
687 |
mp4_u8 *videoDecSpecificInfo; /* MPEG-4 video DecoderSpecificInfo */
|
sl@0
|
688 |
mp4_u32 videoDecSpecificInfoSize; /* MPEG-4 video DecoderSpecificInfo size in bytes */
|
sl@0
|
689 |
sampleTable *videoSampleTable; /* Video sample table */
|
sl@0
|
690 |
mp4_u8 videoLevel; /* Video codec level, default is H.263 level 10 */
|
sl@0
|
691 |
mp4_u32 audioSampleNum; /* Current audio sample number */
|
sl@0
|
692 |
mp4_u32 audioSampleSize; /* Size of current audio sample in bytes */
|
sl@0
|
693 |
mp4_u64 audioSampleOffset; /* Absolute position of current audio frame (in MP4 file) */
|
sl@0
|
694 |
mp4_u32 audioFrameCount; /* Number of audio frames when composing */
|
sl@0
|
695 |
mp4_u32 audioTimeScale; /* Audio timescale */
|
sl@0
|
696 |
mp4_u64 audioDuration; /* Duration of audio when composing */
|
sl@0
|
697 |
mp4_bool audioLast; /* Has last audio sample been read */
|
sl@0
|
698 |
mp4_u8 *audioDecSpecificInfo; /* MPEG audio DecoderSpecificInfo */
|
sl@0
|
699 |
mp4_u32 audioDecSpecificInfoSize; /* MPEG audio DecoderSpecificInfo size in bytes */
|
sl@0
|
700 |
sampleTable *audioSampleTable; /* Audio sample table */
|
sl@0
|
701 |
mp4_u8 audioFramesPerSample; /* AMR frames per sample value */
|
sl@0
|
702 |
mp4_u16 audioModeSet; /* AMR mode set */
|
sl@0
|
703 |
mp4_u32 metaDataBlocks; /* Number of metadata blocks in memory */
|
sl@0
|
704 |
mp4_bool metaDataOnDisk; /* Is (a part of) metadata on the disk */
|
sl@0
|
705 |
mp4_u32 metaDataSize; /* Size of metadata */
|
sl@0
|
706 |
mp4_u32 videoSampleEntryIndex; /* SampleEntry index of the video frame being read */
|
sl@0
|
707 |
mp4_u32 audioSampleEntryIndex; /* SampleEntry index of the audio frame being read */
|
sl@0
|
708 |
mp4_u8 avcNalUnitLengthSize; /* byte size of the length field */
|
sl@0
|
709 |
mp4_bool generate3G2; /* 3GPP2 File Format Generation is Selected: default:FALSE (Generate 3GP)*/
|
sl@0
|
710 |
mp4_bool generateMP4; /* MPEG-4 File Format Generation is Selected: defailt:FALSE (Generate 3GP)*/
|
sl@0
|
711 |
mp4_bool qcelpStoredAsMPEGAudio; /* QCELP 13K is registered as MPEG4 Audio: default: FALSE (in QCELPSampleEntry)*/
|
sl@0
|
712 |
mp4_u64 audioMediaDataSize; /* Total byte size of the written audio data. This is used to calculate the max and avg bitrates */
|
sl@0
|
713 |
mp4_u32 ES_DescriptorSize; /* size of the ES_Descriptor inside the ESDS box */
|
sl@0
|
714 |
|
sl@0
|
715 |
// composeToBuffer:
|
sl@0
|
716 |
mp4_u8 *composeBuffer;
|
sl@0
|
717 |
mp4_bool bufferWrite;
|
sl@0
|
718 |
mp4_u32 bytesProgressed;
|
sl@0
|
719 |
mp4_u32 ftypdelta;
|
sl@0
|
720 |
mp4_u32 *composedSize;
|
sl@0
|
721 |
|
sl@0
|
722 |
CFileWriter* filewriter; /* Async buffering filewriter */
|
sl@0
|
723 |
CMetaDataFileWriter* metadatafilewriter; /* Async buffering metadata temp file writer */
|
sl@0
|
724 |
|
sl@0
|
725 |
mp4_bool LastWriteDataCalled; /* When TRUE, it indicates that ParseWriteData() function is called for the last time */
|
sl@0
|
726 |
mp4_bool FileHandleFromOutside; /* When TRUE file handle is passed to library instead of file name, don't close file in end */
|
sl@0
|
727 |
|
sl@0
|
728 |
mp4_bool metaDataFileEmpty[NUM_MDF]; /* when TRUE it indicates that metadata file has been read and rest of data is in readbuffer of metadatafilewriter */
|
sl@0
|
729 |
|
sl@0
|
730 |
userDataAtom* moovUDTA; // used to compose MOOV UDTA (User Data)
|
sl@0
|
731 |
userDataAtom* audioUDTA; // used to compose AudioTrack UDTA (User Data)
|
sl@0
|
732 |
userDataAtom* videoUDTA; // used to compose VideoTrack UDTA (User Data)
|
sl@0
|
733 |
|
sl@0
|
734 |
TDriveNumber fileHandleDrive; /* Used when we get file handle to library from outside. Used to indicate which drive are metadata temp files written.*/
|
sl@0
|
735 |
|
sl@0
|
736 |
// Custom buffer size additions:
|
sl@0
|
737 |
mp4_u32 mediaWriteBufferSize;
|
sl@0
|
738 |
mp4_u32 metaWriteBufferSize;
|
sl@0
|
739 |
mp4_u32 writeBufferMaxCount;
|
sl@0
|
740 |
mp4_u32 readBufferSize;
|
sl@0
|
741 |
|
sl@0
|
742 |
// Async parsing observer
|
sl@0
|
743 |
M3GPMP4LibAsyncObserver* asyncObserver;
|
sl@0
|
744 |
CFileAsyncParser* asyncReader;
|
sl@0
|
745 |
M3GPMP4LibAsyncTempFileRemoverObserver* tempFileRemoverObserver;
|
sl@0
|
746 |
|
sl@0
|
747 |
void *file32Duplicate; //this is a RFile64 duplicate of the RFile used in Open
|
sl@0
|
748 |
} MP4HandleStruct;
|
sl@0
|
749 |
|
sl@0
|
750 |
|
sl@0
|
751 |
typedef MP4HandleStruct *MP4HandleImp;
|
sl@0
|
752 |
|
sl@0
|
753 |
|
sl@0
|
754 |
mp4_i32 metaDataAvailable(MP4HandleImp handle);
|
sl@0
|
755 |
mp4_i32 readFTYP(MP4HandleImp handle, fileTypeAtom *ftyp);
|
sl@0
|
756 |
mp4_i32 readMetaData(MP4HandleImp handle);
|
sl@0
|
757 |
mp4_i32 readMoov(MP4HandleImp handle, movieAtom *moov);
|
sl@0
|
758 |
mp4_i32 readAtomHeader(MP4HandleImp handle, atomHeader *ah);
|
sl@0
|
759 |
mp4_i32 readFullAtomHeader(MP4HandleImp handle, atomHeader *ah);
|
sl@0
|
760 |
mp4_i32 readMVHD(MP4HandleImp handle, movieHeaderAtom *mvhd);
|
sl@0
|
761 |
mp4_i32 readIODS(MP4HandleImp handle, objectDescriptorAtom *iods);
|
sl@0
|
762 |
mp4_i32 readTRAK(MP4HandleImp handle, trackAtom *trak);
|
sl@0
|
763 |
mp4_i32 readUnknown(MP4HandleImp handle);
|
sl@0
|
764 |
mp4_i32 readTKHD(MP4HandleImp handle, trackHeaderAtom *tkhd);
|
sl@0
|
765 |
mp4_i32 readTREF(MP4HandleImp handle, trackReferenceAtom *tref);
|
sl@0
|
766 |
mp4_i32 readEDTS(MP4HandleImp handle, editListContainerAtom *edts);
|
sl@0
|
767 |
mp4_i32 readMDIA(MP4HandleImp handle, mediaAtom *mdia);
|
sl@0
|
768 |
mp4_i32 readMDHD(MP4HandleImp handle, mediaHeaderAtom *mdhd);
|
sl@0
|
769 |
mp4_i32 readHDLR(MP4HandleImp handle, handlerAtom *hdlr);
|
sl@0
|
770 |
mp4_i32 readMINF(MP4HandleImp handle, mediaInformationAtom *minf);
|
sl@0
|
771 |
mp4_i32 readVMHD(MP4HandleImp handle, videoMediaHeaderAtom *vmhd);
|
sl@0
|
772 |
mp4_i32 readSMHD(MP4HandleImp handle, soundMediaHeaderAtom *smhd);
|
sl@0
|
773 |
mp4_i32 readDINF(MP4HandleImp handle, dataInformationAtom *dinf);
|
sl@0
|
774 |
mp4_i32 readDREF(MP4HandleImp handle, dataReferenceAtom *dref);
|
sl@0
|
775 |
mp4_i32 readURL(MP4HandleImp handle, dataEntryURLAtom *url);
|
sl@0
|
776 |
mp4_i32 readURN(MP4HandleImp handle, dataEntryURNAtom *urn);
|
sl@0
|
777 |
mp4_i32 readSTBL(MP4HandleImp handle, sampleTableAtom *stbl);
|
sl@0
|
778 |
mp4_i32 readSTTS(MP4HandleImp handle, timeToSampleAtom *stts);
|
sl@0
|
779 |
mp4_i32 readCTTS(MP4HandleImp handle, compositionTimeToSampleAtom *ctts);
|
sl@0
|
780 |
mp4_i32 readSTSS(MP4HandleImp handle, syncSampleAtom *stss);
|
sl@0
|
781 |
mp4_i32 readSTSD(MP4HandleImp handle, sampleDescriptionAtom *stsd);
|
sl@0
|
782 |
mp4_i32 readSTSZ(MP4HandleImp handle, sampleSizeAtom *stsz);
|
sl@0
|
783 |
mp4_i32 readSTZ2(MP4HandleImp handle, sampleSizeAtom *stsz);
|
sl@0
|
784 |
mp4_i32 readSTSC(MP4HandleImp handle, sampleToChunkAtom *stsc);
|
sl@0
|
785 |
mp4_i32 readSTCO(MP4HandleImp handle, chunkOffsetAtom *stco);
|
sl@0
|
786 |
mp4_i32 readCO64(MP4HandleImp handle, chunkOffset64Atom *stco64);
|
sl@0
|
787 |
mp4_i32 readMP4V(MP4HandleImp handle, visualSampleEntry *mp4v);
|
sl@0
|
788 |
mp4_i32 readMP4A(MP4HandleImp handle, audioSampleEntry *mp4a);
|
sl@0
|
789 |
mp4_i32 readMP4S(MP4HandleImp handle, mpegSampleEntry *mp4s);
|
sl@0
|
790 |
mp4_i32 readS263(MP4HandleImp handle, h263SampleEntry *s263);
|
sl@0
|
791 |
mp4_i32 readSAMR(MP4HandleImp handle, amrSampleEntry *samr);
|
sl@0
|
792 |
mp4_i32 readSAWB(MP4HandleImp handle, amrSampleEntry *sawb);
|
sl@0
|
793 |
mp4_i32 readESD(MP4HandleImp handle, ESDAtom *esd);
|
sl@0
|
794 |
mp4_i32 readD263(MP4HandleImp handle, h263SpecificAtom *d263);
|
sl@0
|
795 |
mp4_i32 readBITR(MP4HandleImp handle, bitrateAtom *bitr);
|
sl@0
|
796 |
mp4_i32 readDAMR(MP4HandleImp handle, amrDecSpecStruc *damr);
|
sl@0
|
797 |
mp4_i32 readMeta(MP4HandleImp handle, metaAtom *meta);
|
sl@0
|
798 |
/* avc inclusions*/
|
sl@0
|
799 |
mp4_i32 readAVC1(MP4HandleImp handle, avcSampleEntry *avc1);
|
sl@0
|
800 |
mp4_i32 readSDTP(MP4HandleImp handle, sampleDependencyAtom *sdtp, mp4_i32 sample_count);
|
sl@0
|
801 |
/* QCELP 13k inclusions */
|
sl@0
|
802 |
mp4_i32 readSQCP(MP4HandleImp handle, qcelpSampleEntry *sqcp);
|
sl@0
|
803 |
mp4_i32 readDQCP(MP4HandleImp handle, qcelpDecSpecStruc *dqcp);
|
sl@0
|
804 |
/* inline related */
|
sl@0
|
805 |
mp4_i32 readID32(MP4HandleImp handle, ID32Atom *ID32);
|
sl@0
|
806 |
|
sl@0
|
807 |
mp4_i32 freeFTYP(fileTypeAtom *ftyp);
|
sl@0
|
808 |
mp4_i32 freeMOOV(movieAtom *moov);
|
sl@0
|
809 |
mp4_i32 freeAtomHeader(atomHeader *atomhdr);
|
sl@0
|
810 |
mp4_i32 freeMVHD(movieHeaderAtom *mvhd);
|
sl@0
|
811 |
mp4_i32 freeTRAK(trackAtom *trak);
|
sl@0
|
812 |
mp4_i32 freeTKHD(trackHeaderAtom *tkhd);
|
sl@0
|
813 |
mp4_i32 freeTREF(trackReferenceAtom *tref);
|
sl@0
|
814 |
mp4_i32 freeEDTS(editListContainerAtom *edts);
|
sl@0
|
815 |
mp4_i32 freeMDIA(mediaAtom *mdia);
|
sl@0
|
816 |
mp4_i32 freeMDHD(mediaHeaderAtom *mdhd);
|
sl@0
|
817 |
mp4_i32 freeHDLR(handlerAtom *hdlr);
|
sl@0
|
818 |
mp4_i32 freeMINF(mediaInformationAtom *minf);
|
sl@0
|
819 |
mp4_i32 freeVMHD(videoMediaHeaderAtom *vmhd);
|
sl@0
|
820 |
mp4_i32 freeSMHD(soundMediaHeaderAtom *smhd);
|
sl@0
|
821 |
mp4_i32 freeDINF(dataInformationAtom *dinf);
|
sl@0
|
822 |
mp4_i32 freeDREF(dataReferenceAtom *dref);
|
sl@0
|
823 |
mp4_i32 freeURL(dataEntryURLAtom *url);
|
sl@0
|
824 |
mp4_i32 freeURN(dataEntryURNAtom *urn);
|
sl@0
|
825 |
mp4_i32 freeSTBL(sampleTableAtom *stbl);
|
sl@0
|
826 |
mp4_i32 freeSTTS(timeToSampleAtom *stts);
|
sl@0
|
827 |
mp4_i32 freeCTTS(compositionTimeToSampleAtom *ctts);
|
sl@0
|
828 |
mp4_i32 freeSTSD(sampleDescriptionAtom *stsd);
|
sl@0
|
829 |
mp4_i32 freeMP4V(visualSampleEntry *mp4v);
|
sl@0
|
830 |
mp4_i32 freeESD(ESDAtom *esd);
|
sl@0
|
831 |
mp4_i32 freeMP4A(audioSampleEntry *mp4a);
|
sl@0
|
832 |
mp4_i32 freeMP4S(mpegSampleEntry *mp4s);
|
sl@0
|
833 |
mp4_i32 freeS263(h263SampleEntry *s263);
|
sl@0
|
834 |
mp4_i32 freeD263(h263SpecificAtom *d263);
|
sl@0
|
835 |
mp4_i32 freeBITR(bitrateAtom *bitr);
|
sl@0
|
836 |
mp4_i32 freeSAMR(amrSampleEntry *samr);
|
sl@0
|
837 |
mp4_i32 freeSAWB(amrSampleEntry *sawb);
|
sl@0
|
838 |
mp4_i32 freeDAMR(amrDecSpecStruc *damr);
|
sl@0
|
839 |
mp4_i32 freeSTSZ(sampleSizeAtom *stsz);
|
sl@0
|
840 |
mp4_i32 freeSTSC(sampleToChunkAtom *stsc);
|
sl@0
|
841 |
mp4_i32 freeSTCO(chunkOffsetAtom *stco);
|
sl@0
|
842 |
mp4_i32 freeSTCO64(chunkOffset64Atom *stco64);
|
sl@0
|
843 |
mp4_i32 freeSTSS(syncSampleAtom *stss);
|
sl@0
|
844 |
mp4_i32 freeSTSH(shadowSyncSampleAtom *stsh);
|
sl@0
|
845 |
mp4_i32 freeIODS(objectDescriptorAtom *iods);
|
sl@0
|
846 |
mp4_i32 readUDTA(MP4HandleImp handle, userDataAtom *udta);
|
sl@0
|
847 |
mp4_i32 freeUDTA(userDataAtom *udta);
|
sl@0
|
848 |
mp4_i32 freeSDTP(sampleDependencyAtom* sdtp);
|
sl@0
|
849 |
mp4_i32 freeMETA(metaAtom *meta);
|
sl@0
|
850 |
/* The following and AVC related */
|
sl@0
|
851 |
mp4_i32 freeAVC1(avcSampleEntry *avc1);
|
sl@0
|
852 |
mp4_i32 freeM4DS(mpeg4ExtensionDescriptorsAtom *m4ds);
|
sl@0
|
853 |
mp4_i32 freeBTRT(mpeg4BitrateAtom *btrt);
|
sl@0
|
854 |
mp4_i32 freeAVCC(avcConfigurationAtom *avcc);
|
sl@0
|
855 |
/* QCELP 13K related */
|
sl@0
|
856 |
mp4_i32 freeSQCP(qcelpSampleEntry *sqcp);
|
sl@0
|
857 |
mp4_i32 freeDQCP(qcelpDecSpecStruc *dqcp);
|
sl@0
|
858 |
/* inline related */
|
sl@0
|
859 |
mp4_i32 freeID32(ID32Atom *ID32);
|
sl@0
|
860 |
|
sl@0
|
861 |
mp4_i32 determineVideoLength(MP4HandleImp handle, mp4_u32 *videolength);
|
sl@0
|
862 |
mp4_i32 determineFrameRate(MP4HandleImp handle, mp4_double *framerate);
|
sl@0
|
863 |
mp4_i32 determineVideoType(MP4HandleImp handle, mp4_u32 *videotype);
|
sl@0
|
864 |
mp4_i32 determineVideoResolution(MP4HandleImp handle, mp4_u32 *videowidth, mp4_u32 *videoheight);
|
sl@0
|
865 |
mp4_i32 determineVideoTimeScale(MP4HandleImp handle, mp4_u32 *timescale);
|
sl@0
|
866 |
mp4_i32 determineAudioLength(MP4HandleImp handle, mp4_u32 *audiolength);
|
sl@0
|
867 |
mp4_i32 determineAudioType(MP4HandleImp handle, mp4_u32 *audiotype);
|
sl@0
|
868 |
mp4_i32 determineAudioFramesPerSample(MP4HandleImp handle, mp4_u8 *framespersample);
|
sl@0
|
869 |
mp4_i32 determineAudioTimeScale(MP4HandleImp handle, mp4_u32 *timescale);
|
sl@0
|
870 |
mp4_i32 determineAudioAverageBitRate(MP4HandleImp handle, mp4_u32 *averagebitrate);
|
sl@0
|
871 |
mp4_i32 determineStreamSize(MP4HandleImp handle, mp4_u32 *streamsize);
|
sl@0
|
872 |
mp4_i32 determineStreamAverageBitRate(MP4HandleImp handle, mp4_u32 *streamaveragebitrate, mp4_u32 streamsize);
|
sl@0
|
873 |
mp4_i32 advanceVideoFrame(MP4HandleImp handle, trackAtom *trak);
|
sl@0
|
874 |
mp4_i32 resolveVideoSampleOffset(MP4HandleImp handle, sampleTableAtom *stbl);
|
sl@0
|
875 |
mp4_i32 resolveVideoSampleSize(MP4HandleImp handle, sampleSizeAtom *stsz);
|
sl@0
|
876 |
mp4_i32 fetchVideoFrame(MP4HandleImp handle, trackAtom *trak, mp4_u8 *buffer, mp4_u32 buffersize, mp4_u32 *framesize, mp4_u32 *framenumber, mp4_bool *keyframe, mp4_u32 *timestamp2);
|
sl@0
|
877 |
mp4_i32 isVideoFrameKeyFrame(MP4HandleImp handle, trackAtom *trak, mp4_bool *keyframe);
|
sl@0
|
878 |
mp4_i32 convertVideoSampleToTime(MP4HandleImp handle, mediaAtom *mdia, mp4_u32 *framenumber, mp4_u32 *timestamp2);
|
sl@0
|
879 |
mp4_i32 advanceAudioSample(MP4HandleImp handle, trackAtom *trak);
|
sl@0
|
880 |
mp4_i32 resolveAudioSampleOffset(MP4HandleImp handle, sampleTableAtom *stbl);
|
sl@0
|
881 |
mp4_i32 resolveAudioSampleSize(MP4HandleImp handle, sampleSizeAtom *stsz);
|
sl@0
|
882 |
mp4_i32 fetchAudioSample(MP4HandleImp handle, trackAtom *trak, mp4_u8 *buffer, mp4_u32 buffersize, mp4_u32 *framesize, mp4_u32 *timestamp, mp4_u32 *returnedframes, mp4_u32 *timestamp2);
|
sl@0
|
883 |
mp4_i32 convertAudioSampleToTime(MP4HandleImp handle, mediaAtom *mdia, mp4_u32 *timestamp, mp4_u32 *timestamp2);
|
sl@0
|
884 |
mp4_i32 convertTimeToSample(MP4HandleImp handle, trackAtom *trak, mp4_u32 position, mp4_u32 *sample);
|
sl@0
|
885 |
mp4_i32 goToVideoSample(MP4HandleImp handle, trackAtom *trak, mp4_u32 sample);
|
sl@0
|
886 |
mp4_i32 goToAudioSample(MP4HandleImp handle, trackAtom *trak, mp4_u32 sample);
|
sl@0
|
887 |
mp4_i32 findVideoKeyFrame(MP4HandleImp handle, trackAtom *trak, mp4_u32 sample, mp4_u32 *newsample);
|
sl@0
|
888 |
mp4_i32 fetchAudioSampleAsync(MP4HandleImp handle, trackAtom *trak, mp4_u8 *buffer, mp4_u32* buffersize);
|
sl@0
|
889 |
mp4_i32 fetchVideoFrameAsync(MP4HandleImp handle, trackAtom *trak, mp4_u8 *buffer, mp4_u32* buffersize);
|
sl@0
|
890 |
mp4_i64 getChunkOffset(sampleTableAtom *stbl, mp4_u32 index);
|
sl@0
|
891 |
#endif
|
sl@0
|
892 |
|
sl@0
|
893 |
|
sl@0
|
894 |
// End of File
|