~ubuntu-branches/debian/wheezy/vlc/wheezy

« back to all changes in this revision

Viewing changes to extras/faad2/common/mp4v2/mp4.h

Tags: upstream-0.7.2.final
ImportĀ upstreamĀ versionĀ 0.7.2.final

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * The contents of this file are subject to the Mozilla Public
 
3
 * License Version 1.1 (the "License"); you may not use this file
 
4
 * except in compliance with the License. You may obtain a copy of
 
5
 * the License at http://www.mozilla.org/MPL/
 
6
 *
 
7
 * Software distributed under the License is distributed on an "AS
 
8
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
9
 * implied. See the License for the specific language governing
 
10
 * rights and limitations under the License.
 
11
 *
 
12
 * The Original Code is MPEG4IP.
 
13
 *
 
14
 * The Initial Developer of the Original Code is Cisco Systems Inc.
 
15
 * Portions created by Cisco Systems Inc. are
 
16
 * Copyright (C) Cisco Systems Inc. 2001.  All Rights Reserved.
 
17
 *
 
18
 * Contributor(s):
 
19
 *      Dave Mackie         dmackie@cisco.com
 
20
 *      Alix Marchandise-Franquet   alix@cisco.com
 
21
 */
 
22
 
 
23
#ifndef __MP4_INCLUDED__
 
24
#define __MP4_INCLUDED__
 
25
 
 
26
/* include system and project specific headers */
 
27
#include <mpeg4ip.h>
 
28
 
 
29
#include <math.h>   /* to define float HUGE_VAL and/or NAN */
 
30
#ifndef NAN
 
31
#define NAN HUGE_VAL
 
32
#endif
 
33
 
 
34
#ifdef __cplusplus
 
35
/* exploit C++ ability of default values for function parameters */
 
36
#define DEFAULT(x)  =x
 
37
#else
 
38
#define DEFAULT(x)
 
39
#endif
 
40
 
 
41
/* MP4 API types */
 
42
typedef void*       MP4FileHandle;
 
43
typedef u_int32_t   MP4TrackId;
 
44
typedef u_int32_t   MP4SampleId;
 
45
typedef u_int64_t   MP4Timestamp;
 
46
typedef u_int64_t   MP4Duration;
 
47
typedef u_int32_t   MP4EditId;
 
48
 
 
49
/* Invalid values for API types */
 
50
#define MP4_INVALID_FILE_HANDLE ((MP4FileHandle)NULL)
 
51
#define MP4_INVALID_TRACK_ID    ((MP4TrackId)0)
 
52
#define MP4_INVALID_SAMPLE_ID   ((MP4SampleId)0)
 
53
#define MP4_INVALID_TIMESTAMP   ((MP4Timestamp)-1)
 
54
#define MP4_INVALID_DURATION    ((MP4Duration)-1)
 
55
#define MP4_INVALID_EDIT_ID     ((MP4EditId)0)
 
56
 
 
57
/* Macros to test for API type validity */
 
58
#define MP4_IS_VALID_FILE_HANDLE(x) ((x) != MP4_INVALID_FILE_HANDLE)
 
59
#define MP4_IS_VALID_TRACK_ID(x)    ((x) != MP4_INVALID_TRACK_ID)
 
60
#define MP4_IS_VALID_SAMPLE_ID(x)   ((x) != MP4_INVALID_SAMPLE_ID)
 
61
#define MP4_IS_VALID_TIMESTAMP(x)   ((x) != MP4_INVALID_TIMESTAMP)
 
62
#define MP4_IS_VALID_DURATION(x)    ((x) != MP4_INVALID_DURATION)
 
63
#define MP4_IS_VALID_EDIT_ID(x)     ((x) != MP4_INVALID_EDIT_ID)
 
64
 
 
65
/* MP4 verbosity levels - e.g. MP4SetVerbosity() */
 
66
#define MP4_DETAILS_ALL             0xFFFFFFFF
 
67
#define MP4_DETAILS_ERROR           0x00000001
 
68
#define MP4_DETAILS_WARNING         0x00000002
 
69
#define MP4_DETAILS_READ            0x00000004
 
70
#define MP4_DETAILS_WRITE           0x00000008
 
71
#define MP4_DETAILS_FIND            0x00000010
 
72
#define MP4_DETAILS_TABLE           0x00000020
 
73
#define MP4_DETAILS_SAMPLE          0x00000040
 
74
#define MP4_DETAILS_HINT            0x00000080
 
75
#define MP4_DETAILS_ISMA            0x00000100
 
76
#define MP4_DETAILS_EDIT            0x00000200
 
77
 
 
78
#define MP4_DETAILS_READ_ALL        \
 
79
    (MP4_DETAILS_READ | MP4_DETAILS_TABLE | MP4_DETAILS_SAMPLE)
 
80
#define MP4_DETAILS_WRITE_ALL       \
 
81
    (MP4_DETAILS_WRITE | MP4_DETAILS_TABLE | MP4_DETAILS_SAMPLE)
 
82
 
 
83
/*
 
84
 * MP4 Known track type names - e.g. MP4GetNumberOfTracks(type)
 
85
 *
 
86
 * Note this first group of track types should be created
 
87
 * via the MP4Add<Type>Track() functions, and not MP4AddTrack(type)
 
88
 */
 
89
#define MP4_OD_TRACK_TYPE       "odsm"
 
90
#define MP4_SCENE_TRACK_TYPE    "sdsm"
 
91
#define MP4_AUDIO_TRACK_TYPE    "soun"
 
92
#define MP4_VIDEO_TRACK_TYPE    "vide"
 
93
#define MP4_HINT_TRACK_TYPE     "hint"
 
94
/*
 
95
 * This second set of track types should be created
 
96
 * via MP4AddSystemsTrack(type)
 
97
 */
 
98
#define MP4_CLOCK_TRACK_TYPE    "crsm"
 
99
#define MP4_MPEG7_TRACK_TYPE    "m7sm"
 
100
#define MP4_OCI_TRACK_TYPE      "ocsm"
 
101
#define MP4_IPMP_TRACK_TYPE     "ipsm"
 
102
#define MP4_MPEGJ_TRACK_TYPE    "mjsm"
 
103
 
 
104
#define MP4_IS_VIDEO_TRACK_TYPE(type) \
 
105
    (!strcasecmp(type, MP4_VIDEO_TRACK_TYPE))
 
106
 
 
107
#define MP4_IS_AUDIO_TRACK_TYPE(type) \
 
