MoviesFormat.pas 32 KB

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