MoviesFormat.pas 32 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084
  1. {
  2. File: QuickTime/MoviesFormat.h
  3. Contains: QuickTime Interfaces.
  4. Version: QuickTime 7.7.1
  5. Copyright: © 1990-2012 by Apple Inc., all rights reserved
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://bugs.freepascal.org
  9. }
  10. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  11. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  12. {
  13. Modified for use with Free Pascal
  14. Version 308
  15. Please report any bugs to <[email protected]>
  16. }
  17. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  18. {$mode macpas}
  19. {$modeswitch cblocks}
  20. {$packenum 1}
  21. {$macro on}
  22. {$inline on}
  23. {$calling mwpascal}
  24. unit MoviesFormat;
  25. interface
  26. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  27. {$setc GAP_INTERFACES_VERSION := $0308}
  28. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  29. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  30. {$endc}
  31. {$ifc defined CPUPOWERPC and defined CPUI386}
  32. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  33. {$endc}
  34. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  35. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  36. {$endc}
  37. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  38. {$setc __ppc__ := 1}
  39. {$elsec}
  40. {$setc __ppc__ := 0}
  41. {$endc}
  42. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  43. {$setc __ppc64__ := 1}
  44. {$elsec}
  45. {$setc __ppc64__ := 0}
  46. {$endc}
  47. {$ifc not defined __i386__ and defined CPUI386}
  48. {$setc __i386__ := 1}
  49. {$elsec}
  50. {$setc __i386__ := 0}
  51. {$endc}
  52. {$ifc not defined __x86_64__ and defined CPUX86_64}
  53. {$setc __x86_64__ := 1}
  54. {$elsec}
  55. {$setc __x86_64__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm__ and defined CPUARM}
  58. {$setc __arm__ := 1}
  59. {$elsec}
  60. {$setc __arm__ := 0}
  61. {$endc}
  62. {$ifc not defined __arm64__ and defined CPUAARCH64}
  63. {$setc __arm64__ := 1}
  64. {$elsec}
  65. {$setc __arm64__ := 0}
  66. {$endc}
  67. {$ifc defined cpu64}
  68. {$setc __LP64__ := 1}
  69. {$elsec}
  70. {$setc __LP64__ := 0}
  71. {$endc}
  72. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  73. {$error Conflicting definitions for __ppc__ and __i386__}
  74. {$endc}
  75. {$ifc defined __ppc__ and __ppc__}
  76. {$setc TARGET_CPU_PPC := TRUE}
  77. {$setc TARGET_CPU_PPC64 := FALSE}
  78. {$setc TARGET_CPU_X86 := FALSE}
  79. {$setc TARGET_CPU_X86_64 := FALSE}
  80. {$setc TARGET_CPU_ARM := FALSE}
  81. {$setc TARGET_CPU_ARM64 := FALSE}
  82. {$setc TARGET_OS_MAC := TRUE}
  83. {$setc TARGET_OS_IPHONE := FALSE}
  84. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  85. {$setc TARGET_OS_EMBEDDED := FALSE}
  86. {$elifc defined __ppc64__ and __ppc64__}
  87. {$setc TARGET_CPU_PPC := FALSE}
  88. {$setc TARGET_CPU_PPC64 := TRUE}
  89. {$setc TARGET_CPU_X86 := FALSE}
  90. {$setc TARGET_CPU_X86_64 := FALSE}
  91. {$setc TARGET_CPU_ARM := FALSE}
  92. {$setc TARGET_CPU_ARM64 := FALSE}
  93. {$setc TARGET_OS_MAC := TRUE}
  94. {$setc TARGET_OS_IPHONE := FALSE}
  95. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  96. {$setc TARGET_OS_EMBEDDED := FALSE}
  97. {$elifc defined __i386__ and __i386__}
  98. {$setc TARGET_CPU_PPC := FALSE}
  99. {$setc TARGET_CPU_PPC64 := FALSE}
  100. {$setc TARGET_CPU_X86 := TRUE}
  101. {$setc TARGET_CPU_X86_64 := FALSE}
  102. {$setc TARGET_CPU_ARM := FALSE}
  103. {$setc TARGET_CPU_ARM64 := FALSE}
  104. {$ifc defined(iphonesim)}
  105. {$setc TARGET_OS_MAC := FALSE}
  106. {$setc TARGET_OS_IPHONE := TRUE}
  107. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  108. {$elsec}
  109. {$setc TARGET_OS_MAC := TRUE}
  110. {$setc TARGET_OS_IPHONE := FALSE}
  111. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  112. {$endc}
  113. {$setc TARGET_OS_EMBEDDED := FALSE}
  114. {$elifc defined __x86_64__ and __x86_64__}
  115. {$setc TARGET_CPU_PPC := FALSE}
  116. {$setc TARGET_CPU_PPC64 := FALSE}
  117. {$setc TARGET_CPU_X86 := FALSE}
  118. {$setc TARGET_CPU_X86_64 := TRUE}
  119. {$setc TARGET_CPU_ARM := FALSE}
  120. {$setc TARGET_CPU_ARM64 := FALSE}
  121. {$ifc defined(iphonesim)}
  122. {$setc TARGET_OS_MAC := FALSE}
  123. {$setc TARGET_OS_IPHONE := TRUE}
  124. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  125. {$elsec}
  126. {$setc TARGET_OS_MAC := TRUE}
  127. {$setc TARGET_OS_IPHONE := FALSE}
  128. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  129. {$endc}
  130. {$setc TARGET_OS_EMBEDDED := FALSE}
  131. {$elifc defined __arm__ and __arm__}
  132. {$setc TARGET_CPU_PPC := FALSE}
  133. {$setc TARGET_CPU_PPC64 := FALSE}
  134. {$setc TARGET_CPU_X86 := FALSE}
  135. {$setc TARGET_CPU_X86_64 := FALSE}
  136. {$setc TARGET_CPU_ARM := TRUE}
  137. {$setc TARGET_CPU_ARM64 := FALSE}
  138. { will require compiler define when/if other Apple devices with ARM cpus ship }
  139. {$setc TARGET_OS_MAC := FALSE}
  140. {$setc TARGET_OS_IPHONE := TRUE}
  141. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  142. {$setc TARGET_OS_EMBEDDED := TRUE}
  143. {$elifc defined __arm64__ and __arm64__}
  144. {$setc TARGET_CPU_PPC := FALSE}
  145. {$setc TARGET_CPU_PPC64 := FALSE}
  146. {$setc TARGET_CPU_X86 := FALSE}
  147. {$setc TARGET_CPU_X86_64 := FALSE}
  148. {$setc TARGET_CPU_ARM := FALSE}
  149. {$setc TARGET_CPU_ARM64 := TRUE}
  150. { will require compiler define when/if other Apple devices with ARM cpus ship }
  151. {$setc TARGET_OS_MAC := FALSE}
  152. {$setc TARGET_OS_IPHONE := TRUE}
  153. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  154. {$setc TARGET_OS_EMBEDDED := TRUE}
  155. {$elsec}
  156. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  157. {$endc}
  158. {$ifc defined __LP64__ and __LP64__ }
  159. {$setc TARGET_CPU_64 := TRUE}
  160. {$elsec}
  161. {$setc TARGET_CPU_64 := FALSE}
  162. {$endc}
  163. {$ifc defined FPC_BIG_ENDIAN}
  164. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  165. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  166. {$elifc defined FPC_LITTLE_ENDIAN}
  167. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  168. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  169. {$elsec}
  170. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  171. {$endc}
  172. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  173. {$setc CALL_NOT_IN_CARBON := FALSE}
  174. {$setc OLDROUTINENAMES := FALSE}
  175. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  176. {$setc OPAQUE_UPP_TYPES := TRUE}
  177. {$setc OTCARBONAPPLICATION := TRUE}
  178. {$setc OTKERNEL := FALSE}
  179. {$setc PM_USE_SESSION_APIS := TRUE}
  180. {$setc TARGET_API_MAC_CARBON := TRUE}
  181. {$setc TARGET_API_MAC_OS8 := FALSE}
  182. {$setc TARGET_API_MAC_OSX := TRUE}
  183. {$setc TARGET_CARBON := TRUE}
  184. {$setc TARGET_CPU_68K := FALSE}
  185. {$setc TARGET_CPU_MIPS := FALSE}
  186. {$setc TARGET_CPU_SPARC := FALSE}
  187. {$setc TARGET_OS_UNIX := FALSE}
  188. {$setc TARGET_OS_WIN32 := FALSE}
  189. {$setc TARGET_RT_MAC_68881 := FALSE}
  190. {$setc TARGET_RT_MAC_CFM := FALSE}
  191. {$setc TARGET_RT_MAC_MACHO := TRUE}
  192. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  193. {$setc TYPE_BOOL := FALSE}
  194. {$setc TYPE_EXTENDED := FALSE}
  195. {$setc TYPE_LONGLONG := TRUE}
  196. uses MacTypes,ImageCompression,Components,Movies;
  197. {$endc} {not MACOSALLINCLUDE}
  198. {$ifc TARGET_OS_MAC}
  199. {$ALIGN MAC68K}
  200. const
  201. kMovieVersion = 0; { version number of the format here described }
  202. {***************************************
  203. *
  204. * General Types -
  205. * These types are used in more than one of the
  206. * directory types.
  207. *
  208. ***************************************}
  209. { MoviesUserData is the type used for user data in movie and track directories }
  210. type
  211. MoviesUserDataPtr = ^MoviesUserData;
  212. MoviesUserData = record
  213. size: SInt32; { size of this user data }
  214. udType: SInt32; { type of user data }
  215. data: array [0..0] of SInt8; { the user data }
  216. end;
  217. type
  218. UserDataAtomPtr = ^UserDataAtom;
  219. UserDataAtom = record
  220. size: SInt32;
  221. atomType: SInt32;
  222. userData: array [0..0] of MoviesUserData;
  223. end;
  224. { MoviesDataDescription tells us where the data for the movie or track lives.
  225. The data can follow the directory, be in the datafork of the same file as the directory resource,
  226. be in the resource fork of the same file as the directory resource, be in another file in the
  227. data fork or resource fork, or require a specific bottleneck to fetch the data. }
  228. {***************************************
  229. *
  230. * MediaDirectory information -
  231. * The MediaDirectory is tightly coupled to the data.
  232. *
  233. ***************************************}
  234. { SampleDescription is in Movies.h }
  235. type
  236. SampleDescriptionAtomPtr = ^SampleDescriptionAtom;
  237. SampleDescriptionAtom = record
  238. size: SInt32;
  239. atomType: SInt32; { = 'stsd' }
  240. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  241. numEntries: SInt32;
  242. sampleDescTable: array [0..0] of SampleDescription;
  243. end;
  244. { TimeToSampleNum maps physical sample time to physical sample number. }
  245. type
  246. TimeToSampleNumPtr = ^TimeToSampleNum;
  247. TimeToSampleNum = record
  248. sampleCount: SInt32;
  249. sampleDuration: TimeValue;
  250. end;
  251. type
  252. TimeToSampleNumAtomPtr = ^TimeToSampleNumAtom;
  253. TimeToSampleNumAtom = record
  254. size: SInt32;
  255. atomType: SInt32; { = 'stts' }
  256. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  257. numEntries: SInt32;
  258. timeToSampleNumTable: array [0..0] of TimeToSampleNum;
  259. end;
  260. { SyncSamples is a list of the physical samples which are self contained. }
  261. type
  262. SyncSampleAtomPtr = ^SyncSampleAtom;
  263. SyncSampleAtom = record
  264. size: SInt32;
  265. atomType: SInt32; { = 'stss' }
  266. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  267. numEntries: SInt32;
  268. syncSampleTable: array [0..0] of SInt32;
  269. end;
  270. { SampleToChunk maps physical sample number to chunk number. }
  271. { same as SampleToChunk, but redundant first sample is removed }
  272. type
  273. SampleToChunkPtr = ^SampleToChunk;
  274. SampleToChunk = record
  275. firstChunk: SInt32;
  276. samplesPerChunk: SInt32;
  277. sampleDescriptionID: SInt32;
  278. end;
  279. type
  280. SampleToChunkAtomPtr = ^SampleToChunkAtom;
  281. SampleToChunkAtom = record
  282. size: SInt32;
  283. atomType: SInt32; { = 'stsc' }
  284. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  285. numEntries: SInt32;
  286. sampleToChunkTable: array [0..0] of SampleToChunk;
  287. end;
  288. type
  289. ChunkOffsetAtomPtr = ^ChunkOffsetAtom;
  290. ChunkOffsetAtom = record
  291. size: SInt32;
  292. atomType: SInt32; { = 'stco' }
  293. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  294. numEntries: SInt32;
  295. chunkOffsetTable: array [0..0] of SInt32;
  296. end;
  297. type
  298. SampleSizeAtomPtr = ^SampleSizeAtom;
  299. SampleSizeAtom = record
  300. size: SInt32;
  301. atomType: SInt32; { = 'stsz' }
  302. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  303. sampleSize: SInt32;
  304. numEntries: SInt32;
  305. sampleSizeTable: array [0..0] of SInt32;
  306. end;
  307. type
  308. ShadowSyncPtr = ^ShadowSync;
  309. ShadowSync = record
  310. fdSampleNum: SInt32;
  311. syncSampleNum: SInt32;
  312. end;
  313. type
  314. ShadowSyncAtomPtr = ^ShadowSyncAtom;
  315. ShadowSyncAtom = record
  316. size: SInt32;
  317. atomType: SInt32; { = 'stsz' }
  318. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  319. numEntries: SInt32;
  320. shadowSyncTable: array [0..0] of ShadowSync;
  321. end;
  322. { CompositionOffsetEntry maps sample numbers to composition offsets. }
  323. type
  324. CompositionOffsetEntryPtr = ^CompositionOffsetEntry;
  325. CompositionOffsetEntry = record
  326. sampleCount: SInt32;
  327. displayOffset: TimeValue;
  328. end;
  329. type
  330. CompositionOffsetAtomPtr = ^CompositionOffsetAtom;
  331. CompositionOffsetAtom = record
  332. size: SInt32;
  333. atomType: SInt32; { = 'ctts' }
  334. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  335. numEntries: SInt32;
  336. compositionOffsetTable: array [0..0] of CompositionOffsetEntry;
  337. end;
  338. type
  339. SampleDependencyAtomPtr = ^SampleDependencyAtom;
  340. SampleDependencyAtom = record
  341. size: SInt32;
  342. atomType: SInt32; { = 'sdtp' }
  343. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  344. sampleDependencyTable: array [0..0] of UInt8;
  345. end;
  346. {
  347. NOTE: The values for these flags that shipped with QuickTime 7.0 were incorrect.
  348. They matched neither the specification nor the implementation -- the "Yes" and "No" bits
  349. were reversed. The flags have been corrected but renamed to ensure that code using
  350. the incorrect flags is reviewed by developers.
  351. enum (
  352. kQTSampleDependency_DependsOnOthers = 1<<5, // INCORRECT VALUE
  353. kQTSampleDependency_DoesNotDependOnOthers = 1<<4, // INCORRECT VALUE
  354. kQTSampleDependency_IsDependedOnByOthers = 1<<3, // INCORRECT VALUE
  355. kQTSampleDependency_IsNotDependedOnByOthers = 1<<2, // INCORRECT VALUE
  356. kQTSampleDependency_HasRedundantCoding = 1<<1, // INCORRECT VALUE
  357. kQTSampleDependency_HasNoRedundantCoding = 1<<0 // INCORRECT VALUE
  358. );
  359. }
  360. { Values for entries in SampleDependencyAtom.sampleDependencyTable[]}
  361. const
  362. { bit 0x80 is reserved; bit combinations 0x30, 0xC0 and 0x03 are reserved}
  363. kQTSampleDependency_EarlierDisplayTimesAllowed = 1 shl 6; { corresponds to flag mediaSampleEarlierDisplayTimesAllowed except at different bit offset}
  364. kQTSampleDependency_DoesNotDependOnOthers_Corrected = 1 shl 5; { ie: an I picture}
  365. kQTSampleDependency_DependsOnOthers_Corrected = 1 shl 4; { ie: not an I picture}
  366. kQTSampleDependency_IsNotDependedOnByOthers_Corrected = 1 shl 3; { mediaSampleDroppable}
  367. kQTSampleDependency_IsDependedOnByOthers_Corrected = 1 shl 2;
  368. kQTSampleDependency_HasNoRedundantCoding_Corrected = 1 shl 1;
  369. kQTSampleDependency_HasRedundantCoding_Corrected = 1 shl 0;
  370. type
  371. CompositionShiftLeastGreatestAtomPtr = ^CompositionShiftLeastGreatestAtom;
  372. CompositionShiftLeastGreatestAtom = record
  373. size: SInt32;
  374. atomType: SInt32; { = 'cslg' }
  375. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  376. compositionOffsetToDTDDeltaShift: SInt32;
  377. leastDecodeToDisplayDelta: SInt32;
  378. greatestDecodeToDisplayDelta: SInt32;
  379. displayStartTime: SInt32;
  380. displayEndTime: SInt32;
  381. end;
  382. type
  383. PartialSyncSampleAtomPtr = ^PartialSyncSampleAtom;
  384. PartialSyncSampleAtom = record
  385. size: SInt32;
  386. atomType: SInt32; { = 'stps' }
  387. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  388. numEntries: SInt32;
  389. partialSyncSampleTable: array [0..0] of UInt32;
  390. end;
  391. type
  392. SampleTableAtomPtr = ^SampleTableAtom;
  393. SampleTableAtom = record
  394. size: SInt32;
  395. atomType: SInt32; { = 'stbl' }
  396. sampleDescription: SampleDescriptionAtom;
  397. timeToSampleNum: TimeToSampleNumAtom;
  398. sampleToChunk: SampleToChunkAtom;
  399. syncSample: SyncSampleAtom;
  400. sampleSize: SampleSizeAtom;
  401. chunkOffset: ChunkOffsetAtom;
  402. shadowSync: ShadowSyncAtom;
  403. end;
  404. type
  405. PublicHandlerInfoPtr = ^PublicHandlerInfo;
  406. PublicHandlerInfo = record
  407. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  408. componentType: SInt32;
  409. componentSubType: SInt32;
  410. componentManufacturer: SInt32;
  411. componentFlags: SInt32;
  412. componentFlagsMask: SInt32;
  413. componentName: array [0..0] of SInt8;
  414. end;
  415. type
  416. HandlerAtomPtr = ^HandlerAtom;
  417. HandlerAtom = record
  418. size: SInt32;
  419. atomType: SInt32; { = 'hdlr' }
  420. hInfo: PublicHandlerInfo;
  421. end;
  422. { a data reference is a private structure }
  423. type
  424. DataRefAtom = SInt32;
  425. DataInfoAtom = record
  426. size: SInt32;
  427. atomType: SInt32; { = 'dinf' }
  428. dataRef: DataRefAtom;
  429. end;
  430. type
  431. RgnAtomPtr = ^RgnAtom;
  432. RgnAtom = record
  433. size: SInt32;
  434. atomType: SInt32;
  435. rgnSize: SInt16;
  436. rgnBBox: Rect;
  437. data: array [0..0] of SInt8;
  438. end;
  439. type
  440. MatteCompressedAtomPtr = ^MatteCompressedAtom;
  441. MatteCompressedAtom = record
  442. size: SInt32;
  443. atomType: SInt32;
  444. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  445. matteImageDescription: ImageDescription;
  446. matteData: array [0..0] of SInt8;
  447. end;
  448. type
  449. MatteAtomPtr = ^MatteAtom;
  450. MatteAtom = record
  451. size: SInt32;
  452. atomType: SInt32;
  453. aCompressedMatte: MatteCompressedAtom;
  454. end;
  455. type
  456. ClippingAtomPtr = ^ClippingAtom;
  457. ClippingAtom = record
  458. size: SInt32;
  459. atomType: SInt32;
  460. aRgnClip: RgnAtom;
  461. end;
  462. {**********************
  463. * Media Info Example Structures
  464. **********************}
  465. type
  466. VideoMediaInfoHeaderPtr = ^VideoMediaInfoHeader;
  467. VideoMediaInfoHeader = record
  468. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  469. graphicsMode: SInt16; { for QD - transfer mode }
  470. opColorRed: SInt16; { opcolor for transfer mode }
  471. opColorGreen: SInt16;
  472. opColorBlue: SInt16;
  473. end;
  474. type
  475. VideoMediaInfoHeaderAtomPtr = ^VideoMediaInfoHeaderAtom;
  476. VideoMediaInfoHeaderAtom = record
  477. size: SInt32; { size of Media info }
  478. atomType: SInt32; { = 'vmhd' }
  479. vmiHeader: VideoMediaInfoHeader;
  480. end;
  481. type
  482. VideoMediaInfoPtr = ^VideoMediaInfo;
  483. VideoMediaInfo = record
  484. size: SInt32; { size of Media info }
  485. atomType: SInt32; { = 'minf' }
  486. header: VideoMediaInfoHeaderAtom;
  487. dataHandler: HandlerAtom;
  488. dataInfo: DataInfoAtom;
  489. sampleTable: SampleTableAtom;
  490. end;
  491. type
  492. SoundMediaInfoHeaderPtr = ^SoundMediaInfoHeader;
  493. SoundMediaInfoHeader = record
  494. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  495. balance: SInt16;
  496. rsrvd: SInt16;
  497. end;
  498. type
  499. SoundMediaInfoHeaderAtomPtr = ^SoundMediaInfoHeaderAtom;
  500. SoundMediaInfoHeaderAtom = record
  501. size: SInt32; { size of Media info }
  502. atomType: SInt32; { = 'vmhd' }
  503. smiHeader: SoundMediaInfoHeader;
  504. end;
  505. type
  506. SoundMediaInfoPtr = ^SoundMediaInfo;
  507. SoundMediaInfo = record
  508. size: SInt32; { size of Media info }
  509. atomType: SInt32; { = 'minf' }
  510. header: SoundMediaInfoHeaderAtom;
  511. dataHandler: HandlerAtom;
  512. dataReference: DataRefAtom;
  513. sampleTable: SampleTableAtom;
  514. end;
  515. { whatever data the media handler needs goes after the atomType }
  516. type
  517. MediaInfoPtr = ^MediaInfo;
  518. MediaInfo = record
  519. size: SInt32;
  520. atomType: SInt32;
  521. end;
  522. MediaInfo_fix = MediaInfo;
  523. {**********************
  524. * Media Directory Structures
  525. **********************}
  526. type
  527. MediaHeaderPtr = ^MediaHeader;
  528. MediaHeader = record
  529. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  530. creationTime: SInt32; { seconds since Jan 1904 when directory was created }
  531. modificationTime: SInt32; { seconds since Jan 1904 when directory was appended }
  532. timeScale: TimeValue; { start time for Media (Media time) }
  533. duration: TimeValue; { length of Media (Media time) }
  534. language: SInt16;
  535. quality: SInt16;
  536. end;
  537. type
  538. MediaHeaderAtomPtr = ^MediaHeaderAtom;
  539. MediaHeaderAtom = record
  540. size: SInt32;
  541. atomType: SInt32;
  542. header: MediaHeader;
  543. end;
  544. type
  545. MediaDirectoryPtr = ^MediaDirectory;
  546. MediaDirectory = record
  547. size: SInt32;
  548. atomType: SInt32; { = 'mdia' }
  549. mediaHeader: MediaHeaderAtom; { standard Media information }
  550. mediaHandler: HandlerAtom;
  551. mediaInfo: MediaInfo_fix;
  552. end;
  553. {**********************
  554. * Track Structures
  555. **********************}
  556. const
  557. TrackEnable = 1 shl 0;
  558. TrackInMovie = 1 shl 1;
  559. TrackInPreview = 1 shl 2;
  560. TrackInPoster = 1 shl 3;
  561. type
  562. TrackHeaderPtr = ^TrackHeader;
  563. TrackHeader = record
  564. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  565. creationTime: SInt32; { seconds since Jan 1904 when directory was created }
  566. modificationTime: SInt32; { seconds since Jan 1904 when directory was appended }
  567. trackID: SInt32;
  568. reserved1: SInt32;
  569. duration: TimeValue; { length of track (track time) }
  570. reserved2: SInt32;
  571. reserved3: SInt32;
  572. layer: SInt16;
  573. alternateGroup: SInt16;
  574. volume: SInt16;
  575. reserved4: SInt16;
  576. matrix: MatrixRecord;
  577. trackWidth: Fixed;
  578. trackHeight: Fixed;
  579. end;
  580. type
  581. TrackHeaderAtomPtr = ^TrackHeaderAtom;
  582. TrackHeaderAtom = record
  583. size: SInt32; { size of track header }
  584. atomType: SInt32; { = 'tkhd' }
  585. header: TrackHeader;
  586. end;
  587. type
  588. EditListTypePtr = ^EditListType;
  589. EditListType = record
  590. trackDuration: TimeValue;
  591. mediaTime: TimeValue;
  592. mediaRate: Fixed;
  593. end;
  594. type
  595. EditListAtomPtr = ^EditListAtom;
  596. EditListAtom = record
  597. size: SInt32;
  598. atomType: SInt32; { = elst }
  599. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  600. numEntries: SInt32;
  601. editListTable: array [0..0] of EditListType;
  602. end;
  603. type
  604. EditsAtomPtr = ^EditsAtom;
  605. EditsAtom = record
  606. size: SInt32;
  607. atomType: SInt32; { = edts }
  608. editList: EditListAtom;
  609. end;
  610. type
  611. TrackLoadSettingsPtr = ^TrackLoadSettings;
  612. TrackLoadSettings = record
  613. preloadStartTime: TimeValue;
  614. preloadDuration: TimeValue;
  615. preloadFlags: SInt32;
  616. defaultHints: SInt32;
  617. end;
  618. type
  619. TrackLoadSettingsAtomPtr = ^TrackLoadSettingsAtom;
  620. TrackLoadSettingsAtom = record
  621. size: SInt32;
  622. atomType: SInt32; { = load }
  623. settings: TrackLoadSettings;
  624. end;
  625. type
  626. TrackCleanApertureDimensionsPtr = ^TrackCleanApertureDimensions;
  627. TrackCleanApertureDimensions = record
  628. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  629. cleanApertureDimensions: FixedPoint;
  630. end;
  631. type
  632. TrackCleanApertureDimensionsAtomPtr = ^TrackCleanApertureDimensionsAtom;
  633. TrackCleanApertureDimensionsAtom = record
  634. size: SInt32;
  635. atomType: SInt32; { = 'tapt' }
  636. cleanApertureDimensions: TrackCleanApertureDimensions;
  637. end;
  638. type
  639. TrackProductionApertureDimensionsPtr = ^TrackProductionApertureDimensions;
  640. TrackProductionApertureDimensions = record
  641. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  642. productionApertureDimensions: FixedPoint;
  643. end;
  644. type
  645. TrackProductionApertureDimensionsAtomPtr = ^TrackProductionApertureDimensionsAtom;
  646. TrackProductionApertureDimensionsAtom = record
  647. size: SInt32;
  648. atomType: SInt32; { = 'prof' }
  649. productionApertureDimensions: TrackProductionApertureDimensions;
  650. end;
  651. type
  652. TrackEncodedPixelsDimensionsPtr = ^TrackEncodedPixelsDimensions;
  653. TrackEncodedPixelsDimensions = record
  654. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  655. encodedPixelsDimensions: FixedPoint;
  656. end;
  657. type
  658. TrackEncodedPixelsDimensionsAtomPtr = ^TrackEncodedPixelsDimensionsAtom;
  659. TrackEncodedPixelsDimensionsAtom = record
  660. size: SInt32;
  661. atomType: SInt32; { = 'enof' }
  662. encodedPixelsDimensions: TrackEncodedPixelsDimensions;
  663. end;
  664. type
  665. TrackDirectoryPtr = ^TrackDirectory;
  666. TrackDirectory = record
  667. size: SInt32;
  668. atomType: SInt32; { = 'trak' }
  669. trackHeader: TrackHeaderAtom; { standard track information }
  670. trackClip: ClippingAtom;
  671. edits: EditsAtom;
  672. media: MediaDirectory;
  673. userData: UserDataAtom; { space for extending with new data types }
  674. end;
  675. TrackDirectory_fix = TrackDirectory;
  676. {***************************************
  677. *
  678. * MovieDirectory -
  679. * The MovieDirectory is the top level structure which
  680. * holds the TrackInstance describing where the
  681. * TrackDirectories are.
  682. *
  683. ***************************************}
  684. type
  685. MovieHeaderPtr = ^MovieHeader;
  686. MovieHeader = record
  687. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  688. creationTime: SInt32; { seconds since Jan 1904 when directory was created }
  689. modificationTime: SInt32; { seconds since Jan 1904 when directory was appended }
  690. timeScale: TimeValue; { Time specifications }
  691. duration: TimeValue;
  692. preferredRate: Fixed; { rate at which to play this movie }
  693. preferredVolume: SInt16; { volume to play movie at }
  694. reserved1: SInt16;
  695. preferredLong1: SInt32;
  696. preferredLong2: SInt32;
  697. matrix: MatrixRecord;
  698. previewTime: TimeValue; { time in track the proxy begins (track time) }
  699. previewDuration: TimeValue; { how long the proxy lasts (track time) }
  700. posterTime: TimeValue; { time in track the proxy begins (track time) }
  701. selectionTime: TimeValue; { time in track the proxy begins (track time) }
  702. selectionDuration: TimeValue; { time in track the proxy begins (track time) }
  703. currentTime: TimeValue; { time in track the proxy begins (track time) }
  704. nextTrackID: SInt32; { next value to use for a TrackID }
  705. end;
  706. type
  707. MovieHeaderAtomPtr = ^MovieHeaderAtom;
  708. MovieHeaderAtom = record
  709. size: SInt32;
  710. atomType: SInt32; { = 'mvhd' }
  711. header: MovieHeader;
  712. end;
  713. type
  714. TrackDirectoryEntryPtr = ^TrackDirectoryEntry;
  715. TrackDirectoryEntry = record
  716. trackDirectory: TrackDirectory_fix; { Track directory information }
  717. end;
  718. type
  719. MovieDirectoryPtr = ^MovieDirectory;
  720. MovieDirectory = record
  721. size: SInt32;
  722. atomType: SInt32; { = 'moov' }
  723. header: MovieHeaderAtom;
  724. movieClip: ClippingAtom;
  725. { Track Directories }
  726. track: array [0..0] of TrackDirectoryEntry; { Track directory information }
  727. { User data for Movie }
  728. userData: UserDataAtom; { space for user extensions }
  729. end;
  730. {***************************************
  731. ***************************************}
  732. { Movie formats and tags }
  733. const
  734. { some system defined format IDs }
  735. QT_MOVIE_TYPE = FourCharCode('moov');
  736. QT_TRACK_TYPE = FourCharCode('trak');
  737. QT_MEDIA_TYPE = FourCharCode('mdia');
  738. QT_VIDEO_TYPE = FourCharCode('vide');
  739. QT_SOUND_TYPE = FourCharCode('soun');
  740. const
  741. MOVIE_TYPE = FourCharCode('moov');
  742. TRACK_TYPE = FourCharCode('trak');
  743. VIDEO_TYPE = FourCharCode('vide');
  744. SOUND_TYPE = FourCharCode('soun');
  745. {$ifc not TARGET_OS_WIN32}
  746. { The name "MEDIA_TYPE" has a name space collision on Win32.}
  747. const
  748. MEDIA_TYPE = FourCharCode('mdia');
  749. {$endc} {!TARGET_OS_WIN32}
  750. { atom id's }
  751. const
  752. MovieAID = FourCharCode('moov');
  753. MovieHeaderAID = FourCharCode('mvhd');
  754. ClipAID = FourCharCode('clip');
  755. RgnClipAID = FourCharCode('crgn');
  756. MatteAID = FourCharCode('matt');
  757. MatteCompAID = FourCharCode('kmat');
  758. TrackAID = FourCharCode('trak');
  759. UserDataAID = FourCharCode('udta');
  760. TrackHeaderAID = FourCharCode('tkhd');
  761. EditsAID = FourCharCode('edts');
  762. EditListAID = FourCharCode('elst');
  763. MediaAID = FourCharCode('mdia');
  764. MediaHeaderAID = FourCharCode('mdhd');
  765. MediaInfoAID = FourCharCode('minf');
  766. VideoMediaInfoHeaderAID = FourCharCode('vmhd');
  767. SoundMediaInfoHeaderAID = FourCharCode('smhd');
  768. GenericMediaInfoHeaderAID = FourCharCode('gmhd');
  769. GenericMediaInfoAID = FourCharCode('gmin');
  770. DataInfoAID = FourCharCode('dinf');
  771. DataRefAID = FourCharCode('dref');
  772. SampleTableAID = FourCharCode('stbl');
  773. STSampleDescAID = FourCharCode('stsd');
  774. STTimeToSampAID = FourCharCode('stts');
  775. STSyncSampleAID = FourCharCode('stss');
  776. STSampleToChunkAID = FourCharCode('stsc');
  777. STShadowSyncAID = FourCharCode('stsh');
  778. HandlerAID = FourCharCode('hdlr');
  779. STSampleSizeAID = FourCharCode('stsz');
  780. STChunkOffsetAID = FourCharCode('stco');
  781. STChunkOffset64AID = FourCharCode('co64');
  782. STSampleIDAID = FourCharCode('stid');
  783. STCompositionOffsetAID = FourCharCode('ctts');
  784. STSampleDependencyAID = FourCharCode('sdtp');
  785. STCompositionShiftLeastGreatestAID = FourCharCode('cslg');
  786. STPartialSyncSampleAID = FourCharCode('stps');
  787. DataRefContainerAID = FourCharCode('drfc');
  788. TrackReferenceAID = FourCharCode('tref');
  789. ColorTableAID = FourCharCode('ctab');
  790. LoadSettingsAID = FourCharCode('load');
  791. PropertyAtomAID = FourCharCode('code');
  792. InputMapAID = FourCharCode('imap');
  793. MovieBufferHintsAID = FourCharCode('mbfh');
  794. MovieDataRefAliasAID = FourCharCode('mdra');
  795. SoundLocalizationAID = FourCharCode('sloc');
  796. CompressedMovieAID = FourCharCode('cmov');
  797. CompressedMovieDataAID = FourCharCode('cmvd');
  798. DataCompressionAtomAID = FourCharCode('dcom');
  799. ReferenceMovieRecordAID = FourCharCode('rmra');
  800. ReferenceMovieDescriptorAID = FourCharCode('rmda');
  801. ReferenceMovieDataRefAID = FourCharCode('rdrf');
  802. ReferenceMovieVersionCheckAID = FourCharCode('rmvc');
  803. ReferenceMovieDataRateAID = FourCharCode('rmdr');
  804. ReferenceMovieComponentCheckAID = FourCharCode('rmcd');
  805. ReferenceMovieQualityAID = FourCharCode('rmqu');
  806. ReferenceMovieLanguageAID = FourCharCode('rmla');
  807. ReferenceMovieCPURatingAID = FourCharCode('rmcs');
  808. ReferenceMovieAlternateGroupAID = FourCharCode('rmag');
  809. ReferenceMovieNetworkStatusAID = FourCharCode('rnet');
  810. CloneMediaAID = FourCharCode('clon');
  811. FileTypeAID = FourCharCode('ftyp');
  812. SecureContentInfoAID = FourCharCode('sinf');
  813. SecureContentSchemeTypeAID = FourCharCode('schm');
  814. SecureContentSchemeInfoAID = FourCharCode('schi');
  815. TrackApertureModeDimensionsAID = FourCharCode('tapt'); { container atom including TrackCleanApertureDimensionsAID, TrackProductionApertureDimensionsAID and TrackEncodedPixelsDimensionsAID }
  816. TrackCleanApertureDimensionsAID = FourCharCode('clef');
  817. TrackProductionApertureDimensionsAID = FourCharCode('prof');
  818. TrackEncodedPixelsDimensionsAID = FourCharCode('enof');
  819. { Text ATOM definitions}
  820. type
  821. TextBoxAtomPtr = ^TextBoxAtom;
  822. TextBoxAtom = record
  823. size: SInt32;
  824. atomType: SInt32; { = 'tbox' }
  825. textBox: Rect; { New text box (overrides defaultTextBox)}
  826. end;
  827. type
  828. HiliteAtomPtr = ^HiliteAtom;
  829. HiliteAtom = record
  830. size: SInt32;
  831. atomType: SInt32; { = 'hlit' }
  832. selStart: SInt32; { hilite selection start character}
  833. selEnd: SInt32; { hilite selection end character}
  834. end;
  835. type
  836. KaraokeRecPtr = ^KaraokeRec;
  837. KaraokeRec = record
  838. timeVal: TimeValue;
  839. beginHilite: SInt16;
  840. endHilite: SInt16;
  841. end;
  842. type
  843. KaraokeAtomPtr = ^KaraokeAtom;
  844. KaraokeAtom = record
  845. numEntries: SInt32;
  846. karaokeEntries: array [0..0] of KaraokeRec;
  847. end;
  848. { for ReferenceMovieDataRefRecord.flags}
  849. const
  850. kDataRefIsSelfContained = 1 shl 0;
  851. type
  852. ReferenceMovieDataRefRecordPtr = ^ReferenceMovieDataRefRecord;
  853. ReferenceMovieDataRefRecord = record
  854. flags: SInt32;
  855. dataRefType: OSType;
  856. dataRefSize: SInt32;
  857. dataRef: array [0..0] of SInt8;
  858. end;
  859. { for VersionCheckRecord.checkType}
  860. const
  861. kVersionCheckMin = 0; { val1 is the min. version required}
  862. kVersionCheckMask = 1; { (gestalt return value & val2) must == val1}
  863. type
  864. QTAltVersionCheckRecordPtr = ^QTAltVersionCheckRecord;
  865. QTAltVersionCheckRecord = record
  866. flags: SInt32; { currently always 0}
  867. gestaltTag: OSType;
  868. val1: UInt32;
  869. val2: UInt32;
  870. checkType: SInt16;
  871. end;
  872. { some helpful constants for DataRateRecord.dataRate }
  873. const
  874. kDataRate144ModemRate = 1400;
  875. kDataRate288ModemRate = 2800;
  876. kDataRateISDNRate = 5600;
  877. kDataRateDualISDNRate = 11200;
  878. kDataRate256kbpsRate = 25600;
  879. kDataRate384kbpsRate = 38400;
  880. kDataRate512kbpsRate = 51200;
  881. kDataRate768kbpsRate = 76800;
  882. kDataRate1MbpsRate = 100000;
  883. kDataRateT1Rate = 150000;
  884. kDataRateInfiniteRate = $7FFFFFFF;
  885. kDataRateDefaultIfNotSet = kDataRate512kbpsRate;
  886. type
  887. QTAltDataRateRecordPtr = ^QTAltDataRateRecord;
  888. QTAltDataRateRecord = record
  889. flags: SInt32; { currently always 0}
  890. dataRate: SInt32;
  891. end;
  892. type
  893. QTAltComponentCheckRecordPtr = ^QTAltComponentCheckRecord;
  894. QTAltComponentCheckRecord = record
  895. flags: SInt32; { currently always 0 }
  896. cd: ComponentDescription;
  897. minVersion: UInt32;
  898. end;
  899. type
  900. QTAltLanguageRecordPtr = ^QTAltLanguageRecord;
  901. QTAltLanguageRecord = record
  902. flags: SInt32; { currently always 0}
  903. language: SInt16;
  904. end;
  905. const
  906. kQTCPUSpeed1Rating = 100; { slowest}
  907. kQTCPUSpeed2Rating = 200;
  908. kQTCPUSpeed3Rating = 300;
  909. kQTCPUSpeed4Rating = 400;
  910. kQTCPUSpeed5Rating = 500; { fastest}
  911. type
  912. QTAltCPURatingRecordPtr = ^QTAltCPURatingRecord;
  913. QTAltCPURatingRecord = record
  914. flags: UInt32; { currently always 0}
  915. speed: UInt16;
  916. end;
  917. type
  918. ReferenceMovieNetworkStatusRecordPtr = ^ReferenceMovieNetworkStatusRecord;
  919. ReferenceMovieNetworkStatusRecord = record
  920. flags: UInt32; { currently always 0}
  921. valueCount: UInt32; { how many status values are in array}
  922. netStatusValues: array [0..0] of SInt32; { a value from kQTNetworkStatus... constants}
  923. end;
  924. type
  925. CloneRecordPtr = ^CloneRecord;
  926. CloneRecord = record
  927. flags: SInt32;
  928. masterTrackID: SInt32; { track ID of the track we're cloning }
  929. end;
  930. type
  931. CloneAtomPtr = ^CloneAtom;
  932. CloneAtom = record
  933. size: SInt32;
  934. atomType: SInt32; { = clon }
  935. cloneInfo: CloneRecord;
  936. end;
  937. type
  938. FileTypeAtomPtr = ^FileTypeAtom;
  939. FileTypeAtom = record
  940. size: SInt32;
  941. atomType: SInt32; { = 'ftyp' }
  942. majorBrand: SInt32; { best use brand }
  943. minorVersion: SInt32;
  944. compatibleBrands: array [0..3] of SInt32; { 1 or greater }
  945. end;
  946. const
  947. kQTFileTypeBrandQuickTimeMovie = FourCharCode('qt '); { QuickTime movie files}
  948. kQTFileTypeBrandISOFile = FourCharCode('isom'); { ISO Base Media files}
  949. kQTFileTypeBrandMPEG4v1 = FourCharCode('mp41'); { MPEG-4 (ISO/IEC 14496-1) version 1 files}
  950. kQTFileTypeBrandMPEG4v2 = FourCharCode('mp42'); { MPEG-4 (ISO/IEC 14496-1) version 2 files}
  951. type
  952. SecureContentInfoAtomPtr = ^SecureContentInfoAtom;
  953. SecureContentInfoAtom = record
  954. size: SInt32;
  955. atomType: SInt32; { = 'sinf' }
  956. end;
  957. type
  958. SecureContentSchemeTypeAtomPtr = ^SecureContentSchemeTypeAtom;
  959. SecureContentSchemeTypeAtom = record
  960. size: SInt32;
  961. atomType: SInt32; { = 'schm' }
  962. flags: SInt32; { 1 byte of version / 3 bytes of flags }
  963. schemeType: SInt32;
  964. schemeVersion: UInt32;
  965. { if flags & 1, C string holding URL for security component server}
  966. end;
  967. type
  968. SecureContentSchemeInfoAtomPtr = ^SecureContentSchemeInfoAtom;
  969. SecureContentSchemeInfoAtom = record
  970. size: SInt32;
  971. atomType: SInt32; { = 'schi' }
  972. end;
  973. {$endc} {TARGET_OS_MAC}
  974. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  975. end.
  976. {$endc} {not MACOSALLINCLUDE}