108
    (!strcasecmp(type, MP4_AUDIO_TRACK_TYPE))
 
109
 
 
110
#define MP4_IS_OD_TRACK_TYPE(type) \
 
111
    (!strcasecmp(type, MP4_OD_TRACK_TYPE))
 
112
 
 
113
#define MP4_IS_SCENE_TRACK_TYPE(type) \
 
114
    (!strcasecmp(type, MP4_SCENE_TRACK_TYPE))
 
115
 
 
116
#define MP4_IS_HINT_TRACK_TYPE(type) \
 
117
    (!strcasecmp(type, MP4_HINT_TRACK_TYPE))
 
118
 
 
119
#define MP4_IS_SYSTEMS_TRACK_TYPE(type) \
 
120
    (!strcasecmp(type, MP4_CLOCK_TRACK_TYPE) \
 
121
    || !strcasecmp(type, MP4_MPEG7_TRACK_TYPE) \
 
122
    || !strcasecmp(type, MP4_OCI_TRACK_TYPE) \
 
123
    || !strcasecmp(type, MP4_IPMP_TRACK_TYPE) \
 
124
    || !strcasecmp(type, MP4_MPEGJ_TRACK_TYPE))
 
125
 
 
126
/* MP4 Audio track types - see MP4AddAudioTrack()*/
 
127
#define MP4_INVALID_AUDIO_TYPE          0x00
 
128
#define MP4_MPEG1_AUDIO_TYPE            0x6B
 
129
#define MP4_MPEG2_AUDIO_TYPE            0x69
 
130
#define MP4_MP3_AUDIO_TYPE              MP4_MPEG2_AUDIO_TYPE
 
131
#define MP4_MPEG2_AAC_MAIN_AUDIO_TYPE   0x66
 
132
#define MP4_MPEG2_AAC_LC_AUDIO_TYPE     0x67
 
133
#define MP4_MPEG2_AAC_SSR_AUDIO_TYPE    0x68
 
134
#define MP4_MPEG2_AAC_AUDIO_TYPE        MP4_MPEG2_AAC_MAIN_AUDIO_TYPE
 
135
#define MP4_MPEG4_AUDIO_TYPE            0x40
 
136
#define MP4_PRIVATE_AUDIO_TYPE          0xC0
 
137
#define MP4_PCM16_LITTLE_ENDIAN_AUDIO_TYPE  0xE0    /* a private definition */
 
138
#define MP4_VORBIS_AUDIO_TYPE           0xE1    /* a private definition */
 
139
#define MP4_AC3_AUDIO_TYPE              0xE2    /* a private definition */
 
140
#define MP4_ALAW_AUDIO_TYPE             0xE3    /* a private definition */
 
141
#define MP4_ULAW_AUDIO_TYPE             0xE4    /* a private definition */
 
142
#define MP4_G723_AUDIO_TYPE                             0xE5    /* a private definition */
 
143
#define MP4_PCM16_BIG_ENDIAN_AUDIO_TYPE         0xE6 /* a private definition */
 
144
 
 
145
/* MP4 MPEG-4 Audio types from 14496-3 Table 1.5.1 */
 
146
#define MP4_MPEG4_INVALID_AUDIO_TYPE        0
 
147
#define MP4_MPEG4_AAC_MAIN_AUDIO_TYPE       1
 
148
#define MP4_MPEG4_AAC_LC_AUDIO_TYPE         2
 
149
#define MP4_MPEG4_AAC_SSR_AUDIO_TYPE        3
 
150
#define MP4_MPEG4_AAC_LTP_AUDIO_TYPE        4
 
151
#define MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE   6
 
152
#define MP4_MPEG4_CELP_AUDIO_TYPE           8
 
153
#define MP4_MPEG4_HVXC_AUDIO_TYPE           9
 
154
#define MP4_MPEG4_TTSI_AUDIO_TYPE           12
 
155
#define MP4_MPEG4_MAIN_SYNTHETIC_AUDIO_TYPE 13
 
156
#define MP4_MPEG4_WAVETABLE_AUDIO_TYPE      14
 
157
#define MP4_MPEG4_MIDI_AUDIO_TYPE           15
 
158
#define MP4_MPEG4_ALGORITHMIC_FX_AUDIO_TYPE 16
 
159
 
 
160
/* MP4 Audio type utilities following common usage */
 
161
#define MP4_IS_MP3_AUDIO_TYPE(type) \
 
162
    ((type) == MP4_MPEG1_AUDIO_TYPE || (type) == MP4_MPEG2_AUDIO_TYPE)
 
163
 
 
164
#define MP4_IS_MPEG2_AAC_AUDIO_TYPE(type) \
 
165
    (((type) >= MP4_MPEG2_AAC_MAIN_AUDIO_TYPE \
 
166
        && (type) <= MP4_MPEG2_AAC_SSR_AUDIO_TYPE))
 
167
 
 
168
#define MP4_IS_MPEG4_AAC_AUDIO_TYPE(mpeg4Type) \
 
169
    (((mpeg4Type) >= MP4_MPEG4_AAC_MAIN_AUDIO_TYPE \
 
170
        && (mpeg4Type) <= MP4_MPEG4_AAC_LTP_AUDIO_TYPE) \
 
171
      || (mpeg4Type) == MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE \
 
172
          || (mpeg4Type) == 17)
 
173
 
 
174
#define MP4_IS_AAC_AUDIO_TYPE(type) \
 
175
    (MP4_IS_MPEG2_AAC_AUDIO_TYPE(type) \
 
176
    || (type) == MP4_MPEG4_AUDIO_TYPE)
 
177
 
 
178
/* MP4 Video track types - see MP4AddVideoTrack() */
 
179
#define MP4_INVALID_VIDEO_TYPE          0x00
 
180
#define MP4_MPEG1_VIDEO_TYPE            0x6A
 
181
#define MP4_MPEG2_SIMPLE_VIDEO_TYPE     0x60
 
182
#define MP4_MPEG2_MAIN_VIDEO_TYPE       0x61
 
183
#define MP4_MPEG2_SNR_VIDEO_TYPE        0x62
 
184
#define MP4_MPEG2_SPATIAL_VIDEO_TYPE    0x63
 
185
#define MP4_MPEG2_HIGH_VIDEO_TYPE       0x64
 
186
#define MP4_MPEG2_442_VIDEO_TYPE        0x65
 
