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