MoviesFormat.pas 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798
  1. {
  2. File: MoviesFormat.p
  3. Contains: QuickTime Interfaces.
  4. Version: Technology: QuickTime 6.0
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1990-2002 by Apple Computer, Inc., all rights reserved
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit MoviesFormat;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,ImageCompression,Components,Movies;
  92. {$ALIGN MAC68K}
  93. const
  94. kMovieVersion = 0; { version number of the format here described }
  95. { ***************************************
  96. *
  97. * General Types -
  98. * These types are used in more than one of the
  99. * directory types.
  100. *
  101. *************************************** }
  102. { MoviesUserData is the type used for user data in movie and track directories }
  103. type
  104. MoviesUserDataPtr = ^MoviesUserData;
  105. MoviesUserData = record
  106. size: SInt32; { size of this user data }
  107. udType: SInt32; { type of user data }
  108. data: SInt8; { the user data }
  109. end;
  110. UserDataAtomPtr = ^UserDataAtom;
  111. UserDataAtom = record
  112. size: SInt32;
  113. atomType: SInt32;
  114. userData: array [0..0] of MoviesUserData;
  115. end;
  116. { MoviesDataDescription tells us where the data for the movie or track lives.
  117. The data can follow the directory, be in the datafork of the same file as the directory resource,
  118. be in the resource fork of the same file as the directory resource, be in another file in the
  119. data fork or resource fork, or require a specific bottleneck to fetch the data. }
  120. { ***************************************
  121. *
  122. * MediaDirectory information -
  123. * The MediaDirectory is tightly coupled to the data.
  124. *
  125. *************************************** }
  126. SampleDescriptionAtomPtr = ^SampleDescriptionAtom;
  127. SampleDescriptionAtom = record
  128. size: SInt32;
  129. atomType: SInt32; { = 'stsd' }
  130. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  131. numEntries: SInt32;
  132. sampleDescTable: array [0..0] of SampleDescription;
  133. end;
  134. { TimeToSampleNum maps physical sample time to physical sample number. }
  135. TimeToSampleNumPtr = ^TimeToSampleNum;
  136. TimeToSampleNum = record
  137. sampleCount: SInt32;
  138. sampleDuration: TimeValue;
  139. end;
  140. TimeToSampleNumAtomPtr = ^TimeToSampleNumAtom;
  141. TimeToSampleNumAtom = record
  142. size: SInt32;
  143. atomType: SInt32; { = 'stts' }
  144. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  145. numEntries: SInt32;
  146. timeToSampleNumTable: array [0..0] of TimeToSampleNum;
  147. end;
  148. { SyncSamples is a list of the physical samples which are self contained. }
  149. SyncSampleAtomPtr = ^SyncSampleAtom;
  150. SyncSampleAtom = record
  151. size: SInt32;
  152. atomType: SInt32; { = 'stss' }
  153. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  154. numEntries: SInt32;
  155. syncSampleTable: array [0..0] of SInt32;
  156. end;
  157. { SampleToChunk maps physical sample number to chunk number. }
  158. { same as SampleToChunk, but redundant first sample is removed }
  159. SampleToChunkPtr = ^SampleToChunk;
  160. SampleToChunk = record
  161. firstChunk: SInt32;
  162. samplesPerChunk: SInt32;
  163. sampleDescriptionID: SInt32;
  164. end;
  165. SampleToChunkAtomPtr = ^SampleToChunkAtom;
  166. SampleToChunkAtom = record
  167. size: SInt32;
  168. atomType: SInt32; { = 'stsc' }
  169. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  170. numEntries: SInt32;
  171. sampleToChunkTable: array [0..0] of SampleToChunk;
  172. end;
  173. ChunkOffsetAtomPtr = ^ChunkOffsetAtom;
  174. ChunkOffsetAtom = record
  175. size: SInt32;
  176. atomType: SInt32; { = 'stco' }
  177. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  178. numEntries: SInt32;
  179. chunkOffsetTable: array [0..0] of SInt32;
  180. end;
  181. SampleSizeAtomPtr = ^SampleSizeAtom;
  182. SampleSizeAtom = record
  183. size: SInt32;
  184. atomType: SInt32; { = 'stsz' }
  185. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  186. sampleSize: SInt32;
  187. numEntries: SInt32;
  188. sampleSizeTable: array [0..0] of SInt32;
  189. end;
  190. ShadowSyncPtr = ^ShadowSync;
  191. ShadowSync = record
  192. fdSampleNum: SInt32;
  193. syncSampleNum: SInt32;
  194. end;
  195. ShadowSyncAtomPtr = ^ShadowSyncAtom;
  196. ShadowSyncAtom = record
  197. size: SInt32;
  198. atomType: SInt32; { = 'stsz' }
  199. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  200. numEntries: SInt32;
  201. shadowSyncTable: array [0..0] of ShadowSync;
  202. end;
  203. SampleTableAtomPtr = ^SampleTableAtom;
  204. SampleTableAtom = record
  205. size: SInt32;
  206. atomType: SInt32; { = 'stbl' }
  207. sampleDescription: SampleDescriptionAtom;
  208. timeToSampleNum: TimeToSampleNumAtom;
  209. sampleToChunk: SampleToChunkAtom;
  210. syncSample: SyncSampleAtom;
  211. sampleSize: SampleSizeAtom;
  212. chunkOffset: ChunkOffsetAtom;
  213. shadowSync: ShadowSyncAtom;
  214. end;
  215. PublicHandlerInfoPtr = ^PublicHandlerInfo;
  216. PublicHandlerInfo = record
  217. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  218. componentType: SInt32;
  219. componentSubType: SInt32;
  220. componentManufacturer: SInt32;
  221. componentFlags: SInt32;
  222. componentFlagsMask: SInt32;
  223. componentName: SInt8;
  224. end;
  225. HandlerAtomPtr = ^HandlerAtom;
  226. HandlerAtom = record
  227. size: SInt32;
  228. atomType: SInt32; { = 'hdlr' }
  229. hInfo: PublicHandlerInfo;
  230. end;
  231. { a data reference is a private structure }
  232. DataRefAtom = SInt32;
  233. DataInfoAtomPtr = ^DataInfoAtom;
  234. DataInfoAtom = record
  235. size: SInt32;
  236. atomType: SInt32; { = 'dinf' }
  237. dataRef: DataRefAtom;
  238. end;
  239. RgnAtomPtr = ^RgnAtom;
  240. RgnAtom = record
  241. size: SInt32;
  242. atomType: SInt32;
  243. rgnSize: SInt16;
  244. rgnBBox: Rect;
  245. data: SInt8;
  246. end;
  247. MatteCompressedAtomPtr = ^MatteCompressedAtom;
  248. MatteCompressedAtom = record
  249. size: SInt32;
  250. atomType: SInt32;
  251. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  252. matteImageDescription: ImageDescription;
  253. matteData: SInt8;
  254. end;
  255. MatteAtomPtr = ^MatteAtom;
  256. MatteAtom = record
  257. size: SInt32;
  258. atomType: SInt32;
  259. aCompressedMatte: MatteCompressedAtom;
  260. end;
  261. ClippingAtomPtr = ^ClippingAtom;
  262. ClippingAtom = record
  263. size: SInt32;
  264. atomType: SInt32;
  265. aRgnClip: RgnAtom;
  266. end;
  267. { **********************
  268. * Media Info Example Structures
  269. ********************** }
  270. VideoMediaInfoHeaderPtr = ^VideoMediaInfoHeader;
  271. VideoMediaInfoHeader = record
  272. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  273. graphicsMode: SInt16; { for QD - transfer mode }
  274. opColorRed: SInt16; { opcolor for transfer mode }
  275. opColorGreen: SInt16;
  276. opColorBlue: SInt16;
  277. end;
  278. VideoMediaInfoHeaderAtomPtr = ^VideoMediaInfoHeaderAtom;
  279. VideoMediaInfoHeaderAtom = record
  280. size: SInt32; { size of Media info }
  281. atomType: SInt32; { = 'vmhd' }
  282. vmiHeader: VideoMediaInfoHeader;
  283. end;
  284. VideoMediaInfoPtr = ^VideoMediaInfo;
  285. VideoMediaInfo = record
  286. size: SInt32; { size of Media info }
  287. atomType: SInt32; { = 'minf' }
  288. header: VideoMediaInfoHeaderAtom;
  289. dataHandler: HandlerAtom;
  290. dataInfo: DataInfoAtom;
  291. sampleTable: SampleTableAtom;
  292. end;
  293. SoundMediaInfoHeaderPtr = ^SoundMediaInfoHeader;
  294. SoundMediaInfoHeader = record
  295. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  296. balance: SInt16;
  297. rsrvd: SInt16;
  298. end;
  299. SoundMediaInfoHeaderAtomPtr = ^SoundMediaInfoHeaderAtom;
  300. SoundMediaInfoHeaderAtom = record
  301. size: SInt32; { size of Media info }
  302. atomType: SInt32; { = 'vmhd' }
  303. smiHeader: SoundMediaInfoHeader;
  304. end;
  305. SoundMediaInfoPtr = ^SoundMediaInfo;
  306. SoundMediaInfo = record
  307. size: SInt32; { size of Media info }
  308. atomType: SInt32; { = 'minf' }
  309. header: SoundMediaInfoHeaderAtom;
  310. dataHandler: HandlerAtom;
  311. dataReference: DataRefAtom;
  312. sampleTable: SampleTableAtom;
  313. end;
  314. { whatever data the media handler needs goes after the atomType }
  315. MediaInfoPtr = ^MediaInfo;
  316. MediaInfo = record
  317. size: SInt32;
  318. atomType: SInt32;
  319. end;
  320. MediaInfo_GAP_Private_field_type_fix = MediaInfo; { used as field type when a record declaration contains a MediaInfo field identifier }
  321. { **********************
  322. * Media Directory Structures
  323. ********************** }
  324. MediaHeaderPtr = ^MediaHeader;
  325. MediaHeader = record
  326. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  327. creationTime: SInt32; { seconds since Jan 1904 when directory was created }
  328. modificationTime: SInt32; { seconds since Jan 1904 when directory was appended }
  329. timeScale: TimeValue; { start time for Media (Media time) }
  330. duration: TimeValue; { length of Media (Media time) }
  331. language: SInt16;
  332. quality: SInt16;
  333. end;
  334. MediaHeaderAtomPtr = ^MediaHeaderAtom;
  335. MediaHeaderAtom = record
  336. size: SInt32;
  337. atomType: SInt32;
  338. header: MediaHeader;
  339. end;
  340. MediaDirectoryPtr = ^MediaDirectory;
  341. MediaDirectory = record
  342. size: SInt32;
  343. atomType: SInt32; { = 'mdia' }
  344. mediaHeader: MediaHeaderAtom; { standard Media information }
  345. mediaHandler: HandlerAtom;
  346. mediaInfo: MediaInfo_GAP_Private_field_type_fix;
  347. end;
  348. { **********************
  349. * Track Structures
  350. ********************** }
  351. const
  352. TrackEnable = $01;
  353. TrackInMovie = $02;
  354. TrackInPreview = $04;
  355. TrackInPoster = $08;
  356. type
  357. TrackHeaderPtr = ^TrackHeader;
  358. TrackHeader = record
  359. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  360. creationTime: SInt32; { seconds since Jan 1904 when directory was created }
  361. modificationTime: SInt32; { seconds since Jan 1904 when directory was appended }
  362. trackID: SInt32;
  363. reserved1: SInt32;
  364. duration: TimeValue; { length of track (track time) }
  365. reserved2: SInt32;
  366. reserved3: SInt32;
  367. layer: SInt16;
  368. alternateGroup: SInt16;
  369. volume: SInt16;
  370. reserved4: SInt16;
  371. matrix: MatrixRecord;
  372. trackWidth: Fixed;
  373. trackHeight: Fixed;
  374. end;
  375. TrackHeaderAtomPtr = ^TrackHeaderAtom;
  376. TrackHeaderAtom = record
  377. size: SInt32; { size of track header }
  378. atomType: SInt32; { = 'tkhd' }
  379. header: TrackHeader;
  380. end;
  381. EditListTypePtr = ^EditListType;
  382. EditListType = record
  383. trackDuration: TimeValue;
  384. mediaTime: TimeValue;
  385. mediaRate: Fixed;
  386. end;
  387. EditListAtomPtr = ^EditListAtom;
  388. EditListAtom = record
  389. size: SInt32;
  390. atomType: SInt32; { = elst }
  391. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  392. numEntries: SInt32;
  393. editListTable: array [0..0] of EditListType;
  394. end;
  395. EditsAtomPtr = ^EditsAtom;
  396. EditsAtom = record
  397. size: SInt32;
  398. atomType: SInt32; { = edts }
  399. editList: EditListAtom;
  400. end;
  401. TrackLoadSettingsPtr = ^TrackLoadSettings;
  402. TrackLoadSettings = record
  403. preloadStartTime: TimeValue;
  404. preloadDuration: TimeValue;
  405. preloadFlags: SInt32;
  406. defaultHints: SInt32;
  407. end;
  408. TrackLoadSettingsAtomPtr = ^TrackLoadSettingsAtom;
  409. TrackLoadSettingsAtom = record
  410. size: SInt32;
  411. atomType: SInt32; { = load }
  412. settings: TrackLoadSettings;
  413. end;
  414. TrackDirectoryPtr = ^TrackDirectory;
  415. TrackDirectory = record
  416. size: SInt32;
  417. atomType: SInt32; { = 'trak' }
  418. trackHeader: TrackHeaderAtom; { standard track information }
  419. trackClip: ClippingAtom;
  420. edits: EditsAtom;
  421. media: MediaDirectory;
  422. userData: UserDataAtom; { space for extending with new data types }
  423. end;
  424. TrackDirectory_GAP_Private_field_type_fix = TrackDirectory; { used as field type when a record declaration contains a TrackDirectory field identifier }
  425. { ***************************************
  426. *
  427. * MovieDirectory -
  428. * The MovieDirectory is the top level structure which
  429. * holds the TrackInstance describing where the
  430. * TrackDirectories are.
  431. *
  432. *************************************** }
  433. MovieHeaderPtr = ^MovieHeader;
  434. MovieHeader = record
  435. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  436. creationTime: SInt32; { seconds since Jan 1904 when directory was created }
  437. modificationTime: SInt32; { seconds since Jan 1904 when directory was appended }
  438. timeScale: TimeValue; { Time specifications }
  439. duration: TimeValue;
  440. preferredRate: Fixed; { rate at which to play this movie }
  441. preferredVolume: SInt16; { volume to play movie at }
  442. reserved1: SInt16;
  443. preferredLong1: SInt32;
  444. preferredLong2: SInt32;
  445. matrix: MatrixRecord;
  446. previewTime: TimeValue; { time in track the proxy begins (track time) }
  447. previewDuration: TimeValue; { how long the proxy lasts (track time) }
  448. posterTime: TimeValue; { time in track the proxy begins (track time) }
  449. selectionTime: TimeValue; { time in track the proxy begins (track time) }
  450. selectionDuration: TimeValue; { time in track the proxy begins (track time) }
  451. currentTime: TimeValue; { time in track the proxy begins (track time) }
  452. nextTrackID: SInt32; { next value to use for a TrackID }
  453. end;
  454. MovieHeaderAtomPtr = ^MovieHeaderAtom;
  455. MovieHeaderAtom = record
  456. size: SInt32;
  457. atomType: SInt32; { = 'mvhd' }
  458. header: MovieHeader;
  459. end;
  460. TrackDirectoryEntryPtr = ^TrackDirectoryEntry;
  461. TrackDirectoryEntry = record
  462. trackDirectory: TrackDirectory_GAP_Private_field_type_fix; { Track directory information }
  463. end;
  464. MovieDirectoryPtr = ^MovieDirectory;
  465. MovieDirectory = record
  466. size: SInt32;
  467. atomType: SInt32; { = 'moov' }
  468. header: MovieHeaderAtom;
  469. movieClip: ClippingAtom;
  470. { Track Directories }
  471. track: array [0..0] of TrackDirectoryEntry; { Track directory information }
  472. { User data for Movie }
  473. userData: UserDataAtom; { space for user extensions }
  474. end;
  475. { ***************************************
  476. *************************************** }
  477. { Movie formats and tags }
  478. const
  479. { some system defined format IDs }
  480. MOVIE_TYPE = $6D6F6F76 (* 'moov' *);
  481. TRACK_TYPE = $7472616B (* 'trak' *);
  482. MEDIA_TYPE = $6D646961 (* 'mdia' *);
  483. VIDEO_TYPE = $76696465 (* 'vide' *);
  484. SOUND_TYPE = $736F756E (* 'soun' *);
  485. { atom id's }
  486. MovieAID = $6D6F6F76 (* 'moov' *);
  487. MovieHeaderAID = $6D766864 (* 'mvhd' *);
  488. ClipAID = $636C6970 (* 'clip' *);
  489. RgnClipAID = $6372676E (* 'crgn' *);
  490. MatteAID = $6D617474 (* 'matt' *);
  491. MatteCompAID = $6B6D6174 (* 'kmat' *);
  492. TrackAID = $7472616B (* 'trak' *);
  493. UserDataAID = $75647461 (* 'udta' *);
  494. TrackHeaderAID = $746B6864 (* 'tkhd' *);
  495. EditsAID = $65647473 (* 'edts' *);
  496. EditListAID = $656C7374 (* 'elst' *);
  497. MediaAID = $6D646961 (* 'mdia' *);
  498. MediaHeaderAID = $6D646864 (* 'mdhd' *);
  499. MediaInfoAID = $6D696E66 (* 'minf' *);
  500. VideoMediaInfoHeaderAID = $766D6864 (* 'vmhd' *);
  501. SoundMediaInfoHeaderAID = $736D6864 (* 'smhd' *);
  502. GenericMediaInfoHeaderAID = $676D6864 (* 'gmhd' *);
  503. GenericMediaInfoAID = $676D696E (* 'gmin' *);
  504. DataInfoAID = $64696E66 (* 'dinf' *);
  505. DataRefAID = $64726566 (* 'dref' *);
  506. SampleTableAID = $7374626C (* 'stbl' *);
  507. STSampleDescAID = $73747364 (* 'stsd' *);
  508. STTimeToSampAID = $73747473 (* 'stts' *);
  509. STSyncSampleAID = $73747373 (* 'stss' *);
  510. STSampleToChunkAID = $73747363 (* 'stsc' *);
  511. STShadowSyncAID = $73747368 (* 'stsh' *);
  512. HandlerAID = $68646C72 (* 'hdlr' *);
  513. STSampleSizeAID = $7374737A (* 'stsz' *);
  514. STChunkOffsetAID = $7374636F (* 'stco' *);
  515. STChunkOffset64AID = $636F3634 (* 'co64' *);
  516. STSampleIDAID = $73746964 (* 'stid' *);
  517. DataRefContainerAID = $64726663 (* 'drfc' *);
  518. TrackReferenceAID = $74726566 (* 'tref' *);
  519. ColorTableAID = $63746162 (* 'ctab' *);
  520. LoadSettingsAID = $6C6F6164 (* 'load' *);
  521. PropertyAtomAID = $636F6465 (* 'code' *);
  522. InputMapAID = $696D6170 (* 'imap' *);
  523. MovieBufferHintsAID = $6D626668 (* 'mbfh' *);
  524. MovieDataRefAliasAID = $6D647261 (* 'mdra' *);
  525. SoundLocalizationAID = $736C6F63 (* 'sloc' *);
  526. CompressedMovieAID = $636D6F76 (* 'cmov' *);
  527. CompressedMovieDataAID = $636D7664 (* 'cmvd' *);
  528. DataCompressionAtomAID = $64636F6D (* 'dcom' *);
  529. ReferenceMovieRecordAID = $726D7261 (* 'rmra' *);
  530. ReferenceMovieDescriptorAID = $726D6461 (* 'rmda' *);
  531. ReferenceMovieDataRefAID = $72647266 (* 'rdrf' *);
  532. ReferenceMovieVersionCheckAID = $726D7663 (* 'rmvc' *);
  533. ReferenceMovieDataRateAID = $726D6472 (* 'rmdr' *);
  534. ReferenceMovieComponentCheckAID = $726D6364 (* 'rmcd' *);
  535. ReferenceMovieQualityAID = $726D7175 (* 'rmqu' *);
  536. ReferenceMovieLanguageAID = $726D6C61 (* 'rmla' *);
  537. ReferenceMovieCPURatingAID = $726D6373 (* 'rmcs' *);
  538. ReferenceMovieAlternateGroupAID = $726D6167 (* 'rmag' *);
  539. ReferenceMovieNetworkStatusAID = $726E6574 (* 'rnet' *);
  540. CloneMediaAID = $636C6F6E (* 'clon' *);
  541. FileTypeAID = $66747970 (* 'ftyp' *);
  542. SecureContentInfoAID = $73696E66 (* 'sinf' *);
  543. SecureContentSchemeTypeAID = $7363686D (* 'schm' *);
  544. SecureContentSchemeInfoAID = $73636869 (* 'schi' *);
  545. { Text ATOM definitions }
  546. type
  547. TextBoxAtomPtr = ^TextBoxAtom;
  548. TextBoxAtom = record
  549. size: SInt32;
  550. atomType: SInt32; { = 'tbox' }
  551. textBox: Rect; { New text box (overrides defaultTextBox) }
  552. end;
  553. HiliteAtomPtr = ^HiliteAtom;
  554. HiliteAtom = record
  555. size: SInt32;
  556. atomType: SInt32; { = 'hlit' }
  557. selStart: SInt32; { hilite selection start character }
  558. selEnd: SInt32; { hilite selection end character }
  559. end;
  560. KaraokeRecPtr = ^KaraokeRec;
  561. KaraokeRec = record
  562. timeVal: TimeValue;
  563. beginHilite: SInt16;
  564. endHilite: SInt16;
  565. end;
  566. KaraokeAtomPtr = ^KaraokeAtom;
  567. KaraokeAtom = record
  568. numEntries: SInt32;
  569. karaokeEntries: array [0..0] of KaraokeRec;
  570. end;
  571. { for ReferenceMovieDataRefRecord.flags }
  572. const
  573. kDataRefIsSelfContained = $01;
  574. type
  575. ReferenceMovieDataRefRecordPtr = ^ReferenceMovieDataRefRecord;
  576. ReferenceMovieDataRefRecord = record
  577. flags: SInt32;
  578. dataRefType: OSType;
  579. dataRefSize: SInt32;
  580. dataRef: SInt8;
  581. end;
  582. { for VersionCheckRecord.checkType }
  583. const
  584. kVersionCheckMin = 0; { val1 is the min. version required }
  585. kVersionCheckMask = 1; { (gestalt return value & val2) must == val1 }
  586. type
  587. QTAltVersionCheckRecordPtr = ^QTAltVersionCheckRecord;
  588. QTAltVersionCheckRecord = record
  589. flags: SInt32; { currently always 0 }
  590. gestaltTag: OSType;
  591. val1: UInt32;
  592. val2: UInt32;
  593. checkType: SInt16;
  594. end;
  595. { some helpful constants for DataRateRecord.dataRate }
  596. const
  597. kDataRate144ModemRate = 1400;
  598. kDataRate288ModemRate = 2800;
  599. kDataRateISDNRate = 5600;
  600. kDataRateDualISDNRate = 11200;
  601. kDataRate256kbpsRate = 25600;
  602. kDataRate384kbpsRate = 38400;
  603. kDataRate512kbpsRate = 51200;
  604. kDataRate768kbpsRate = 76800;
  605. kDataRate1MbpsRate = 100000;
  606. kDataRateT1Rate = 150000;
  607. kDataRateInfiniteRate = $7FFFFFFF;
  608. kDataRateDefaultIfNotSet = 5600;
  609. type
  610. QTAltDataRateRecordPtr = ^QTAltDataRateRecord;
  611. QTAltDataRateRecord = record
  612. flags: SInt32; { currently always 0 }
  613. dataRate: SInt32;
  614. end;
  615. QTAltComponentCheckRecordPtr = ^QTAltComponentCheckRecord;
  616. QTAltComponentCheckRecord = record
  617. flags: SInt32; { currently always 0 }
  618. cd: ComponentDescription;
  619. minVersion: UInt32;
  620. end;
  621. QTAltLanguageRecordPtr = ^QTAltLanguageRecord;
  622. QTAltLanguageRecord = record
  623. flags: SInt32; { currently always 0 }
  624. language: SInt16;
  625. end;
  626. const
  627. kQTCPUSpeed1Rating = 100; { slowest }
  628. kQTCPUSpeed2Rating = 200;
  629. kQTCPUSpeed3Rating = 300;
  630. kQTCPUSpeed4Rating = 400;
  631. kQTCPUSpeed5Rating = 500; { fastest }
  632. type
  633. QTAltCPURatingRecordPtr = ^QTAltCPURatingRecord;
  634. QTAltCPURatingRecord = record
  635. flags: UInt32; { currently always 0 }
  636. speed: UInt16;
  637. end;
  638. ReferenceMovieNetworkStatusRecordPtr = ^ReferenceMovieNetworkStatusRecord;
  639. ReferenceMovieNetworkStatusRecord = record
  640. flags: UInt32; { currently always 0 }
  641. valueCount: UInt32; { how many status values are in array }
  642. netStatusValues: array [0..0] of SInt32; { a value from kQTNetworkStatus... constants }
  643. end;
  644. CloneRecordPtr = ^CloneRecord;
  645. CloneRecord = record
  646. flags: SInt32;
  647. masterTrackID: SInt32; { track ID of the track we're cloning }
  648. end;
  649. CloneAtomPtr = ^CloneAtom;
  650. CloneAtom = record
  651. size: SInt32;
  652. atomType: SInt32; { = clon }
  653. cloneInfo: CloneRecord;
  654. end;
  655. FileTypeAtomPtr = ^FileTypeAtom;
  656. FileTypeAtom = record
  657. size: SInt32;
  658. atomType: SInt32; { = 'ftyp' }
  659. majorBrand: SInt32; { best use brand }
  660. minorVersion: SInt32;
  661. compatibleBrands: array [0..3] of SInt32; { 1 or greater }
  662. end;
  663. const
  664. kQTFileTypeBrandQuickTimeMovie = $71742020 (* 'qt ' *); { QuickTime movie files }
  665. kQTFileTypeBrandISOFile = $69736F6D (* 'isom' *); { ISO Base Media files }
  666. kQTFileTypeBrandMPEG4v1 = $6D703431 (* 'mp41' *); { MPEG-4 (ISO/IEC 14496-1) version 1 files }
  667. kQTFileTypeBrandMPEG4v2 = $6D703432 (* 'mp42' *); { MPEG-4 (ISO/IEC 14496-1) version 2 files }
  668. type
  669. SecureContentInfoAtomPtr = ^SecureContentInfoAtom;
  670. SecureContentInfoAtom = record
  671. size: SInt32;
  672. atomType: SInt32; { = 'sinf' }
  673. end;
  674. SecureContentSchemeTypeAtomPtr = ^SecureContentSchemeTypeAtom;
  675. SecureContentSchemeTypeAtom = record
  676. size: SInt32;
  677. atomType: SInt32; { = 'schm' }
  678. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  679. schemeType: SInt32;
  680. schemeVersion: UInt16;
  681. { if flags & 1, C string holding URL for security component server }
  682. end;
  683. SecureContentSchemeInfoAtomPtr = ^SecureContentSchemeInfoAtom;
  684. SecureContentSchemeInfoAtom = record
  685. size: SInt32;
  686. atomType: SInt32; { = 'schi' }
  687. end;
  688. {$ALIGN MAC68K}
  689. end.