187
#define MP4_MPEG2_VIDEO_TYPE            MP4_MPEG2_MAIN_VIDEO_TYPE
 
188
#define MP4_MPEG4_VIDEO_TYPE            0x20
 
189
#define MP4_JPEG_VIDEO_TYPE             0x6C
 
190
#define MP4_PRIVATE_VIDEO_TYPE          0xD0
 
191
#define MP4_YUV12_VIDEO_TYPE            0xF0    /* a private definition */
 
192
#define MP4_H264_VIDEO_TYPE             0xF1    /* a private definition */
 
193
#define MP4_H263_VIDEO_TYPE             0xF2    /* a private definition */
 
194
#define MP4_H261_VIDEO_TYPE             0xF3    /* a private definition */
 
195
 
 
196
/* MP4 Video type utilities */
 
197
#define MP4_IS_MPEG1_VIDEO_TYPE(type) \
 
198
    ((type) == MP4_MPEG1_VIDEO_TYPE)
 
199
 
 
200
#define MP4_IS_MPEG2_VIDEO_TYPE(type) \
 
201
    (((type) >= MP4_MPEG2_SIMPLE_VIDEO_TYPE \
 
202
        && (type) <= MP4_MPEG2_442_VIDEO_TYPE) \
 
203
      || MP4_IS_MPEG1_VIDEO_TYPE(type))
 
204
 
 
205
#define MP4_IS_MPEG4_VIDEO_TYPE(type) \
 
206
    ((type) == MP4_MPEG4_VIDEO_TYPE)
 
207
 
 
208
 
 
209
/* MP4 API declarations */
 
210
 
 
211
#ifdef __cplusplus
 
212
extern "C" {
 
213
#endif
 
214
 
 
215
/* file operations */
 
216
 
 
217
MP4FileHandle MP4Create(
 
218
    const char* fileName,
 
219
    u_int32_t verbosity DEFAULT(0),
 
220
    bool use64bits DEFAULT(0),
 
221
    bool useExtensibleFormat DEFAULT(0));
 
222
 
 
223
MP4FileHandle MP4Modify(
 
224
    const char* fileName,
 
225
    u_int32_t verbosity DEFAULT(0),
 
226
    bool useExtensibleFormat DEFAULT(0));
 
227
 
 
228
MP4FileHandle MP4Read(
 
229
    const char* fileName,
 
230
    u_int32_t verbosity DEFAULT(0));
 
231
 
 
232
bool MP4Close(
 
233
    MP4FileHandle hFile);
 
234
 
 
235
bool MP4Optimize(
 
236
    const char* existingFileName,
 
237
    const char* newFileName DEFAULT(NULL),
 
238
    u_int32_t verbosity DEFAULT(0));
 
239
 
 
240
bool MP4Dump(
 
241
    MP4FileHandle hFile,
 
242
    FILE* pDumpFile DEFAULT(NULL),
 
243
    bool dumpImplicits DEFAULT(0));
 
244
 
 
245
char* MP4Info(
 
246
    MP4FileHandle hFile,
 
247
    MP4TrackId trackId DEFAULT(MP4_INVALID_TRACK_ID));
 
248
 
 
249
char* MP4FileInfo(
 
250
    const char* fileName,
 
251
    MP4TrackId trackId DEFAULT(MP4_INVALID_TRACK_ID));
 
252
 
 
253
/* file properties */
 
254
 
 
255
/* specific file properties */
 
256
 
 
257
u_int32_t MP4GetVerbosity(MP4FileHandle hFile);
 
258
 
 
259
bool MP4SetVerbosity(MP4FileHandle hFile, u_int32_t verbosity);
 
260
 
 
261
MP4Duration MP4GetDuration(MP4FileHandle hFile);
 
262
 
 
263
u_int32_t MP4GetTimeScale(MP4FileHandle hFile);
 
264
 
 
265
bool MP4SetTimeScale(MP4FileHandle hFile, u_int32_t value);
 
266
 
 
267
u_int8_t MP4GetODProfileLevel(MP4FileHandle hFile);
 
268
 
 
269
bool MP4SetODProfileLevel(MP4FileHandle hFile, u_int8_t value);
 
270
 
 
271
u_int8_t MP4GetSceneProfileLevel(MP4FileHandle hFile);
 
272
 
 
273
bool MP4SetSceneProfileLevel(MP4FileHandle hFile, u_int8_t value);
 
274
 
 
275
u_int8_t MP4GetVideoProfileLevel(MP4FileHandle hFile);
 
276
 
 
277
bool MP4SetVideoProfileLevel(MP4FileHandle hFile, u_int8_t value);
 
278
 
 
279
u_int8_t MP4GetAudioProfileLevel(MP4FileHandle hFile);
 
280
 
 
281
bool MP4SetAudioProfileLevel(MP4FileHandle hFile, u_int8_t value);
 
282
 
 
283
u_int8_t MP4GetGraphicsProfileLevel(MP4FileHandle hFile);
 
284
 
 
285
bool MP4SetGraphicsProfileLevel(MP4FileHandle hFile, u_int8_t value);
 
286
 
 
287
/* generic file properties */
 
288
 
 
289
u_int64_t MP4GetIntegerProperty(
 
290
    MP4FileHandle hFile,
 
291
    const char* propName);
 
292
 
 
293
float MP4GetFloatProperty(
 
294
    MP4FileHandle hFile,
 
295
    const char* propName);
 
296
 
 
297
const char* MP4GetStringProperty(
 
298
    MP4FileHandle hFile,
 
299
    const char* propName);
 
300
 
 
301
void MP4GetBytesProperty(
 
302
    MP4FileHandle hFile,
 
303
    const char* propName,
 
304
    u_int8_t** ppValue,
 
305
    u_int32_t* pValueSize);
 
306
 
 
307
bool MP4SetIntegerProperty(
 
308
    MP4FileHandle hFile,
 
309
    const char* propName,
 
310
    int64_t value);
 
311
 
 
312
bool MP4SetFloatProperty(
 
313
    MP4FileHandle hFile,
 
314
    const char* propName,
 
315
    float value);
 
316
 
 
317
bool MP4SetStringProperty(
 
318
    MP4FileHandle hFile, const char* propName, const char* value);
 
319
 
 
320
bool MP4SetBytesProperty(
 
321
    MP4FileHandle hFile, const char* propName,
 
322
    const u_int8_t* pValue, u_int32_t valueSize);
 
323
 
 
324
/* track operations */
 
325
 
 
326
MP4TrackId MP4AddTrack(
 
327
    MP4FileHandle hFile,
 
328
    const char* type);
 
329
 
 
330
MP4TrackId MP4AddSystemsTrack(
 
331
    MP4FileHandle hFile,
 
332
    const char* type);
 
333
 
 
334
MP4TrackId MP4AddODTrack(
 
335
    MP4FileHandle hFile);
 
336
 
 
337
MP4TrackId MP4AddSceneTrack(
 
338
    MP4FileHandle hFile);
 
339
 
 
340
MP4TrackId MP4AddAudioTrack(
 
341
    MP4FileHandle hFile,
 
342
    u_int32_t timeScale,
 
343
    MP4Duration sampleDuration,
 
344
    u_int8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE));
 
345
 
 
346
MP4TrackId MP4AddEncAudioTrack(
 
347
    MP4FileHandle hFile,
 
348
    u_int32_t timeScale,
 
349
    MP4Duration sampleDuration,
 
350
    u_int8_t audioType DEFAULT(MP4_MPEG4_AUDIO_TYPE));
 
351
 
 
352
MP4TrackId MP4AddVideoTrack(
 
353
    MP4FileHandle hFile,
 
354
    u_int32_t timeScale,
 
355
    MP4Duration sampleDuration,
 
356
    u_int16_t width,
 
357
    u_int16_t height,
 
358
    u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE));
 
359
 
 
360
MP4TrackId MP4AddEncVideoTrack(
 
361
    MP4FileHandle hFile,
 
362
    u_int32_t timeScale,
 
363
    MP4Duration sampleDuration,
 
364
    u_int16_t width,
 
365
    u_int16_t height,
 
366
    u_int8_t videoType DEFAULT(MP4_MPEG4_VIDEO_TYPE));
 
367
 
 
368
MP4TrackId MP4AddHintTrack(
 
369
    MP4FileHandle hFile,
 
370
    MP4TrackId refTrackId);
 
371
 
 
372
MP4TrackId MP4CloneTrack(
 
373
    MP4FileHandle srcFile,
 
374
    MP4TrackId srcTrackId,
 
375
    MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE));
 
376
 
 
377
MP4TrackId MP4EncAndCloneTrack(
 
378
    MP4FileHandle srcFile,
 
379
    MP4TrackId srcTrackId,
 
380
    MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE));
 
381
 
 
382
MP4TrackId MP4CopyTrack(
 
383
    MP4FileHandle srcFile,
 
384
    MP4TrackId srcTrackId,
 
385
    MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
 
386
    bool applyEdits DEFAULT(false));
 
387
 
 
388
MP4TrackId MP4EncAndCopyTrack(
 
389
    MP4FileHandle srcFile,
 
390
    MP4TrackId srcTrackId,
 
391
    MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
 
392
    bool applyEdits DEFAULT(false));
 
393
 
 
394
bool MP4DeleteTrack(
 
395
    MP4FileHandle hFile,
 
396
    MP4TrackId trackId);
 
397
 
 
398
u_int32_t MP4GetNumberOfTracks(
 
399
    MP4FileHandle hFile,
 
400
    const char* type DEFAULT(NULL),
 
401
    u_int8_t subType DEFAULT(0));
 
402
 
 
403
MP4TrackId MP4FindTrackId(
 
404
    MP4FileHandle hFile,
 
405
    u_int16_t index,
 
406
    const char* type DEFAULT(NULL),
 
407
    u_int8_t subType DEFAULT(0));
 
408
 
 
409
u_int16_t MP4FindTrackIndex(
 
410
    MP4FileHandle hFile,
 
411
    MP4TrackId trackId);
 
412
 
 
413
/* track properties */
 
414
 
 
415
/* specific track properties */
 
416
 
 
417
const char* MP4GetTrackType(
 
418
    MP4FileHandle hFile,
 
419
    MP4TrackId trackId);
 
420
 
 
421
MP4Duration MP4GetTrackDuration(
 
422
    MP4FileHandle hFile,
 
423
    MP4TrackId trackId);
 
424
 
 
425
u_int32_t MP4GetTrackTimeScale(
 
426
    MP4FileHandle hFile,
 
427
    MP4TrackId trackId);
 
428
 
 
429
bool MP4SetTrackTimeScale(
 
430
    MP4FileHandle hFile,
 
431
    MP4TrackId trackId,
 
432
    u_int32_t value);
 
433
 
 
434
// Should not be used, replace with MP4GetTrackEsdsObjectTypeId
 
435
u_int8_t MP4GetTrackAudioType(
 
436
    MP4FileHandle hFile,
 
437
    MP4TrackId trackId);
 
438
 
 
439
u_int8_t MP4GetTrackAudioMpeg4Type(
 
440
    MP4FileHandle hFile,
 
441
    MP4TrackId trackId);
 
442
 
 
443
// Should not be used, replace with MP4GetTrackEsdsObjectTypeId
 
444
u_int8_t MP4GetTrackVideoType(
 
445
    MP4FileHandle hFile,
 
446
    MP4TrackId trackId);
 
447
 
 
448
u_int8_t MP4GetTrackEsdsObjectTypeId(
 
449
    MP4FileHandle hFile,
 
450
    MP4TrackId trackId);
 
451
 
 
452
/* returns MP4_INVALID_DURATION if track samples do not have a fixed duration */
 
453
MP4Duration MP4GetTrackFixedSampleDuration(
 
454
    MP4FileHandle hFile,
 
455
    MP4TrackId trackId);
 
456
 
 
457
u_int32_t MP4GetTrackBitRate(
 
458
    MP4FileHandle hFile,
 
459
    MP4TrackId trackId);
 
460
 
 
461
bool MP4GetTrackESConfiguration(
 
462
    MP4FileHandle hFile,
 
463
    MP4TrackId trackId,
 
464
    u_int8_t** ppConfig,
 
465
    u_int32_t* pConfigSize);
 
466
 
 
467
bool MP4SetTrackESConfiguration(
 
468
    MP4FileHandle hFile,
 
469
    MP4TrackId trackId,
 
470
    const u_int8_t* pConfig,
 
471
    u_int32_t configSize);
 
472
 
 
473
MP4SampleId MP4GetTrackNumberOfSamples(
 
474
    MP4FileHandle hFile,
 
475
    MP4TrackId trackId);
 
476
 
 
477
u_int16_t MP4GetTrackVideoWidth(
 
478
    MP4FileHandle hFile,
 
479
    MP4TrackId trackId);
 
480
 
 
481
u_int16_t MP4GetTrackVideoHeight(
 
482
    MP4FileHandle hFile,
 
483
    MP4TrackId trackId);
 
484
 
 
485
float MP4GetTrackVideoFrameRate(
 
486
    MP4FileHandle hFile,
 
487
    MP4TrackId trackId);
 
488
 
 
489
/* generic track properties */
 
490
 
 
491
u_int64_t MP4GetTrackIntegerProperty(
 
492
    MP4FileHandle hFile,
 
493
    MP4TrackId trackId,
 
494
    const char* propName);
 
495
 
 
496
float MP4GetTrackFloatProperty(
 
497
    MP4FileHandle hFile,
 
498
    MP4TrackId trackId,
 
499
    const char* propName);
 
500
 
 
501
const char* MP4GetTrackStringProperty(
 
502
    MP4FileHandle hFile,
 
503
    MP4TrackId trackId,
 
504
    const char* propName);
 
505
 
 
506
void MP4GetTrackBytesProperty(
 
507
    MP4FileHandle hFile,
 
508
    MP4TrackId trackId,
 
509
    const char* propName,
 
510
    u_int8_t** ppValue,
 
511
    u_int32_t* pValueSize);
 
512
 
 
513
bool MP4SetTrackIntegerProperty(
 
514
    MP4FileHandle hFile,
 
515
    MP4TrackId trackId,
 
516
    const char* propName,
 
517
    int64_t value);
 
518
 
 
519
bool MP4SetTrackFloatProperty(
 
520
    MP4FileHandle hFile,
 
521
    MP4TrackId trackId,
 
522
    const char* propName,
 
523
    float value);
 
524
 
 
525
bool MP4SetTrackStringProperty(
 
526
    MP4FileHandle hFile,
 
527
    MP4TrackId trackId,
 
528
    const char* propName,
 
529
    const char* value);
 
530
 
 
531
bool MP4SetTrackBytesProperty(
 
532
    MP4FileHandle hFile,
 
533
    MP4TrackId trackId,
 
534
    const char* propName,
 
535
    const u_int8_t* pValue,
 
536
    u_int32_t valueSize);
 
537
 
 
538
/* sample operations */
 
539
 
 
540
bool MP4ReadSample(
 
541
    /* input parameters */
 
542
    MP4FileHandle hFile,
 
543
    MP4TrackId trackId,
 
544
    MP4SampleId sampleId,
 
545
    /* input/output parameters */
 
546
    u_int8_t** ppBytes,
 
547
    u_int32_t* pNumBytes,
 
548
    /* output parameters */
 
549
    MP4Timestamp* pStartTime DEFAULT(NULL),
 
550
    MP4Duration* pDuration DEFAULT(NULL),
 
551
    MP4Duration* pRenderingOffset DEFAULT(NULL),
 
552
    bool* pIsSyncSample DEFAULT(NULL));
 
553
 
 
554
/* uses (unedited) time to specify sample instead of sample id */
 
555
bool MP4ReadSampleFromTime(
 
556
    /* input parameters */
 
557
    MP4FileHandle hFile,
 
558
    MP4TrackId trackId,
 
559
    MP4Timestamp when,
 
560
    /* input/output parameters */
 
561
    u_int8_t** ppBytes,
 
562
    u_int32_t* pNumBytes,
 
563
    /* output parameters */
 
564
    MP4Timestamp* pStartTime DEFAULT(NULL),
 
565
    MP4Duration* pDuration DEFAULT(NULL),
 
566
    MP4Duration* pRenderingOffset DEFAULT(NULL),
 
567
    bool* pIsSyncSample DEFAULT(NULL));
 
568
 
 
569
bool MP4WriteSample(
 
570
    MP4FileHandle hFile,
 
571
    MP4TrackId trackId,
 
572
    const u_int8_t* pBytes,
 
573
    u_int32_t numBytes,
 
574
    MP4Duration duration DEFAULT(MP4_INVALID_DURATION),
 
575
    MP4Duration renderingOffset DEFAULT(0),
 
576
    bool isSyncSample DEFAULT(true));
 
577
 
 
578
bool MP4CopySample(
 
579
    MP4FileHandle srcFile,
 
580
    MP4TrackId srcTrackId,
 
581
    MP4SampleId srcSampleId,
 
582
    MP4FileHandle dstFile DEFAULT(MP4_INVALID_FILE_HANDLE),
 
583
    MP4TrackId dstTrackId DEFAULT(MP4_INVALID_TRACK_ID),
 
584
    MP4Duration dstSampleDuration DEFAULT(MP4_INVALID_DURATION));
 
585
 
 
586
/* Note this function is not yet implemented */
 
587
bool MP4ReferenceSample(
 
588
    MP4FileHandle srcFile,
 
589
    MP4TrackId srcTrackId,
 
590
    MP4SampleId srcSampleId,
 
591
    MP4FileHandle dstFile,
 
592
    MP4TrackId dstTrackId,
 
593
    MP4Duration dstSampleDuration DEFAULT(MP4_INVALID_DURATION));
 
594
 
 
595
u_int32_t MP4GetSampleSize(
 
596
    MP4FileHandle hFile,
 
597
    MP4TrackId trackId,
 
598
    MP4SampleId sampleId);
 
599
 
 
600
u_int32_t MP4GetTrackMaxSampleSize(
 
601
    MP4FileHandle hFile,
 
602
    MP4TrackId trackId);
 
603
 
 
604
MP4SampleId MP4GetSampleIdFromTime(
 
605
    MP4FileHandle hFile,
 
606
    MP4TrackId trackId,
 
607
    MP4Timestamp when,
 
608
    bool wantSyncSample DEFAULT(false));
 
609
 
 
610
MP4Timestamp MP4GetSampleTime(
 
611
    MP4FileHandle hFile,
 
612
    MP4TrackId trackId,
 
613
    MP4SampleId sampleId);
 
614
 
 
615
MP4Duration MP4GetSampleDuration(
 
616
    MP4FileHandle hFile,
 
617
    MP4TrackId trackId,
 
618
    MP4SampleId sampleId);
 
619
 
 
620
MP4Duration MP4GetSampleRenderingOffset(
 
621
    MP4FileHandle hFile,
 
622
    MP4TrackId trackId,
 
623
    MP4SampleId sampleId);
 
624
 
 
625
bool MP4SetSampleRenderingOffset(
 
626
    MP4FileHandle hFile,
 
627
    MP4TrackId trackId,
 
628
    MP4SampleId sampleId,
 
629
    MP4Duration renderingOffset);
 
630
 
 
631
int8_t MP4GetSampleSync(
 
632
    MP4FileHandle hFile,
 
633
    MP4TrackId trackId,
 
634
    MP4SampleId sampleId);
 
635
 
 
636
/* rtp hint track operations */
 
637
 
 
638
bool MP4GetHintTrackRtpPayload(
 
639
    MP4FileHandle hFile,
 
640
    MP4TrackId hintTrackId,
 
641
    char** ppPayloadName DEFAULT(NULL),
 
642
    u_int8_t* pPayloadNumber DEFAULT(NULL),
 
643
    u_int16_t* pMaxPayloadSize DEFAULT(NULL),
 
644
    char **ppEncodingParams DEFAULT(NULL));
 
645
 
 
646
#define MP4_SET_DYNAMIC_PAYLOAD 0xff
 
647
 
 
648
bool MP4SetHintTrackRtpPayload(
 
649
    MP4FileHandle hFile,
 
650
    MP4TrackId hintTrackId,
 
651
    const char* pPayloadName,
 
652
    u_int8_t* pPayloadNumber,
 
653
    u_int16_t maxPayloadSize DEFAULT(0),
 
654
    const char *encode_params DEFAULT(NULL),
 
655
    bool include_rtp_map DEFAULT(true),
 
656
    bool include_mpeg4_esid DEFAULT(true));
 
657
 
 
658
const char* MP4GetSessionSdp(
 
659
    MP4FileHandle hFile);
 
660
 
 
661
bool MP4SetSessionSdp(
 
662
    MP4FileHandle hFile,
 
663
    const char* sdpString);
 
664
 
 
665
bool MP4AppendSessionSdp(
 
666
    MP4FileHandle hFile,
 
667
    const char* sdpString);
 
668
 
 
669
const char* MP4GetHintTrackSdp(
 
670
    MP4FileHandle hFile,
 
671
    MP4TrackId hintTrackId);
 
672
 
 
673
bool MP4SetHintTrackSdp(
 
674
    MP4FileHandle hFile,
 
675
    MP4TrackId hintTrackId,
 
676
    const char* sdpString);
 
677
 
 
678
bool MP4AppendHintTrackSdp(
 
679
    MP4FileHandle hFile,
 
680
    MP4TrackId hintTrackId,
 
681
    const char* sdpString);
 
682
 
 
683
MP4TrackId MP4GetHintTrackReferenceTrackId(
 
684
    MP4FileHandle hFile,
 
685
    MP4TrackId hintTrackId);
 
686
 
 
687
bool MP4ReadRtpHint(
 
688
    MP4FileHandle hFile,
 
689
    MP4TrackId hintTrackId,
 
690
    MP4SampleId hintSampleId,
 
691
    u_int16_t* pNumPackets DEFAULT(NULL));
 
692
 
 
693
u_int16_t MP4GetRtpHintNumberOfPackets(
 
694
    MP4FileHandle hFile,
 
695
    MP4TrackId hintTrackId);
 
696
 
 
697
int8_t MP4GetRtpPacketBFrame(
 
698
    MP4FileHandle hFile,
 
699
    MP4TrackId hintTrackId,
 
700
    u_int16_t packetIndex);
 
701
 
 
702
int32_t MP4GetRtpPacketTransmitOffset(
 
703
    MP4FileHandle hFile,
 
704
    MP4TrackId hintTrackId,
 
705
    u_int16_t packetIndex);
 
706
 
 
707
bool MP4ReadRtpPacket(
 
708
    MP4FileHandle hFile,
 
709
    MP4TrackId hintTrackId,
 
710
    u_int16_t packetIndex,
 
711
    u_int8_t** ppBytes,
 
712
    u_int32_t* pNumBytes,
 
713
    u_int32_t ssrc DEFAULT(0),
 
714
    bool includeHeader DEFAULT(true),
 
715
    bool includePayload DEFAULT(true));
 
716
 
 
717
MP4Timestamp MP4GetRtpTimestampStart(
 
718
    MP4FileHandle hFile,
 
719
    MP4TrackId hintTrackId);
 
720
 
 
721
bool MP4SetRtpTimestampStart(
 
722
    MP4FileHandle hFile,
 
723
    MP4TrackId hintTrackId,
 
724
    MP4Timestamp rtpStart);
 
725
 
 
726
bool MP4AddRtpHint(
 
727
    MP4FileHandle hFile,
 
728
    MP4TrackId hintTrackId);
 
729
 
 
730
bool MP4AddRtpVideoHint(
 
731
    MP4FileHandle hFile,
 
732
    MP4TrackId hintTrackId,
 
733
    bool isBframe DEFAULT(false),
 
734
    u_int32_t timestampOffset DEFAULT(0));
 
735
 
 
736
bool MP4AddRtpPacket(
 
737
    MP4FileHandle hFile,
 
738
    MP4TrackId hintTrackId,
 
739
    bool setMbit DEFAULT(false),
 
740
    int32_t transmitOffset DEFAULT(0));
 
741
 
 
742
bool MP4AddRtpImmediateData(
 
743
    MP4FileHandle hFile,
 
744
    MP4TrackId hintTrackId,
 
745
    const u_int8_t* pBytes,
 
746
    u_int32_t numBytes);
 
747
 
 
748
bool MP4AddRtpSampleData(
 
749
    MP4FileHandle hFile,
 
750
    MP4TrackId hintTrackId,
 
751
    MP4SampleId sampleId,
 
752
    u_int32_t dataOffset,
 
753
    u_int32_t dataLength);
 
754
 
 
755
bool MP4AddRtpESConfigurationPacket(
 
756
    MP4FileHandle hFile,
 
757
    MP4TrackId hintTrackId);
 
758
 
 
759
bool MP4WriteRtpHint(
 
760
    MP4FileHandle hFile,
 
761
    MP4TrackId hintTrackId,
 
762
    MP4Duration duration,
 
763
    bool isSyncSample DEFAULT(true));
 
764
 
 
765
/* ISMA specific utilities */
 
766
 
 
767
bool MP4MakeIsmaCompliant(const char* fileName,
 
768
    u_int32_t verbosity DEFAULT(0),
 
769
    bool addIsmaComplianceSdp DEFAULT(true));
 
770
 
 
771
char* MP4MakeIsmaSdpIod(
 
772
    u_int8_t videoProfile,
 
773
    u_int32_t videoBitrate,
 
774
    u_int8_t* videoConfig,
 
775
    u_int32_t videoConfigLength,
 
776
    u_int8_t audioProfile,
 
777
    u_int32_t audioBitrate,
 
778
    u_int8_t* audioConfig,
 
779
    u_int32_t audioConfigLength,
 
780
    u_int32_t verbosity DEFAULT(0));
 
781
 
 
782
/* edit list */
 
783
 
 
784
/* NOTE this section of functionality
 
785
 * has not yet been fully tested
 
786
 */
 
787
 
 
788
MP4EditId MP4AddTrackEdit(
 
789
    MP4FileHandle hFile,
 
790
    MP4TrackId trackId,
 
791
    MP4EditId editId DEFAULT(MP4_INVALID_EDIT_ID),
 
792
    MP4Timestamp startTime DEFAULT(0),
 
793
    MP4Duration duration DEFAULT(0),
 
794
    bool dwell DEFAULT(false));
 
795
 
 
796
bool MP4DeleteTrackEdit(
 
797
    MP4FileHandle hFile,
 
798
    MP4TrackId trackId,
 
799
    MP4EditId editId);
 
800
 
 
801
u_int32_t MP4GetTrackNumberOfEdits(
 
802
    MP4FileHandle hFile,
 
803
    MP4TrackId trackId);
 
804
 
 
805
MP4Timestamp MP4GetTrackEditStart(
 
806
    MP4FileHandle hFile,
 
807
    MP4TrackId trackId,
 
808
    MP4EditId editId);
 
809
 
 
810
MP4Duration MP4GetTrackEditTotalDuration(
 
811
    MP4FileHandle hFile,
 
812
    MP4TrackId trackId,
 
813
    MP4EditId editId DEFAULT(MP4_INVALID_EDIT_ID));
 
814
 
 
815
MP4Timestamp MP4GetTrackEditMediaStart(
 
816
    MP4FileHandle hFile,
 
817
    MP4TrackId trackId,
 
818
    MP4EditId editId);
 
819
 
 
820
bool MP4SetTrackEditMediaStart(
 
821
    MP4FileHandle hFile,
 
822
    MP4TrackId trackId,
 
823
    MP4EditId editId,
 
824
    MP4Timestamp startTime);
 
825
 
 
826
MP4Duration MP4GetTrackEditDuration(
 
827
    MP4FileHandle hFile,
 
828
    MP4TrackId trackId,
 
829
    MP4EditId editId);
 
830
 
 
831
bool MP4SetTrackEditDuration(
 
832
    MP4FileHandle hFile,
 
833
    MP4TrackId trackId,
 
834
    MP4EditId editId,
 
835
    MP4Duration duration);
 
836
 
 
837
int8_t MP4GetTrackEditDwell(
 
838
    MP4FileHandle hFile,
 
839
    MP4TrackId trackId,
 
840
    MP4EditId editId);
 
841
 
 
842
bool MP4SetTrackEditDwell(
 
843
    MP4FileHandle hFile,
 
844
    MP4TrackId trackId,
 
845
    MP4EditId editId,
 
846
    bool dwell);
 
847
 
 
848
bool MP4ReadSampleFromEditTime(
 
849
    /* input parameters */
 
850
    MP4FileHandle hFile,
 
851
    MP4TrackId trackId,
 
852
    MP4Timestamp when,
 
853
    /* input/output parameters */
 
854
    u_int8_t** ppBytes,
 
855
    u_int32_t* pNumBytes,
 
856
    /* output parameters */
 
857
    MP4Timestamp* pStartTime DEFAULT(NULL),
 
858
    MP4Duration* pDuration DEFAULT(NULL),
 
859
    MP4Duration* pRenderingOffset DEFAULT(NULL),
 
860
    bool* pIsSyncSample DEFAULT(NULL));
 
861
 
 
862
MP4SampleId MP4GetSampleIdFromEditTime(
 
863
    MP4FileHandle hFile,
 
864
    MP4TrackId trackId,
 
865
    MP4Timestamp when,
 
866
    MP4Timestamp* pStartTime DEFAULT(NULL),
 
867
    MP4Duration* pDuration DEFAULT(NULL));
 
868
 
 
869
/* time conversion utilties */
 
870
 
 
871
/* predefined values for timeScale parameter below */
 
872
#define MP4_SECONDS_TIME_SCALE      1
 
873
#define MP4_MILLISECONDS_TIME_SCALE 1000
 
874
#define MP4_MICROSECONDS_TIME_SCALE 1000000
 
875
#define MP4_NANOSECONDS_TIME_SCALE  1000000000
 
876
 
 
877
#define MP4_SECS_TIME_SCALE     MP4_SECONDS_TIME_SCALE
 
878
#define MP4_MSECS_TIME_SCALE    MP4_MILLISECONDS_TIME_SCALE
 
879
#define MP4_USECS_TIME_SCALE    MP4_MICROSECONDS_TIME_SCALE
 
880
#define MP4_NSECS_TIME_SCALE    MP4_NANOSECONDS_TIME_SCALE
 
881
 
 
882
u_int64_t MP4ConvertFromMovieDuration(
 
883
    MP4FileHandle hFile,
 
884
    MP4Duration duration,
 
885
    u_int32_t timeScale);
 
886
 
 
887
u_int64_t MP4ConvertFromTrackTimestamp(
 
888
    MP4FileHandle hFile,
 
889
    MP4TrackId trackId,
 
890
    MP4Timestamp timeStamp,
 
891
    u_int32_t timeScale);
 
892
 
 
893
MP4Timestamp MP4ConvertToTrackTimestamp(
 
894
    MP4FileHandle hFile,
 
895
    MP4TrackId trackId,
 
896
    u_int64_t timeStamp,
 
897
    u_int32_t timeScale);
 
898
 
 
899
u_int64_t MP4ConvertFromTrackDuration(
 
900
    MP4FileHandle hFile,
 
901
    MP4TrackId trackId,
 
902
    MP4Duration duration,
 
903
    u_int32_t timeScale);
 
904
 
 
905
MP4Duration MP4ConvertToTrackDuration(
 
906
    MP4FileHandle hFile,
 
907
    MP4TrackId trackId,
 
908
    u_int64_t duration,
 
909
    u_int32_t timeScale);
 
910
 
 
911
char* MP4BinaryToBase16(
 
912
    const u_int8_t* pData,
 
913
    u_int32_t dataSize);
 
