Mercurial > audlegacy
comparison Plugins/Input/aac/libmp4v2/mp4.h @ 201:f2dc045d2327 trunk
[svn] libmp4v2 goes back to the future
author | chainsaw |
---|---|
date | Thu, 17 Nov 2005 14:01:18 -0800 |
parents | 0a2ad94e8607 |
children |
comparison
equal
deleted
inserted
replaced
200:094ef8a0a9fd | 201:f2dc045d2327 |
---|---|
11 * | 11 * |
12 * The Original Code is MPEG4IP. | 12 * The Original Code is MPEG4IP. |
13 * | 13 * |
14 * The Initial Developer of the Original Code is Cisco Systems Inc. | 14 * The Initial Developer of the Original Code is Cisco Systems Inc. |
15 * Portions created by Cisco Systems Inc. are | 15 * Portions created by Cisco Systems Inc. are |
16 * Copyright (C) Cisco Systems Inc. 2001 - 2004. All Rights Reserved. | 16 * Copyright (C) Cisco Systems Inc. 2001 - 2005. All Rights Reserved. |
17 * | 17 * |
18 * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, | 18 * 3GPP features implementation is based on 3GPP's TS26.234-v5.60, |
19 * and was contributed by Ximpo Group Ltd. | 19 * and was contributed by Ximpo Group Ltd. |
20 * | 20 * |
21 * Portions created by Ximpo Group Ltd. are | 21 * Portions created by Ximpo Group Ltd. are |
23 * | 23 * |
24 * Contributor(s): | 24 * Contributor(s): |
25 * Dave Mackie dmackie@cisco.com | 25 * Dave Mackie dmackie@cisco.com |
26 * Alix Marchandise-Franquet alix@cisco.com | 26 * Alix Marchandise-Franquet alix@cisco.com |
27 * Ximpo Group Ltd. mp4v2@ximpo.com | 27 * Ximpo Group Ltd. mp4v2@ximpo.com |
28 * Bill May wmay@cisco.com | |
28 */ | 29 */ |
29 | 30 |
30 #ifndef __MP4_INCLUDED__ | 31 #ifndef __MP4_INCLUDED__ |
31 #define __MP4_INCLUDED__ | 32 #define __MP4_INCLUDED__ |
32 | 33 |
96 #define MP4_OD_TRACK_TYPE "odsm" | 97 #define MP4_OD_TRACK_TYPE "odsm" |
97 #define MP4_SCENE_TRACK_TYPE "sdsm" | 98 #define MP4_SCENE_TRACK_TYPE "sdsm" |
98 #define MP4_AUDIO_TRACK_TYPE "soun" | 99 #define MP4_AUDIO_TRACK_TYPE "soun" |
99 #define MP4_VIDEO_TRACK_TYPE "vide" | 100 #define MP4_VIDEO_TRACK_TYPE "vide" |
100 #define MP4_HINT_TRACK_TYPE "hint" | 101 #define MP4_HINT_TRACK_TYPE "hint" |
102 #define MP4_CNTL_TRACK_TYPE "cntl" | |
101 /* | 103 /* |
102 * This second set of track types should be created | 104 * This second set of track types should be created |
103 * via MP4AddSystemsTrack(type) | 105 * via MP4AddSystemsTrack(type) |
104 */ | 106 */ |
105 #define MP4_CLOCK_TRACK_TYPE "crsm" | 107 #define MP4_CLOCK_TRACK_TYPE "crsm" |
111 #define MP4_IS_VIDEO_TRACK_TYPE(type) \ | 113 #define MP4_IS_VIDEO_TRACK_TYPE(type) \ |
112 (!strcasecmp(type, MP4_VIDEO_TRACK_TYPE)) | 114 (!strcasecmp(type, MP4_VIDEO_TRACK_TYPE)) |
113 | 115 |
114 #define MP4_IS_AUDIO_TRACK_TYPE(type) \ | 116 #define MP4_IS_AUDIO_TRACK_TYPE(type) \ |
115 (!strcasecmp(type, MP4_AUDIO_TRACK_TYPE)) | 117 (!strcasecmp(type, MP4_AUDIO_TRACK_TYPE)) |
118 | |
119 #define MP4_IS_CNTL_TRACK_TYPE(type) \ | |
120 (!strcasecmp(type, MP4_CNTL_TRACK_TYPE)) | |
116 | 121 |
117 #define MP4_IS_OD_TRACK_TYPE(type) \ | 122 #define MP4_IS_OD_TRACK_TYPE(type) \ |
118 (!strcasecmp(type, MP4_OD_TRACK_TYPE)) | 123 (!strcasecmp(type, MP4_OD_TRACK_TYPE)) |
119 | 124 |
120 #define MP4_IS_SCENE_TRACK_TYPE(type) \ | 125 #define MP4_IS_SCENE_TRACK_TYPE(type) \ |
173 (((type) >= MP4_MPEG2_AAC_MAIN_AUDIO_TYPE \ | 178 (((type) >= MP4_MPEG2_AAC_MAIN_AUDIO_TYPE \ |
174 && (type) <= MP4_MPEG2_AAC_SSR_AUDIO_TYPE)) | 179 && (type) <= MP4_MPEG2_AAC_SSR_AUDIO_TYPE)) |
175 | 180 |
176 #define MP4_IS_MPEG4_AAC_AUDIO_TYPE(mpeg4Type) \ | 181 #define MP4_IS_MPEG4_AAC_AUDIO_TYPE(mpeg4Type) \ |
177 (((mpeg4Type) >= MP4_MPEG4_AAC_MAIN_AUDIO_TYPE \ | 182 (((mpeg4Type) >= MP4_MPEG4_AAC_MAIN_AUDIO_TYPE \ |
178 && (mpeg4Type) <= MP4_MPEG4_AAC_LTP_AUDIO_TYPE) \ | 183 && (mpeg4Type) <= MP4_MPEG4_AAC_HE_AUDIO_TYPE) \ |
179 || (mpeg4Type) == MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE \ | 184 || (mpeg4Type) == MP4_MPEG4_AAC_SCALABLE_AUDIO_TYPE \ |
180 || (mpeg4Type) == 17) | 185 || (mpeg4Type) == 17) |
181 | 186 |
182 #define MP4_IS_AAC_AUDIO_TYPE(type) \ | 187 #define MP4_IS_AAC_AUDIO_TYPE(type) \ |
183 (MP4_IS_MPEG2_AAC_AUDIO_TYPE(type) \ | 188 (MP4_IS_MPEG2_AAC_AUDIO_TYPE(type) \ |
285 #define MP4_CREATE_EXTENSIBLE_FORMAT (0x04) | 290 #define MP4_CREATE_EXTENSIBLE_FORMAT (0x04) |
286 | 291 |
287 MP4FileHandle MP4Create( | 292 MP4FileHandle MP4Create( |
288 const char* fileName, | 293 const char* fileName, |
289 u_int32_t verbosity DEFAULT(0), | 294 u_int32_t verbosity DEFAULT(0), |
295 u_int32_t flags DEFAULT(0)); | |
296 MP4FileHandle MP4CreateEx( | |
297 const char *fileName, | |
298 u_int32_t verbosity DEFAULT(0), | |
290 u_int32_t flags DEFAULT(0), | 299 u_int32_t flags DEFAULT(0), |
291 int add_ftyp DEFAULT(1), | 300 int add_ftyp DEFAULT(1), |
292 int add_iods DEFAULT(1), | 301 int add_iods DEFAULT(1), |
293 char* majorBrand DEFAULT(0), | 302 char* majorBrand DEFAULT(0), |
294 u_int32_t minorVersion DEFAULT(0), | 303 u_int32_t minorVersion DEFAULT(0), |
456 MP4TrackId trackId, | 465 MP4TrackId trackId, |
457 u_int8_t decoderVersion); | 466 u_int8_t decoderVersion); |
458 | 467 |
459 void MP4SetAmrModeSet(MP4FileHandle hFile, MP4TrackId trakId, uint16_t modeSet); | 468 void MP4SetAmrModeSet(MP4FileHandle hFile, MP4TrackId trakId, uint16_t modeSet); |
460 uint16_t MP4GetAmrModeSet(MP4FileHandle hFile, MP4TrackId trackId); | 469 uint16_t MP4GetAmrModeSet(MP4FileHandle hFile, MP4TrackId trackId); |
470 | |
471 MP4TrackId MP4AddHrefTrack(MP4FileHandle hFile, | |
472 uint32_t timeScale, | |
473 MP4Duration sampleDuration); | |
461 | 474 |
462 MP4TrackId MP4AddVideoTrack( | 475 MP4TrackId MP4AddVideoTrack( |
463 MP4FileHandle hFile, | 476 MP4FileHandle hFile, |
464 u_int32_t timeScale, | 477 u_int32_t timeScale, |
465 MP4Duration sampleDuration, | 478 MP4Duration sampleDuration, |
486 uint8_t profile_compat, | 499 uint8_t profile_compat, |
487 uint8_t AVCLevelIndication, | 500 uint8_t AVCLevelIndication, |
488 uint8_t sampleLenFieldSizeMinusOne); | 501 uint8_t sampleLenFieldSizeMinusOne); |
489 bool MP4AddH264SequenceParameterSet(MP4FileHandle hFile, | 502 bool MP4AddH264SequenceParameterSet(MP4FileHandle hFile, |
490 MP4TrackId trackId, | 503 MP4TrackId trackId, |
491 uint8_t *pSequence, | 504 const uint8_t *pSequence, |
492 uint16_t sequenceLen); | 505 uint16_t sequenceLen); |
493 bool MP4AddH264PictureParameterSet(MP4FileHandle hFile, | 506 bool MP4AddH264PictureParameterSet(MP4FileHandle hFile, |
494 MP4TrackId trackId, | 507 MP4TrackId trackId, |
495 uint8_t *pPict, | 508 const uint8_t *pPict, |
496 uint16_t pictLen); | 509 uint16_t pictLen); |
497 void MP4SetH263Vendor( | 510 void MP4SetH263Vendor( |
498 MP4FileHandle hFile, | 511 MP4FileHandle hFile, |
499 MP4TrackId trackId, | 512 MP4TrackId trackId, |
500 u_int32_t vendor); | 513 u_int32_t vendor); |
501 | 514 |
657 | 670 |
658 u_int16_t MP4GetTrackVideoHeight( | 671 u_int16_t MP4GetTrackVideoHeight( |
659 MP4FileHandle hFile, | 672 MP4FileHandle hFile, |
660 MP4TrackId trackId); | 673 MP4TrackId trackId); |
661 | 674 |
662 float MP4GetTrackVideoFrameRate( | 675 double MP4GetTrackVideoFrameRate( |
663 MP4FileHandle hFile, | 676 MP4FileHandle hFile, |
664 MP4TrackId trackId); | 677 MP4TrackId trackId); |
665 | 678 |
666 int MP4GetTrackAudioChannels(MP4FileHandle hFile, | 679 int MP4GetTrackAudioChannels(MP4FileHandle hFile, |
667 MP4TrackId trackId); | 680 MP4TrackId trackId); |
1075 bool MP4GetMetadataByIndex(MP4FileHandle hFile, u_int32_t index, | 1088 bool MP4GetMetadataByIndex(MP4FileHandle hFile, u_int32_t index, |
1076 const char** ppName, | 1089 const char** ppName, |
1077 u_int8_t** ppValue, u_int32_t* pValueSize); | 1090 u_int8_t** ppValue, u_int32_t* pValueSize); |
1078 bool MP4SetMetadataName(MP4FileHandle hFile, const char* value); | 1091 bool MP4SetMetadataName(MP4FileHandle hFile, const char* value); |
1079 bool MP4GetMetadataName(MP4FileHandle hFile, char** value); | 1092 bool MP4GetMetadataName(MP4FileHandle hFile, char** value); |
1093 bool MP4DeleteMetadataName(MP4FileHandle hFile); | |
1080 bool MP4SetMetadataArtist(MP4FileHandle hFile, const char* value); | 1094 bool MP4SetMetadataArtist(MP4FileHandle hFile, const char* value); |
1081 bool MP4GetMetadataArtist(MP4FileHandle hFile, char** value); | 1095 bool MP4GetMetadataArtist(MP4FileHandle hFile, char** value); |
1096 bool MP4DeleteMetadataArtist(MP4FileHandle hFile); | |
1082 bool MP4SetMetadataWriter(MP4FileHandle hFile, const char* value); | 1097 bool MP4SetMetadataWriter(MP4FileHandle hFile, const char* value); |
1083 bool MP4GetMetadataWriter(MP4FileHandle hFile, char** value); | 1098 bool MP4GetMetadataWriter(MP4FileHandle hFile, char** value); |
1099 bool MP4DeleteMetadataWriter(MP4FileHandle hFile); | |
1084 bool MP4SetMetadataComment(MP4FileHandle hFile, const char* value); | 1100 bool MP4SetMetadataComment(MP4FileHandle hFile, const char* value); |
1085 bool MP4GetMetadataComment(MP4FileHandle hFile, char** value); | 1101 bool MP4GetMetadataComment(MP4FileHandle hFile, char** value); |
1102 bool MP4DeleteMetadataComment(MP4FileHandle hFile); | |
1086 bool MP4SetMetadataTool(MP4FileHandle hFile, const char* value); | 1103 bool MP4SetMetadataTool(MP4FileHandle hFile, const char* value); |
1087 bool MP4GetMetadataTool(MP4FileHandle hFile, char** value); | 1104 bool MP4GetMetadataTool(MP4FileHandle hFile, char** value); |
1105 bool MP4DeleteMetadataTool(MP4FileHandle hFile); | |
1088 bool MP4SetMetadataYear(MP4FileHandle hFile, const char* value); | 1106 bool MP4SetMetadataYear(MP4FileHandle hFile, const char* value); |
1089 bool MP4GetMetadataYear(MP4FileHandle hFile, char** value); | 1107 bool MP4GetMetadataYear(MP4FileHandle hFile, char** value); |
1108 bool MP4DeleteMetadataYear(MP4FileHandle hFile); | |
1090 bool MP4SetMetadataAlbum(MP4FileHandle hFile, const char* value); | 1109 bool MP4SetMetadataAlbum(MP4FileHandle hFile, const char* value); |
1091 bool MP4GetMetadataAlbum(MP4FileHandle hFile, char** value); | 1110 bool MP4GetMetadataAlbum(MP4FileHandle hFile, char** value); |
1111 bool MP4DeleteMetadataAlbum(MP4FileHandle hFile); | |
1092 bool MP4SetMetadataTrack(MP4FileHandle hFile, | 1112 bool MP4SetMetadataTrack(MP4FileHandle hFile, |
1093 u_int16_t track, u_int16_t totalTracks); | 1113 u_int16_t track, u_int16_t totalTracks); |
1094 bool MP4GetMetadataTrack(MP4FileHandle hFile, | 1114 bool MP4GetMetadataTrack(MP4FileHandle hFile, |
1095 u_int16_t* track, u_int16_t* totalTracks); | 1115 u_int16_t* track, u_int16_t* totalTracks); |
1116 bool MP4DeleteMetadataTrack(MP4FileHandle hFile); | |
1096 bool MP4SetMetadataDisk(MP4FileHandle hFile, | 1117 bool MP4SetMetadataDisk(MP4FileHandle hFile, |
1097 u_int16_t disk, u_int16_t totalDisks); | 1118 u_int16_t disk, u_int16_t totalDisks); |
1098 bool MP4GetMetadataDisk(MP4FileHandle hFile, | 1119 bool MP4GetMetadataDisk(MP4FileHandle hFile, |
1099 u_int16_t* disk, u_int16_t* totalDisks); | 1120 u_int16_t* disk, u_int16_t* totalDisks); |
1121 bool MP4DeleteMetadataDisk(MP4FileHandle hFile); | |
1100 bool MP4SetMetadataGenre(MP4FileHandle hFile, const char *genre); | 1122 bool MP4SetMetadataGenre(MP4FileHandle hFile, const char *genre); |
1101 bool MP4GetMetadataGenre(MP4FileHandle hFile, char **genre); | 1123 bool MP4GetMetadataGenre(MP4FileHandle hFile, char **genre); |
1124 bool MP4DeleteMetadataGenre(MP4FileHandle hFile); | |
1125 bool MP4SetMetadataGrouping(MP4FileHandle hFile, const char *grouping); | |
1126 bool MP4GetMetadataGrouping(MP4FileHandle hFile, char **grouping); | |
1127 bool MP4DeleteMetadataGrouping(MP4FileHandle hFile); | |
1102 bool MP4SetMetadataTempo(MP4FileHandle hFile, u_int16_t tempo); | 1128 bool MP4SetMetadataTempo(MP4FileHandle hFile, u_int16_t tempo); |
1103 bool MP4GetMetadataTempo(MP4FileHandle hFile, u_int16_t* tempo); | 1129 bool MP4GetMetadataTempo(MP4FileHandle hFile, u_int16_t* tempo); |
1130 bool MP4DeleteMetadataTempo(MP4FileHandle hFile); | |
1104 bool MP4SetMetadataCompilation(MP4FileHandle hFile, u_int8_t cpl); | 1131 bool MP4SetMetadataCompilation(MP4FileHandle hFile, u_int8_t cpl); |
1105 bool MP4GetMetadataCompilation(MP4FileHandle hFile, u_int8_t* cpl); | 1132 bool MP4GetMetadataCompilation(MP4FileHandle hFile, u_int8_t* cpl); |
1133 bool MP4DeleteMetadataCompilation(MP4FileHandle hFile); | |
1106 bool MP4SetMetadataCoverArt(MP4FileHandle hFile, | 1134 bool MP4SetMetadataCoverArt(MP4FileHandle hFile, |
1107 u_int8_t *coverArt, u_int32_t size); | 1135 u_int8_t *coverArt, u_int32_t size); |
1108 bool MP4GetMetadataCoverArt(MP4FileHandle hFile, | 1136 bool MP4GetMetadataCoverArt(MP4FileHandle hFile, |
1109 u_int8_t **coverArt, u_int32_t* size); | 1137 u_int8_t **coverArt, u_int32_t* size); |
1138 bool MP4DeleteMetadataCoverArt(MP4FileHandle hFile); | |
1110 bool MP4SetMetadataFreeForm(MP4FileHandle hFile, char *name, | 1139 bool MP4SetMetadataFreeForm(MP4FileHandle hFile, char *name, |
1111 u_int8_t* pValue, u_int32_t valueSize); | 1140 u_int8_t* pValue, u_int32_t valueSize); |
1112 bool MP4GetMetadataFreeForm(MP4FileHandle hFile, char *name, | 1141 bool MP4GetMetadataFreeForm(MP4FileHandle hFile, char *name, |
1113 u_int8_t** pValue, u_int32_t* valueSize); | 1142 u_int8_t** pValue, u_int32_t* valueSize); |
1143 bool MP4DeleteMetadataFreeForm(MP4FileHandle hFile, char *name); | |
1114 | 1144 |
1115 | 1145 |
1116 /* time conversion utilties */ | 1146 /* time conversion utilties */ |
1117 | 1147 |
1118 /* predefined values for timeScale parameter below */ | 1148 /* predefined values for timeScale parameter below */ |