📄 components.h
字号:
long recordSize; /* sizeof(ImageSubCodecDecompressCapabilities)*/
long decompressRecordSize; /* size of your codec's decompress record*/
Boolean canAsync; /* default true*/
UInt8 pad0;
/* The following fields only exist for QuickTime 4.0 and greater */
UInt16 suggestedQueueSize;
Boolean canProvideTrigger;
/* The following fields only exist for QuickTime 5.0 and greater */
Boolean subCodecFlushesScreen; /* only used on Mac OS X*/
Boolean subCodecCallsDrawBandComplete;
UInt8 pad2[1];
/* The following fields only exist for QuickTime 5.1 and greater */
Boolean isChildCodec; /* set by base codec before calling Initialize*/
UInt8 pad3[3];
};
typedef struct ImageSubCodecDecompressCapabilities ImageSubCodecDecompressCapabilities;
struct __attribute__((__packed__)) ImageSubCodecDecompressRecord {
Ptr baseAddr;
long rowBytes;
Ptr codecData;
ICMProgressProcRecord progressProcRecord;
ICMDataProcRecord dataProcRecord;
void * userDecompressRecord; /* pointer to codec-specific per-band data*/
UInt8 frameType;
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.)*/
UInt8 pad[2];
long priv[2];
/* The following fields only exist for QuickTime 5.0 and greater */
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. */
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. */
};
typedef struct ImageSubCodecDecompressRecord ImageSubCodecDecompressRecord;
/* These are the bits that are set in the Component flags, and also in the codecInfo struct. */
enum {
codecInfoDoes1 = (1L << 0), /* codec can work with 1-bit pixels */
codecInfoDoes2 = (1L << 1), /* codec can work with 2-bit pixels */
codecInfoDoes4 = (1L << 2), /* codec can work with 4-bit pixels */
codecInfoDoes8 = (1L << 3), /* codec can work with 8-bit pixels */
codecInfoDoes16 = (1L << 4), /* codec can work with 16-bit pixels */
codecInfoDoes32 = (1L << 5), /* codec can work with 32-bit pixels */
codecInfoDoesDither = (1L << 6), /* codec can do ditherMode */
codecInfoDoesStretch = (1L << 7), /* codec can stretch to arbitrary sizes */
codecInfoDoesShrink = (1L << 8), /* codec can shrink to arbitrary sizes */
codecInfoDoesMask = (1L << 9), /* codec can mask to clipping regions */
codecInfoDoesTemporal = (1L << 10), /* codec can handle temporal redundancy */
codecInfoDoesDouble = (1L << 11), /* codec can stretch to double size exactly */
codecInfoDoesQuad = (1L << 12), /* codec can stretch to quadruple size exactly */
codecInfoDoesHalf = (1L << 13), /* codec can shrink to half size */
codecInfoDoesQuarter = (1L << 14), /* codec can shrink to quarter size */
codecInfoDoesRotate = (1L << 15), /* codec can rotate on decompress */
codecInfoDoesHorizFlip = (1L << 16), /* codec can flip horizontally on decompress */
codecInfoDoesVertFlip = (1L << 17), /* codec can flip vertically on decompress */
codecInfoHasEffectParameterList = (1L << 18), /* codec implements get effects parameter list call, once was codecInfoDoesSkew */
codecInfoDoesBlend = (1L << 19), /* codec can blend on decompress */
codecInfoDoesWarp = (1L << 20), /* codec can warp arbitrarily on decompress */
codecInfoDoesRecompress = (1L << 21), /* codec can recompress image without accumulating errors */
codecInfoDoesSpool = (1L << 22), /* codec can spool image data */
codecInfoDoesRateConstrain = (1L << 23) /* codec can data rate constrain */
};
enum {
codecInfoDepth1 = (1L << 0), /* compressed data at 1 bpp depth available */
codecInfoDepth2 = (1L << 1), /* compressed data at 2 bpp depth available */
codecInfoDepth4 = (1L << 2), /* compressed data at 4 bpp depth available */
codecInfoDepth8 = (1L << 3), /* compressed data at 8 bpp depth available */
codecInfoDepth16 = (1L << 4), /* compressed data at 16 bpp depth available */
codecInfoDepth32 = (1L << 5), /* compressed data at 32 bpp depth available */
codecInfoDepth24 = (1L << 6), /* compressed data at 24 bpp depth available */
codecInfoDepth33 = (1L << 7), /* compressed data at 1 bpp monochrome depth available */
codecInfoDepth34 = (1L << 8), /* compressed data at 2 bpp grayscale depth available */
codecInfoDepth36 = (1L << 9), /* compressed data at 4 bpp grayscale depth available */
codecInfoDepth40 = (1L << 10), /* compressed data at 8 bpp grayscale depth available */
codecInfoStoresClut = (1L << 11), /* compressed data can have custom cluts */
codecInfoDoesLossless = (1L << 12), /* compressed data can be stored in lossless format */
codecInfoSequenceSensitive = (1L << 13) /* compressed data is sensitive to out of sequence decoding */
};
struct __attribute__((__packed__)) CodecInfo {
Str31 typeName; /* name of the codec type i.e.: 'Apple Image Compression' */
short version; /* version of the codec data that this codec knows about */
short revisionLevel; /* revision level of this codec i.e: 0x00010001 (1.0.1) */
long vendor; /* Maker of this codec i.e: 'appl' */
long decompressFlags; /* codecInfo flags for decompression capabilities */
long compressFlags; /* codecInfo flags for compression capabilities */
long formatFlags; /* codecInfo flags for compression format details */
UInt8 compressionAccuracy; /* measure (1-255) of accuracy of this codec for compress (0 if unknown) */
UInt8 decompressionAccuracy; /* measure (1-255) of accuracy of this codec for decompress (0 if unknown) */
unsigned short compressionSpeed; /* ( millisecs for compressing 320x240 on base mac II) (0 if unknown) */
unsigned short decompressionSpeed; /* ( millisecs for decompressing 320x240 on mac II)(0 if unknown) */
UInt8 compressionLevel; /* measure (1-255) of compression level of this codec (0 if unknown) */
UInt8 resvd; /* pad */
short minimumHeight; /* minimum height of image (block size) */
short minimumWidth; /* minimum width of image (block size) */
short decompressPipelineLatency; /* in milliseconds ( for asynchronous codecs ) */
short compressPipelineLatency; /* in milliseconds ( for asynchronous codecs ) */
long privateData;
};
typedef struct CodecInfo CodecInfo;
enum {
codecFlagUseImageBuffer = (1L << 0), /* decompress*/
codecFlagUseScreenBuffer = (1L << 1), /* decompress*/
codecFlagUpdatePrevious = (1L << 2), /* compress*/
codecFlagNoScreenUpdate = (1L << 3), /* decompress*/
codecFlagWasCompressed = (1L << 4), /* compress*/
codecFlagDontOffscreen = (1L << 5), /* decompress*/
codecFlagUpdatePreviousComp = (1L << 6), /* compress*/
codecFlagForceKeyFrame = (1L << 7), /* compress*/
codecFlagOnlyScreenUpdate = (1L << 8), /* decompress*/
codecFlagLiveGrab = (1L << 9), /* compress*/
codecFlagDiffFrame = (1L << 9), /* decompress*/
codecFlagDontUseNewImageBuffer = (1L << 10), /* decompress*/
codecFlagInterlaceUpdate = (1L << 11), /* decompress*/
codecFlagCatchUpDiff = (1L << 12), /* decompress*/
codecFlagSupportDisable = (1L << 13), /* decompress*/
codecFlagReenable = (1L << 14) /* decompress*/
};
static inline void dump_ImageDescription(void* xxx){
ImageDescription* id=(ImageDescription*)xxx;
unsigned char* x;
int i;
for(i=0;i<id->idSize;i++){
printf(" %02X",((unsigned char*)id)[i]);
if((i%16)==15) printf("\n");
}
printf("\n");
printf("=============== ImageDescription at %p ==================\n",xxx);
printf("idSize=0x%X fourcc=0x%08X\n",id->idSize,id->cType);
printf("ver=%d rev=%d vendor=0x%08X\n",id->version,id->revisionLevel,id->vendor);
printf("tempQ=%d spatQ=%d dim: %d x %d dpi: %d x %d depth: %d\n",
id->temporalQuality,id->spatialQuality,
id->width, id->height,
id->hRes, id->vRes,
id->depth);
printf("dataSize=%d frameCount=%d clutID=%d\n",id->dataSize, id->frameCount, id->clutID);
printf("name='%.*s'\n",((char*)(&id->name))[0],((char*)(&id->name))+1);
x=((char*)(&id->clutID))+2;
if(id->idSize>sizeof(ImageDescription)){
printf("%02X %02X %02X %02X | %02X %02X %02X %02X | %02X %02X %02X %02X | %02X %02X %02X %02X\n",
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]);
}
printf("=========================================================\n");
}
static inline void dump_Rect(char* title,Rect *r){
printf("%s: %d;%d - %d;%d\n",title,
(int)r->top,(int)r->left,(int)r->bottom,(int)r->right);
}
static inline void dump_MatrixRecord(char* title, MatrixRecord *m){
printf("%s: [%d %d %d][%d %d %d][%d %d %d]\n",title,
m->matrix[0][0],m->matrix[0][1],m->matrix[0][2],
m->matrix[1][0],m->matrix[1][1],m->matrix[1][2],
m->matrix[2][0],m->matrix[2][1],m->matrix[2][2]);
}
static inline void dump_PixMap(void* xxx){
PixMap *p=xxx;
printf("=============== PixMap at %p ==================\n",xxx);
printf("base=%p stride=%d\n",p->baseAddr, p->rowBytes);
dump_Rect("bounds",&p->bounds);
printf("pmVersion=0x%X packType=0x%X\n packSize=0x%X\n",
p->pmVersion,p->packType, p->packSize);
printf("hRes=0x%X vRes=0x%X pixelType=0x%X pixelSize=0x%X\n",
p->hRes,p->vRes,p->pixelType,p->pixelSize);
printf("cmpCount=0x%X cmpSize=0x%X pixelFormat=0x%X\n",
p->cmpCount,p->cmpSize,p->pixelFormat);
printf("pmTable=%p pmExt=%p\n",p->pmTable,p->pmExt);
printf("=========================================================\n");
}
static inline void dump_CodecCapabilities(void* xxx){
CodecCapabilities* cc=xxx;
if(!xxx) return;
printf("=============== CodecCapabilities at %p =================\n",xxx);
printf("flags=0x%X flags2=0x%X\n",cc->flags,cc->flags2);
printf("wantedPixelSize=%d extendWidth=%d extendHeight=%d band=%d+%d\n",
cc->wantedPixelSize,cc->extendWidth,cc->extendHeight,
cc->bandMin,cc->bandInc);
printf("pad=0x%X time=0x%X\n",cc->pad,cc->time);
printf("=========================================================\n");
}
static inline void dump_CodecDecompressParams(void* xxx){
CodecDecompressParams* cd=xxx;
ImageDescription **idh;
int i;
if(!xxx) return;
printf("=============== CodecDecompressParams at %p ==================\n",xxx);
printf("sequenceID=%d\n",cd->sequenceID);
idh=cd->imageDescription;
if(idh && idh[0]) dump_ImageDescription(idh[0]);
for(i=0;i<sizeof(CodecDecompressParams);i++){
printf(" %02X",((unsigned char*)cd)[i]);
if((i%16)==15) printf("\n");
}
printf("\n");
printf("data=%p size=%d\n",cd->data,cd->bufferSize);
printf("frameno=%d lines: %d .. %d condflags=0x%X callerflags=0x%X\n",
cd->frameNumber, cd->startLine, cd->stopLine, cd->conditionFlags,cd->callerFlags);
// printf("maskBits=%p mattePixMap=%p\n",
// cd->maskBits,cd->mattePixMap);
dump_PixMap(&cd->dstPixMap);
// if(cd->mattePixMap) dump_PixMap(cd->mattePixMap);
if(cd->matrix) dump_MatrixRecord("matrix",cd->matrix);
if(cd->capabilities) dump_CodecCapabilities(cd->capabilities);
printf("accuracy=%d transferMode=%d matrixFlags=0x%X matrixType=%d\n",
(int)cd->accuracy, (int)cd->transferMode, (int)cd->matrixFlags, (int)cd->matrixType);
printf("srcrect: %d;%d - %d;%d\n",cd->srcRect.top,cd->srcRect.left,cd->srcRect.bottom,cd->srcRect.right);
printf("dstrect: %d;%d - %d;%d\n",cd->dstRect.top,cd->dstRect.left,cd->dstRect.bottom,cd->dstRect.right);
printf("wantedDestinationPixelTypes=%p\n",cd->wantedDestinationPixelTypes);
if(cd->wantedDestinationPixelTypes){
unsigned int* p=cd->wantedDestinationPixelTypes;
while(p[0]){
printf(" 0x%08X %.4s\n",p[0],&p[0]);
++p;
}
}
printf("screenFloodMethod=%d value=%d preferredOffscreenPixelSize=%d\n",
cd->screenFloodMethod, cd->screenFloodValue, cd->preferredOffscreenPixelSize);
printf("callbacks: progress=%p compl=%p data=%p ftime=%p srcdata=%p sync=%p\n",
cd->progressProcRecord, cd->completionProcRecord,
cd->dataProcRecord, cd->frameTime, cd->sourceData, cd->syncFrameTime);
// printf("\n");
printf("=========================================================\n");
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -