Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

components.h

00001 // Basic types:
00002 
00003 typedef char *                          Ptr;
00004 typedef Ptr *                           Handle;
00005 typedef int32_t                         Size;
00006 typedef unsigned char                   Boolean;
00007 typedef unsigned char                   Str31[32];
00008 typedef int32_t                         Fixed;
00009 
00010 typedef int32_t OSErr;
00011 typedef int OSType;
00012 
00013 typedef int32_t ComponentResult;
00014 typedef unsigned char                   UInt8;
00015 typedef signed char                     SInt8;
00016 typedef unsigned short                  UInt16;
00017 typedef signed short                    SInt16;
00018 typedef uint32_t                        UInt32;
00019 typedef int32_t                         SInt32;
00020 
00021 #define FOUR_CHAR_CODE(a,b,c,d)       ((uint32_t)(a)<<24 | (uint32_t)(b)<<16 | (uint32_t)(c)<<8 | (uint32_t)(d)) /* otherwise compiler will complain about values with high bit set */
00022 
00023 // codec private shit:
00024 typedef void *GlobalsPtr;
00025 typedef void **Globals;
00026 
00027 //==================== COMPONENTS ===========================
00028 
00029 struct __attribute__((__packed__)) ComponentParameters {
00030     UInt8                           flags;                      /* call modifiers: sync/async, deferred, immed, etc */
00031     UInt8                           paramSize;                  /* size in bytes of actual parameters passed to this call */
00032     short                           what;                       /* routine selector, negative for Component management calls */
00033     int32_t                         params[1];                  /* actual parameters for the indicated routine */
00034 };
00035 typedef struct ComponentParameters      ComponentParameters;
00036 
00037 
00038 struct __attribute__((__packed__)) ComponentDescription {
00039     OSType                          componentType;              /* A unique 4-byte code indentifying the command set */
00040     OSType                          componentSubType;           /* Particular flavor of this instance */
00041     OSType                          componentManufacturer;      /* Vendor indentification */
00042     uint32_t                        componentFlags;             /* 8 each for Component,Type,SubType,Manuf/revision */
00043     uint32_t                        componentFlagsMask;         /* Mask for specifying which flags to consider in search, zero during registration */
00044 };
00045 typedef struct ComponentDescription     ComponentDescription;
00046 
00047 
00048 struct __attribute__((__packed__)) ResourceSpec {
00049     OSType                          resType;                    /* 4-byte code    */
00050     short                           resID;                      /*         */
00051 };
00052 typedef struct ResourceSpec             ResourceSpec;
00053 
00054 
00055 struct __attribute__((__packed__)) ComponentResource {
00056     ComponentDescription            cd;                         /* Registration parameters */
00057     ResourceSpec                    component;                  /* resource where Component code is found */
00058     ResourceSpec                    componentName;              /* name string resource */
00059     ResourceSpec                    componentInfo;              /* info string resource */
00060     ResourceSpec                    componentIcon;              /* icon resource */
00061 };
00062 typedef struct ComponentResource        ComponentResource;
00063 typedef ComponentResource *             ComponentResourcePtr;
00064 typedef ComponentResourcePtr *          ComponentResourceHandle;
00065 
00066 
00067 struct __attribute__((__packed__)) ComponentRecord {
00068     int32_t                            data[1];
00069 };
00070 typedef struct ComponentRecord          ComponentRecord;
00071 typedef ComponentRecord *               Component;
00072 
00073 
00074 struct __attribute__((__packed__)) ComponentInstanceRecord {
00075     int32_t                            data[1];
00076 };
00077 typedef struct ComponentInstanceRecord  ComponentInstanceRecord;
00078 
00079 typedef ComponentInstanceRecord *       ComponentInstance;
00080 
00081 // ========================= QUICKDRAW =========================
00082 
00083 struct __attribute__((__packed__)) Rect {
00084     short                           top;
00085     short                           left;
00086     short                           bottom;
00087     short                           right;
00088 };
00089 typedef struct Rect                     Rect;
00090 typedef Rect *                          RectPtr;
00091 
00092 struct __attribute__((__packed__)) RGBColor {
00093     unsigned short                  red;                        /*magnitude of red component*/
00094     unsigned short                  green;                      /*magnitude of green component*/
00095     unsigned short                  blue;                       /*magnitude of blue component*/
00096 };
00097 typedef struct RGBColor                 RGBColor;
00098 typedef RGBColor *                      RGBColorPtr;
00099 typedef RGBColorPtr *                   RGBColorHdl;
00100 
00101 struct __attribute__((__packed__)) ColorSpec {
00102     short                           value;                      /*index or other value*/
00103     RGBColor                        rgb;                        /*true color*/
00104 };
00105 typedef struct ColorSpec                ColorSpec;
00106 typedef ColorSpec *                     ColorSpecPtr;
00107 typedef ColorSpec                       CSpecArray[1];
00108 
00109 struct __attribute__((__packed__)) ColorTable {
00110     int32_t                         ctSeed;                     /*unique identifier for table*/
00111     short                           ctFlags;                    /*high bit: 0 = PixMap; 1 = device*/
00112     short                           ctSize;                     /*number of entries in CTTable*/
00113     CSpecArray                      ctTable;                    /*array [0..0] of ColorSpec*/
00114 };
00115 typedef struct ColorTable               ColorTable;
00116 typedef ColorTable *                    CTabPtr;
00117 typedef CTabPtr *                       CTabHandle;
00118 
00119 struct __attribute__((__packed__)) MatrixRecord {
00120     Fixed                           matrix[3][3];
00121 };
00122 typedef struct MatrixRecord             MatrixRecord;
00123 typedef MatrixRecord *                  MatrixRecordPtr;
00124 
00125 typedef int32_t                         ImageSequence;
00126 typedef OSType                          CodecType;
00127 typedef unsigned short                  CodecFlags;
00128 typedef uint32_t                        CodecQ;
00129 
00130 struct __attribute__((__packed__)) ImageDescription {
00131     int32_t                         idSize;                     /* total size of ImageDescription including extra data ( CLUTs and other per sequence data ) */
00132     CodecType                       cType;                      /* what kind of codec compressed this data */
00133     int32_t                         resvd1;                     /* reserved for Apple use */
00134     short                           resvd2;                     /* reserved for Apple use */
00135     short                           dataRefIndex;               /* set to zero  */
00136     short                           version;                    /* which version is this data */
00137     short                           revisionLevel;              /* what version of that codec did this */
00138     int32_t                         vendor;                     /* whose  codec compressed this data */
00139     CodecQ                          temporalQuality;            /* what was the temporal quality factor  */
00140     CodecQ                          spatialQuality;             /* what was the spatial quality factor */
00141     short                           width;                      /* how many pixels wide is this data */
00142     short                           height;                     /* how many pixels high is this data */
00143     Fixed                           hRes;                       /* horizontal resolution */
00144     Fixed                           vRes;                       /* vertical resolution */
00145     int32_t                         dataSize;                   /* if known, the size of data for this image descriptor */
00146     short                           frameCount;                 /* number of frames this description applies to */
00147     Str31                           name;                       /* name of codec ( in case not installed )  */
00148     short                           depth;                      /* what depth is this data (1-32) or ( 33-40 grayscale ) */
00149     short                           clutID;                     /* clut id or if 0 clut follows  or -1 if no clut */
00150 };
00151 typedef struct ImageDescription         ImageDescription;
00152 typedef ImageDescription *              ImageDescriptionPtr;
00153 typedef ImageDescriptionPtr *           ImageDescriptionHandle;
00154 
00155 /* values for PixMap.pixelFormat*/
00156 enum {
00157     k16LE555PixelFormat         = FOUR_CHAR_CODE('L','5','5','5'),       /* 16 bit LE rgb 555 (PC)*/
00158     k16LE5551PixelFormat        = FOUR_CHAR_CODE('5','5','5','1'),       /* 16 bit LE rgb 5551*/
00159     k16BE565PixelFormat         = FOUR_CHAR_CODE('B','5','6','5'),       /* 16 bit BE rgb 565*/
00160     k16LE565PixelFormat         = FOUR_CHAR_CODE('L','5','6','5'),       /* 16 bit LE rgb 565*/
00161     k24BGRPixelFormat           = FOUR_CHAR_CODE('2','4','B','G'),       /* 24 bit bgr */
00162     k32BGRAPixelFormat          = FOUR_CHAR_CODE('B','G','R','A'),       /* 32 bit bgra    (Matrox)*/
00163     k32ABGRPixelFormat          = FOUR_CHAR_CODE('A','B','G','R'),       /* 32 bit abgr    */
00164     k32RGBAPixelFormat          = FOUR_CHAR_CODE('R','G','B','A'),       /* 32 bit rgba    */
00165     kYUVSPixelFormat            = FOUR_CHAR_CODE('y','u','v','s'),       /* YUV 4:2:2 byte ordering 16-unsigned = 'YUY2'*/
00166     kYUVUPixelFormat            = FOUR_CHAR_CODE('y','u','v','u'),       /* YUV 4:2:2 byte ordering 16-signed*/
00167     kYVU9PixelFormat            = FOUR_CHAR_CODE('Y','V','U','9'),       /* YVU9 Planar    9*/
00168     kYUV411PixelFormat          = FOUR_CHAR_CODE('Y','4','1','1'),       /* YUV 4:1:1 Interleaved  16*/
00169     kYVYU422PixelFormat         = FOUR_CHAR_CODE('Y','V','Y','U'),       /* YVYU 4:2:2 byte ordering   16*/
00170     kUYVY422PixelFormat         = FOUR_CHAR_CODE('U','Y','V','Y'),       /* UYVY 4:2:2 byte ordering   16*/
00171     kYUV211PixelFormat          = FOUR_CHAR_CODE('Y','2','1','1'),       /* YUV 2:1:1 Packed   8*/
00172     k2vuyPixelFormat            = FOUR_CHAR_CODE('2','v','u','y')        /* UYVY 4:2:2 byte ordering   16*/
00173 };
00174 
00175 struct __attribute__((__packed__)) PixMapExtension {
00176     int32_t                         extSize;                    /*size of struct, duh!*/
00177     uint32_t                        pmBits;                     /*pixmap attributes bitfield*/
00178     void *                          pmGD;                       /*this is a GDHandle*/
00179     int32_t                         pmSeed;
00180     Fixed                           gammaLevel;                 /*pixmap gammalevel*/
00181     Fixed                           requestedGammaLevel;
00182     uint32_t                        reserved2;
00183     int32_t                         longRowBytes;               /*used when rowBytes > 16382*/
00184     uint32_t                        signature;
00185     Handle                          baseAddrHandle;
00186 };
00187 typedef struct PixMapExtension          PixMapExtension;
00188 
00189 typedef PixMapExtension *               PixMapExtPtr;
00190 typedef PixMapExtPtr *                  PixMapExtHandle;
00191 
00192 
00193 struct __attribute__((__packed__)) PixMap {
00194     Ptr                             baseAddr;                   /*pointer to pixels*/
00195     short                           rowBytes;                   /*offset to next line*/
00196     Rect                            bounds;                     /*encloses bitmap*/
00197     short                           pmVersion;                  /*pixMap version number*/
00198     short                           packType;                   /*defines packing format*/
00199     int32_t                         packSize;                   /*length of pixel data*/
00200     Fixed                           hRes;                       /*horiz. resolution (ppi)*/
00201     Fixed                           vRes;                       /*vert. resolution (ppi)*/
00202     short                           pixelType;                  /*defines pixel type*/
00203     short                           pixelSize;                  /*# bits in pixel*/
00204     short                           cmpCount;                   /*# components in pixel*/
00205     short                           cmpSize;                    /*# bits per component*/
00206     OSType                          pixelFormat;                /*fourCharCode representation*/
00207     CTabHandle                      pmTable;                    /*color map for this pixMap*/
00208     PixMapExtHandle                 pmExt;                      /*Handle to pixMap extension*/
00209 };
00210 typedef struct PixMap                   PixMap;
00211 typedef PixMap *                        PixMapPtr;
00212 typedef PixMapPtr *                     PixMapHandle;
00213 
00214 
00215 struct __attribute__((__packed__)) BitMap {
00216     Ptr                             baseAddr;
00217     short                           rowBytes;
00218     Rect                            bounds;
00219 };
00220 typedef struct BitMap                   BitMap;
00221 typedef BitMap *                        BitMapPtr;
00222 typedef BitMapPtr *                     BitMapHandle;
00223 typedef struct OpaqueRgnHandle*         RgnHandle;
00224 
00225 struct Pattern {
00226     UInt8                           pat[8];
00227 };
00228 typedef struct Pattern                  Pattern;
00229 typedef unsigned char                   Style;
00230 typedef Style                           StyleField;
00231 struct __attribute__((__packed__)) Point {
00232     short                           v;
00233     short                           h;
00234 };
00235 typedef struct Point                    Point;
00236 struct __attribute__((__packed__)) GrafPort {
00237     short                           device;
00238     BitMap                          portBits;
00239     Rect                            portRect;
00240     RgnHandle                       visRgn;
00241     RgnHandle                       clipRgn;
00242     Pattern                         bkPat;
00243     Pattern                         fillPat;
00244     Point                           pnLoc;
00245     Point                           pnSize;
00246     short                           pnMode;
00247     Pattern                         pnPat;
00248     short                           pnVis;
00249     short                           txFont;
00250     StyleField                      txFace;                     /*StyleField occupies 16-bits, but only first 8-bits are used*/
00251     UInt8                           txFlags;                    /* QuickTime uses second 8 bits of StyleField for txFlags */
00252     short                           txMode;
00253     short                           txSize;
00254     Fixed                           spExtra;
00255     int32_t                         fgColor;
00256     int32_t                         bkColor;
00257     short                           colrBit;
00258     short                           patStretch;
00259     Handle                          picSave;
00260     Handle                          rgnSave;
00261     Handle                          polySave;
00262     /*QDProcsPtr*/void*                      grafProcs;
00263 };
00264 typedef struct GrafPort                 GrafPort;
00265 typedef GrafPort *GWorldPtr;
00266 typedef GWorldPtr *GWorldHandle;
00267 #define anyCodec                ((CodecComponent)0)
00268 enum {
00269                                                                 /* transfer modes */
00270     srcCopy                     = 0,                            /*the 16 transfer modes*/
00271     srcOr                       = 1,
00272     srcXor                      = 2,
00273     srcBic                      = 3,
00274     notSrcCopy                  = 4,
00275     notSrcOr                    = 5,
00276     notSrcXor                   = 6,
00277     notSrcBic                   = 7,
00278     patCopy                     = 8,
00279     patOr                       = 9,
00280     patXor                      = 10,
00281     patBic                      = 11,
00282     notPatCopy                  = 12,
00283     notPatOr                    = 13,
00284     notPatXor                   = 14,
00285     notPatBic                   = 15,                           /* Special Text Transfer Mode */
00286     grayishTextOr               = 49,
00287     hilitetransfermode          = 50,
00288     hilite                      = 50,                           /* Arithmetic transfer modes */
00289     blend                       = 32,
00290     addPin                      = 33,
00291     addOver                     = 34,
00292     subPin                      = 35,
00293     addMax                      = 37,
00294     adMax                       = 37,
00295     subOver                     = 38,
00296     adMin                       = 39,
00297     ditherCopy                  = 64,                           /* Transparent mode constant */
00298     transparent                 = 36
00299 };
00300 
00301 typedef uint32_t                   GWorldFlags;
00302 
00303 
00304 
00305 // ============================== CODECS ===========================
00306 
00307 typedef Component                       CompressorComponent;
00308 typedef Component                       DecompressorComponent;
00309 typedef Component                       CodecComponent;
00310 
00311 enum {
00312     codecLosslessQuality        = 0x00000400,
00313     codecMaxQuality             = 0x000003FF,
00314     codecMinQuality             = 0x00000000,
00315     codecLowQuality             = 0x00000100,
00316     codecNormalQuality          = 0x00000200,
00317     codecHighQuality            = 0x00000300
00318 };
00319 
00320 
00321 
00322 // callbacks:
00323 typedef void* ImageCodecDrawBandCompleteUPP;
00324 typedef int64_t ICMProgressProcRecord;
00325 typedef int64_t ICMCompletionProcRecord;
00326 typedef ICMCompletionProcRecord* ICMCompletionProcRecordPtr;
00327 typedef int64_t ICMDataProcRecord;
00328 typedef void* ICMFrameTimePtr;
00329 typedef void* CDSequenceDataSourcePtr;
00330 typedef void* ICMFrameTimeInfoPtr;
00331 
00332 // graphics port
00333 typedef struct OpaqueGrafPtr*           GrafPtr;
00334 typedef GrafPtr                         CGrafPtr;
00335 
00336 
00337 /*  codec capabilities flags    */
00338 enum {
00339     codecCanScale               = 1L << 0,      // 1
00340     codecCanMask                = 1L << 1,      // 2
00341     codecCanMatte               = 1L << 2,      // 4
00342     codecCanTransform           = 1L << 3,      // 8
00343     codecCanTransferMode        = 1L << 4,      // 10
00344     codecCanCopyPrev            = 1L << 5,      // 20
00345     codecCanSpool               = 1L << 6,      // 40
00346     codecCanClipVertical        = 1L << 7,      // 80
00347     codecCanClipRectangular     = 1L << 8,      // 100
00348     codecCanRemapColor          = 1L << 9,      // 200
00349     codecCanFastDither          = 1L << 10,     // 400
00350     codecCanSrcExtract          = 1L << 11,     // 800
00351     codecCanCopyPrevComp        = 1L << 12,     // 1000
00352     codecCanAsync               = 1L << 13,     // 2000
00353     codecCanMakeMask            = 1L << 14,     // 4000
00354     codecCanShift               = 1L << 15,     // 8000
00355     codecCanAsyncWhen           = 1L << 16,     // 10000
00356     codecCanShieldCursor        = 1L << 17,     // 20000
00357     codecCanManagePrevBuffer    = 1L << 18,     // 40000
00358     codecHasVolatileBuffer      = 1L << 19,     // 80000                /* codec requires redraw after window movement */
00359     codecWantsRegionMask        = 1L << 20,     // 100000
00360     codecImageBufferIsOnScreen  = 1L << 21,     // 200000                /* old def of codec using overlay surface, = ( codecIsDirectToScreenOnly | codecUsesOverlaySurface | codecImageBufferIsOverlaySurface | codecSrcMustBeImageBuffer ) */
00361     codecWantsDestinationPixels = 1L << 22,     // 400000
00362     codecWantsSpecialScaling    = 1L << 23,     // 800000
00363     codecHandlesInputs          = 1L << 24,     // 1000000
00364     codecCanDoIndirectSurface   = 1L << 25,                     /* codec can handle indirect surface (GDI) */
00365     codecIsSequenceSensitive    = 1L << 26,
00366     codecRequiresOffscreen      = 1L << 27,
00367     codecRequiresMaskBits       = 1L << 28,
00368     codecCanRemapResolution     = 1L << 29,
00369     codecIsDirectToScreenOnly   = 1L << 30,                     /* codec can only decompress data to the screen */
00370     codecCanLockSurface         = 1L << 31                      /* codec can lock destination surface, icm doesn't lock for you */
00371 };
00372 
00373 /*  codec capabilities flags2   */
00374 enum {
00375     codecUsesOverlaySurface     = 1L << 0,                      /* codec uses overlay surface */
00376     codecImageBufferIsOverlaySurface = 1L << 1,                 /* codec image buffer is overlay surface, the bits in the buffer are on the screen */
00377     codecSrcMustBeImageBuffer   = 1L << 2,                      /* codec can only source data from an image buffer */
00378     codecImageBufferIsInAGPMemory = 1L << 4,                    /* codec image buffer is in AGP space, byte writes are OK */
00379     codecImageBufferIsInPCIMemory = 1L << 5                     /* codec image buffer is across a PCI bus; byte writes are bad */
00380 };
00381 
00382 /*  codec condition flags   */
00383 // FFD =  13 = 8+4+1
00384 enum {
00385     codecConditionFirstBand     = 1L << 0,      // 1
00386     codecConditionLastBand      = 1L << 1,      // 2
00387     codecConditionFirstFrame    = 1L << 2,      // 4
00388     codecConditionNewDepth      = 1L << 3,      // 8
00389     codecConditionNewTransform  = 1L << 4,      // 10
00390     codecConditionNewSrcRect    = 1L << 5,      // 20
00391     codecConditionNewMask       = 1L << 6,      // 40
00392     codecConditionNewMatte      = 1L << 7,      // 80
00393     codecConditionNewTransferMode = 1L << 8,    // 100
00394     codecConditionNewClut       = 1L << 9,      // 200
00395     codecConditionNewAccuracy   = 1L << 10,     // 400
00396     codecConditionNewDestination = 1L << 11,    // 800
00397     codecConditionFirstScreen   = 1L << 12,     // 1000
00398     codecConditionDoCursor      = 1L << 13,     // 2000
00399     codecConditionCatchUpDiff   = 1L << 14,     // 4000
00400     codecConditionMaskMayBeChanged = 1L << 15,  // 8000
00401     codecConditionToBuffer      = 1L << 16,     // 10000
00402     codecConditionCodecChangedMask = 1L << 31   // 20000
00403 };
00404 
00405 
00406 
00407 struct __attribute__((__packed__)) CodecCapabilities {
00408     int32_t                         flags;
00409     short                           wantedPixelSize;
00410     short                           extendWidth;
00411     short                           extendHeight;
00412     short                           bandMin;
00413     short                           bandInc;
00414     short                           pad;
00415     uint32_t                        time;
00416     int32_t                         flags2;                     /* field new in QuickTime 4.0 */
00417 };
00418 typedef struct CodecCapabilities        CodecCapabilities;
00419 
00420 struct __attribute__((__packed__)) CodecDecompressParams {
00421     ImageSequence                   sequenceID;                 /* predecompress,banddecompress */
00422     ImageDescriptionHandle          imageDescription;           /* predecompress,banddecompress */
00423     Ptr                             data;
00424     int32_t                         bufferSize;
00425 
00426     int32_t                         frameNumber;
00427     int32_t                         startLine;
00428     int32_t                         stopLine;
00429     int32_t                         conditionFlags;
00430 
00431     CodecFlags                      callerFlags; // short
00432     CodecCapabilities *             capabilities;               /* predecompress,banddecompress */
00433     ICMProgressProcRecord           progressProcRecord;
00434     ICMCompletionProcRecord         completionProcRecord;
00435 
00436     ICMDataProcRecord               dataProcRecord;
00437     CGrafPtr                        port;                       /* predecompress,banddecompress */
00438     PixMap                          dstPixMap;                  /* predecompress,banddecompress */
00439     BitMapPtr                       maskBits;
00440     PixMapPtr                       mattePixMap;
00441     Rect                            srcRect;                    /* predecompress,banddecompress */
00442     MatrixRecord *                  matrix;                     /* predecompress,banddecompress */
00443     CodecQ                          accuracy;                   /* predecompress,banddecompress */
00444     short                           transferMode;               /* predecompress,banddecompress */
00445     ICMFrameTimePtr                 frameTime;                  /* banddecompress */
00446     int32_t                         reserved[1];
00447 
00448                                                                 /* The following fields only exist for QuickTime 2.0 and greater */
00449     SInt8                           matrixFlags;                /* high bit set if 2x resize */
00450     SInt8                           matrixType;
00451     Rect                            dstRect;                    /* only valid for simple transforms */
00452 
00453                                                                 /* The following fields only exist for QuickTime 2.1 and greater */
00454     UInt16                          majorSourceChangeSeed;
00455     UInt16                          minorSourceChangeSeed;
00456     CDSequenceDataSourcePtr         sourceData;
00457 
00458     RgnHandle                       maskRegion;
00459 
00460                                                                 /* The following fields only exist for QuickTime 2.5 and greater */
00461     OSType **                       wantedDestinationPixelTypes; /* Handle to 0-terminated list of OSTypes */
00462 
00463     int32_t                         screenFloodMethod;
00464     int32_t                         screenFloodValue;
00465     short                           preferredOffscreenPixelSize;
00466 
00467                                                                 /* The following fields only exist for QuickTime 3.0 and greater */
00468     ICMFrameTimeInfoPtr             syncFrameTime;              /* banddecompress */
00469     Boolean                         needUpdateOnTimeChange;     /* banddecompress */
00470     Boolean                         enableBlackLining;
00471     Boolean                         needUpdateOnSourceChange;   /* band decompress */
00472     Boolean                         pad;
00473 
00474     int32_t                         unused;
00475 
00476     CGrafPtr                        finalDestinationPort;
00477 
00478     int32_t                         requestedBufferWidth;       /* must set codecWantsSpecialScaling to indicate this field is valid*/
00479     int32_t                         requestedBufferHeight;      /* must set codecWantsSpecialScaling to indicate this field is valid*/
00480 
00481                                                                 /* The following fields only exist for QuickTime 4.0 and greater */
00482     Rect                            displayableAreaOfRequestedBuffer; /* set in predecompress*/
00483     Boolean                         requestedSingleField;
00484     Boolean                         needUpdateOnNextIdle;
00485     Boolean                         pad2[2];
00486     Fixed                           bufferGammaLevel;
00487 
00488                                                                 /* The following fields only exist for QuickTime 5.0 and greater */
00489     UInt32                          taskWeight;                 /* preferred weight for MP tasks implementing this operation*/
00490     OSType                          taskName;                   /* preferred name (type) for MP tasks implementing this operation*/
00491 };
00492 typedef struct CodecDecompressParams    CodecDecompressParams;
00493 
00494 
00495 
00496 struct __attribute__((__packed__)) ImageSubCodecDecompressCapabilities {
00497     int32_t                         recordSize;                 /* sizeof(ImageSubCodecDecompressCapabilities)*/
00498     int32_t                         decompressRecordSize;       /* size of your codec's decompress record*/
00499     Boolean                         canAsync;                   /* default true*/
00500     UInt8                           pad0;
00501 
00502                                                                 /* The following fields only exist for QuickTime 4.0 and greater */
00503     UInt16                          suggestedQueueSize;
00504     Boolean                         canProvideTrigger;
00505 
00506                                                                 /* The following fields only exist for QuickTime 5.0 and greater */
00507     Boolean                         subCodecFlushesScreen;      /* only used on Mac OS X*/
00508     Boolean                         subCodecCallsDrawBandComplete;
00509     UInt8                           pad2[1];
00510 
00511                                                                 /* The following fields only exist for QuickTime 5.1 and greater */
00512     Boolean                         isChildCodec;               /* set by base codec before calling Initialize*/
00513     UInt8                           pad3[3];
00514 };
00515 typedef struct ImageSubCodecDecompressCapabilities ImageSubCodecDecompressCapabilities;
00516 
00517 
00518 struct __attribute__((__packed__)) ImageSubCodecDecompressRecord {
00519     Ptr                             baseAddr;
00520     int32_t                         rowBytes;
00521     Ptr                             codecData;
00522     ICMProgressProcRecord           progressProcRecord;
00523     ICMDataProcRecord               dataProcRecord;
00524     void *                          userDecompressRecord;       /* pointer to codec-specific per-band data*/
00525     UInt8                           frameType;
00526     Boolean                         inhibitMP;                  /* set this in BeginBand to tell the base decompressor not to call DrawBand from an MP task for this frame.  (Only has any effect for MP-capable subcodecs.  New in QuickTime 5.0.)*/
00527     UInt8                           pad[2];
00528     int32_t                         priv[2];
00529 
00530                                                                 /* The following fields only exist for QuickTime 5.0 and greater */
00531     ImageCodecDrawBandCompleteUPP   drawBandCompleteUPP;        /* only used if subcodec set subCodecCallsDrawBandComplete; if drawBandCompleteUPP is non-nil, codec must call it when a frame is finished, but may return from DrawBand before the frame is finished. */
00532     void *                          drawBandCompleteRefCon;     /* Note: do not call drawBandCompleteUPP directly from a hardware interrupt; instead, use DTInstall to run a function at deferred task time, and call drawBandCompleteUPP from that. */
00533 };
00534 typedef struct ImageSubCodecDecompressRecord ImageSubCodecDecompressRecord;
00535 
00536 
00537 /* These are the bits that are set in the Component flags, and also in the codecInfo struct. */
00538 enum {
00539     codecInfoDoes1              = (1L << 0),                    /* codec can work with 1-bit pixels */
00540     codecInfoDoes2              = (1L << 1),                    /* codec can work with 2-bit pixels */
00541     codecInfoDoes4              = (1L << 2),                    /* codec can work with 4-bit pixels */
00542     codecInfoDoes8              = (1L << 3),                    /* codec can work with 8-bit pixels */
00543     codecInfoDoes16             = (1L << 4),                    /* codec can work with 16-bit pixels */
00544     codecInfoDoes32             = (1L << 5),                    /* codec can work with 32-bit pixels */
00545     codecInfoDoesDither         = (1L << 6),                    /* codec can do ditherMode */
00546     codecInfoDoesStretch        = (1L << 7),                    /* codec can stretch to arbitrary sizes */
00547     codecInfoDoesShrink         = (1L << 8),                    /* codec can shrink to arbitrary sizes */
00548     codecInfoDoesMask           = (1L << 9),                    /* codec can mask to clipping regions */
00549     codecInfoDoesTemporal       = (1L << 10),                   /* codec can handle temporal redundancy */
00550     codecInfoDoesDouble         = (1L << 11),                   /* codec can stretch to double size exactly */
00551     codecInfoDoesQuad           = (1L << 12),                   /* codec can stretch to quadruple size exactly */
00552     codecInfoDoesHalf           = (1L << 13),                   /* codec can shrink to half size */
00553     codecInfoDoesQuarter        = (1L << 14),                   /* codec can shrink to quarter size */
00554     codecInfoDoesRotate         = (1L << 15),                   /* codec can rotate on decompress */
00555     codecInfoDoesHorizFlip      = (1L << 16),                   /* codec can flip horizontally on decompress */
00556     codecInfoDoesVertFlip       = (1L << 17),                   /* codec can flip vertically on decompress */
00557     codecInfoHasEffectParameterList = (1L << 18),               /* codec implements get effects parameter list call, once was codecInfoDoesSkew */
00558     codecInfoDoesBlend          = (1L << 19),                   /* codec can blend on decompress */
00559     codecInfoDoesWarp           = (1L << 20),                   /* codec can warp arbitrarily on decompress */
00560     codecInfoDoesRecompress     = (1L << 21),                   /* codec can recompress image without accumulating errors */
00561     codecInfoDoesSpool          = (1L << 22),                   /* codec can spool image data */
00562     codecInfoDoesRateConstrain  = (1L << 23)                    /* codec can data rate constrain */
00563 };
00564 
00565 
00566 enum {
00567     codecInfoDepth1             = (1L << 0),                    /* compressed data at 1 bpp depth available */
00568     codecInfoDepth2             = (1L << 1),                    /* compressed data at 2 bpp depth available */
00569     codecInfoDepth4             = (1L << 2),                    /* compressed data at 4 bpp depth available */
00570     codecInfoDepth8             = (1L << 3),                    /* compressed data at 8 bpp depth available */
00571     codecInfoDepth16            = (1L << 4),                    /* compressed data at 16 bpp depth available */
00572     codecInfoDepth32            = (1L << 5),                    /* compressed data at 32 bpp depth available */
00573     codecInfoDepth24            = (1L << 6),                    /* compressed data at 24 bpp depth available */
00574     codecInfoDepth33            = (1L << 7),                    /* compressed data at 1 bpp monochrome depth  available */
00575     codecInfoDepth34            = (1L << 8),                    /* compressed data at 2 bpp grayscale depth available */
00576     codecInfoDepth36            = (1L << 9),                    /* compressed data at 4 bpp grayscale depth available */
00577     codecInfoDepth40            = (1L << 10),                   /* compressed data at 8 bpp grayscale depth available */
00578     codecInfoStoresClut         = (1L << 11),                   /* compressed data can have custom cluts */
00579     codecInfoDoesLossless       = (1L << 12),                   /* compressed data can be stored in lossless format */
00580     codecInfoSequenceSensitive  = (1L << 13)                    /* compressed data is sensitive to out of sequence decoding */
00581 };
00582 
00583 struct __attribute__((__packed__)) CodecInfo {
00584     Str31                           typeName;                   /* name of the codec type i.e.: 'Apple Image Compression' */
00585     short                           version;                    /* version of the codec data that this codec knows about */
00586     short                           revisionLevel;              /* revision level of this codec i.e: 0x00010001 (1.0.1) */
00587     int32_t                         vendor;                     /* Maker of this codec i.e: 'appl' */
00588     int32_t                         decompressFlags;            /* codecInfo flags for decompression capabilities */
00589     int32_t                         compressFlags;              /* codecInfo flags for compression capabilities */
00590     int32_t                         formatFlags;                /* codecInfo flags for compression format details */
00591     UInt8                           compressionAccuracy;        /* measure (1-255) of accuracy of this codec for compress (0 if unknown) */
00592     UInt8                           decompressionAccuracy;      /* measure (1-255) of accuracy of this codec for decompress (0 if unknown) */
00593     unsigned short                  compressionSpeed;           /* ( millisecs for compressing 320x240 on base mac II) (0 if unknown)  */
00594     unsigned short                  decompressionSpeed;         /* ( millisecs for decompressing 320x240 on mac II)(0 if unknown)  */
00595     UInt8                           compressionLevel;           /* measure (1-255) of compression level of this codec (0 if unknown)  */
00596     UInt8                           resvd;                      /* pad */
00597     short                           minimumHeight;              /* minimum height of image (block size) */
00598     short                           minimumWidth;               /* minimum width of image (block size) */
00599     short                           decompressPipelineLatency;  /* in milliseconds ( for asynchronous codecs ) */
00600     short                           compressPipelineLatency;    /* in milliseconds ( for asynchronous codecs ) */
00601     int32_t                         privateData;
00602 };
00603 typedef struct CodecInfo                CodecInfo;
00604 
00605 enum {
00606     codecFlagUseImageBuffer     = (1L << 0),                    /* decompress*/
00607     codecFlagUseScreenBuffer    = (1L << 1),                    /* decompress*/
00608     codecFlagUpdatePrevious     = (1L << 2),                    /* compress*/
00609     codecFlagNoScreenUpdate     = (1L << 3),                    /* decompress*/
00610     codecFlagWasCompressed      = (1L << 4),                    /* compress*/
00611     codecFlagDontOffscreen      = (1L << 5),                    /* decompress*/
00612     codecFlagUpdatePreviousComp = (1L << 6),                    /* compress*/
00613     codecFlagForceKeyFrame      = (1L << 7),                    /* compress*/
00614     codecFlagOnlyScreenUpdate   = (1L << 8),                    /* decompress*/
00615     codecFlagLiveGrab           = (1L << 9),                    /* compress*/
00616     codecFlagDiffFrame          = (1L << 9),                    /* decompress*/
00617     codecFlagDontUseNewImageBuffer = (1L << 10),                /* decompress*/
00618     codecFlagInterlaceUpdate    = (1L << 11),                   /* decompress*/
00619     codecFlagCatchUpDiff        = (1L << 12),                   /* decompress*/
00620     codecFlagSupportDisable     = (1L << 13),                   /* decompress*/
00621     codecFlagReenable           = (1L << 14)                    /* decompress*/
00622 };
00623 
00624 static inline void dump_ImageDescription(void* xxx){
00625     ImageDescription* id=(ImageDescription*)xxx;
00626     unsigned char* x;
00627     int i;
00628 
00629     for(i=0;i<id->idSize;i++){
00630         printf(" %02X",((unsigned char*)id)[i]);
00631         if((i%16)==15) printf("\n");
00632     }
00633     printf("\n");
00634 
00635 
00636     printf("=============== ImageDescription at %p ==================\n",xxx);
00637     printf("idSize=0x%X  fourcc=0x%08X\n",id->idSize,id->cType);
00638     printf("ver=%d rev=%d vendor=0x%08X\n",id->version,id->revisionLevel,id->vendor);
00639     printf("tempQ=%d spatQ=%d  dim: %d x %d  dpi: %d x %d  depth: %d\n",
00640         id->temporalQuality,id->spatialQuality,
00641         id->width, id->height,
00642         id->hRes, id->vRes,
00643         id->depth);
00644     printf("dataSize=%d frameCount=%d clutID=%d\n",id->dataSize, id->frameCount, id->clutID);
00645     printf("name='%.*s'\n",((char*)(&id->name))[0],((char*)(&id->name))+1);
00646     x=((char*)(&id->clutID))+2;
00647     if(id->idSize>sizeof(ImageDescription)){
00648         printf("%02X %02X %02X %02X | %02X %02X %02X %02X | %02X %02X %02X %02X | %02X %02X %02X %02X\n",
00649         x[0],x[1],x[2],x[3],x[4],x[5],x[6],x[7],x[8],x[9],x[10],x[11],x[12],x[13],x[14],x[15]);
00650     }
00651     printf("=========================================================\n");
00652 }
00653 
00654 static inline void dump_Rect(char* title,Rect *r){
00655     printf("%s: %d;%d - %d;%d\n",title,
00656         (int)r->top,(int)r->left,(int)r->bottom,(int)r->right);
00657 }
00658 
00659 static inline void dump_MatrixRecord(char* title, MatrixRecord *m){
00660     printf("%s: [%d %d %d][%d %d %d][%d %d %d]\n",title,
00661         m->matrix[0][0],m->matrix[0][1],m->matrix[0][2],
00662         m->matrix[1][0],m->matrix[1][1],m->matrix[1][2],
00663         m->matrix[2][0],m->matrix[2][1],m->matrix[2][2]);
00664 }
00665 
00666 static inline void dump_PixMap(void* xxx){
00667     PixMap *p=xxx;
00668     printf("=============== PixMap at %p ==================\n",xxx);
00669     printf("base=%p  stride=%d\n",p->baseAddr, p->rowBytes);
00670     dump_Rect("bounds",&p->bounds);
00671     printf("pmVersion=0x%X packType=0x%X\n packSize=0x%X\n",
00672         p->pmVersion,p->packType, p->packSize);
00673     printf("hRes=0x%X vRes=0x%X pixelType=0x%X pixelSize=0x%X\n",
00674         p->hRes,p->vRes,p->pixelType,p->pixelSize);
00675     printf("cmpCount=0x%X cmpSize=0x%X pixelFormat=0x%X\n",
00676         p->cmpCount,p->cmpSize,p->pixelFormat);
00677     printf("pmTable=%p pmExt=%p\n",p->pmTable,p->pmExt);
00678     printf("=========================================================\n");
00679 }
00680 
00681 static inline void dump_CodecCapabilities(void* xxx){
00682     CodecCapabilities* cc=xxx;
00683     if(!xxx) return;
00684     printf("=============== CodecCapabilities at %p =================\n",xxx);
00685     printf("flags=0x%X  flags2=0x%X\n",cc->flags,cc->flags2);
00686     printf("wantedPixelSize=%d extendWidth=%d extendHeight=%d band=%d+%d\n",
00687         cc->wantedPixelSize,cc->extendWidth,cc->extendHeight,
00688         cc->bandMin,cc->bandInc);
00689     printf("pad=0x%X  time=0x%X\n",cc->pad,cc->time);
00690     printf("=========================================================\n");
00691 }
00692 
00693 static inline void dump_CodecDecompressParams(void* xxx){
00694     CodecDecompressParams* cd=xxx;
00695     ImageDescription **idh;
00696     int i;
00697     if(!xxx) return;
00698     printf("=============== CodecDecompressParams at %p ==================\n",xxx);
00699     printf("sequenceID=%d\n",cd->sequenceID);
00700     idh=cd->imageDescription;
00701     if(idh && idh[0]) dump_ImageDescription(idh[0]);
00702     
00703     for(i=0;i<sizeof(CodecDecompressParams);i++){
00704         printf(" %02X",((unsigned char*)cd)[i]);
00705         if((i%16)==15) printf("\n");
00706     }
00707     printf("\n");
00708     
00709     printf("data=%p  size=%d\n",cd->data,cd->bufferSize);
00710     printf("frameno=%d  lines: %d .. %d   condflags=0x%X  callerflags=0x%X\n",
00711         cd->frameNumber, cd->startLine, cd->stopLine, cd->conditionFlags,cd->callerFlags);
00712 //    printf("maskBits=%p mattePixMap=%p\n",
00713 //      cd->maskBits,cd->mattePixMap);
00714     dump_PixMap(&cd->dstPixMap);
00715 //    if(cd->mattePixMap) dump_PixMap(cd->mattePixMap);
00716     if(cd->matrix) dump_MatrixRecord("matrix",cd->matrix);
00717     if(cd->capabilities) dump_CodecCapabilities(cd->capabilities);
00718     printf("accuracy=%d  transferMode=%d  matrixFlags=0x%X matrixType=%d\n",
00719         (int)cd->accuracy, (int)cd->transferMode, (int)cd->matrixFlags, (int)cd->matrixType);
00720     printf("srcrect: %d;%d - %d;%d\n",cd->srcRect.top,cd->srcRect.left,cd->srcRect.bottom,cd->srcRect.right);
00721     printf("dstrect: %d;%d - %d;%d\n",cd->dstRect.top,cd->dstRect.left,cd->dstRect.bottom,cd->dstRect.right);
00722     printf("wantedDestinationPixelTypes=%p\n",cd->wantedDestinationPixelTypes);
00723     if(cd->wantedDestinationPixelTypes){
00724         unsigned int* p=cd->wantedDestinationPixelTypes;
00725         while(p[0]){
00726             printf("  0x%08X %.4s\n",p[0],&p[0]);
00727             ++p;
00728         }
00729     }
00730     printf("screenFloodMethod=%d value=%d  preferredOffscreenPixelSize=%d\n",
00731         cd->screenFloodMethod, cd->screenFloodValue, cd->preferredOffscreenPixelSize);
00732     printf("callbacks: progress=%p compl=%p data=%p ftime=%p srcdata=%p sync=%p\n",
00733      cd->progressProcRecord, cd->completionProcRecord,
00734      cd->dataProcRecord, cd->frameTime, cd->sourceData, cd->syncFrameTime);
00735 //    printf("\n");
00736 
00737     printf("=========================================================\n");
00738 
00739 
00740 }
00741 

Generated on Tue Dec 20 10:14:21 2005 for vlc-0.8.4a by  doxygen 1.4.2