914
 
 
915
char* MP4BinaryToBase64(
 
916
    const u_int8_t* pData,
 
917
    u_int32_t dataSize);
 
918
 
 
919
/* iTunes metadata handling */
 
920
bool MP4MetadataDelete(MP4FileHandle hFile);
 
921
bool MP4GetMetadataByIndex(MP4FileHandle hFile, u_int32_t index,
 
922
                           const char** ppName,
 
923
                           u_int8_t** ppValue, u_int32_t* pValueSize);
 
924
bool MP4SetMetadataName(MP4FileHandle hFile, const char* value);
 
925
bool MP4GetMetadataName(MP4FileHandle hFile, char** value);
 
926
bool MP4SetMetadataArtist(MP4FileHandle hFile, const char* value);
 
927
bool MP4GetMetadataArtist(MP4FileHandle hFile, char** value);
 
928
bool MP4SetMetadataWriter(MP4FileHandle hFile, const char* value);
 
929
bool MP4GetMetadataWriter(MP4FileHandle hFile, char** value);
 
930
bool MP4SetMetadataComment(MP4FileHandle hFile, const char* value);
 
931
bool MP4GetMetadataComment(MP4FileHandle hFile, char** value);
 
932
bool MP4SetMetadataTool(MP4FileHandle hFile, const char* value);
 
933
bool MP4GetMetadataTool(MP4FileHandle hFile, char** value);
 
934
bool MP4SetMetadataYear(MP4FileHandle hFile, const char* value);
 
935
bool MP4GetMetadataYear(MP4FileHandle hFile, char** value);
 
936
bool MP4SetMetadataAlbum(MP4FileHandle hFile, const char* value);
 
937
bool MP4GetMetadataAlbum(MP4FileHandle hFile, char** value);
 
938
bool MP4SetMetadataTrack(MP4FileHandle hFile,
 
939
                         u_int16_t track, u_int16_t totalTracks);
 
940
bool MP4GetMetadataTrack(MP4FileHandle hFile,
 
941
                         u_int16_t* track, u_int16_t* totalTracks);
 
942
bool MP4SetMetadataDisk(MP4FileHandle hFile,
 
943
                        u_int16_t disk, u_int16_t totalDisks);
 
944
bool MP4GetMetadataDisk(MP4FileHandle hFile,
 
945
                        u_int16_t* disk, u_int16_t* totalDisks);
 
946
bool MP4SetMetadataGenre(MP4FileHandle hFile, const char* genre);
 
947
bool MP4GetMetadataGenre(MP4FileHandle hFile, char** genre);
 
948
bool MP4SetMetadataTempo(MP4FileHandle hFile, u_int16_t tempo);
 
949
bool MP4GetMetadataTempo(MP4FileHandle hFile, u_int16_t* tempo);
 
950
bool MP4SetMetadataCompilation(MP4FileHandle hFile, u_int8_t cpl);
 
951
bool MP4GetMetadataCompilation(MP4FileHandle hFile, u_int8_t* cpl);
 
952
bool MP4SetMetadataCoverArt(MP4FileHandle hFile,
 
953
                            u_int8_t *coverArt, u_int32_t size);
 
954
bool MP4GetMetadataCoverArt(MP4FileHandle hFile,
 
955
                            u_int8_t **coverArt, u_int32_t* size);
 
956
bool MP4SetMetadataFreeForm(MP4FileHandle hFile, char *name,
 
957
                            u_int8_t* pValue, u_int32_t valueSize);
 
958
bool MP4GetMetadataFreeForm(MP4FileHandle hFile, char *name,
 
959
                            u_int8_t** pValue, u_int32_t* valueSize);
 
960
 
 
961
//#ifdef USE_FILE_CALLBACKS
 
962
typedef u_int32_t (*MP4OpenCallback)(const char *pName, const char *mode, void *userData);
 
963
typedef void (*MP4CloseCallback)(void *userData);
 
964
typedef u_int32_t (*MP4ReadCallback)(void *pBuffer, unsigned int nBytesToRead, void *userData);
 
965
typedef u_int32_t (*MP4WriteCallback)(void *pBuffer, unsigned int nBytesToWrite, void *userData);
 
966
typedef int32_t (*MP4SetposCallback)(u_int32_t pos, void *userData);
 
967
typedef int64_t (*MP4GetposCallback)(void *userData);
 
968
typedef int64_t (*MP4FilesizeCallback)(void *userData);
 
969
 
 
970
MP4FileHandle MP4CreateCb(u_int32_t verbosity,
 
971
                          bool use64bits,
 
972
                          bool useExtensibleFormat,
 
973
                          MP4OpenCallback MP4fopen,
 
974
                          MP4CloseCallback MP4fclose,
 
975
                          MP4ReadCallback MP4fread,
 
976
                          MP4WriteCallback MP4fwrite,
 
977
                          MP4SetposCallback MP4fsetpos,
 
978
                          MP4GetposCallback MP4fgetpos,
 
979
                          MP4FilesizeCallback MP4filesize,
 
980
                          void *userData);
 
981
 
 
982
MP4FileHandle MP4ReadCb(u_int32_t verbosity,
 
983
                        MP4OpenCallback MP4fopen,
 
984
                        MP4CloseCallback MP4fclose,
 
985
                        MP4ReadCallback MP4fread,
 
986
                        MP4WriteCallback MP4fwrite,
 
987
                        MP4SetposCallback MP4fsetpos,
 
988
                        MP4GetposCallback MP4fgetpos,
 
989
                        MP4FilesizeCallback MP4filesize,
 
990
                        void *userData);
 
991
MP4FileHandle MP4ModifyCb(int32_t verbosity,
 
992
                          bool useExtensibleFormat,
 
993
                          MP4OpenCallback MP4fopen, MP4CloseCallback MP4fclose,
 
994
                          MP4ReadCallback MP4fread, MP4WriteCallback MP4fwrite,
 
995
                          MP4SetposCallback MP4fsetpos, MP4GetposCallback MP4fgetpos,
 
996
                          MP4FilesizeCallback MP4filesize, void *userData);
 
997
//#endif
 
998
 
 
999
#ifdef __cplusplus
 
1000
}
 
1001
#endif
 
1002
 
 
1003
/* undefined our utlity macro to avoid conflicts */
 
1004
#undef DEFAULT
 
1005
 
 
1006
#endif /* __MP4_INCLUDED__ */