home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SeqGrab2.h
-
- Contains: xxx put contents here xxx
-
- Written by: xxx put writers here xxx
-
- Copyright: © 1991 by Apple Computer, Inc., all rights reserved.
-
- This file is used in these builds: Warhol
-
- Change History (most recent first):
-
- <11> 9/5/91 PH add SGGetBufferInfo call
- <10> 9/5/91 PH sg channels now have their own type.
- <9> 9/5/91 PH add sg flags
- <8> 9/2/91 PH add altCompressBuffer stuff
- <7> 8/29/91 PH playAllData flag for Ken
- <6> 8/28/91 PH refCon slime
- <5> 8/27/91 PH severely changing VideoBottles
- <4> 8/24/91 PH SGGetDataRate interface was wrong
- <3> 8/20/91 PH adding one more routine + error codes
- <2> 8/19/91 PH another check in
- <1> 8/16/91 PH first checked in
- <1> 8/16/91 PH first checked in
-
- To Do:
- */
-
- #ifndef _SeqGrab_
- #define _SeqGrab_
-
-
- #include "Components.h"
- #include "Image Compression.h"
- #include "Movies.h"
-
- /*
- General Sequence Grab stuff
- */
-
- typedef ComponentInstance SeqGrabComponent;
-
- typedef ComponentInstance SGChannel;
-
- #define SeqGrabComponentType 'barg'
- #define SeqGrabChannelType 'sgch'
-
- typedef enum {
- seqGrabToDisk = 1,
- seqGrabToMemory = 2,
- seqGrabDontUseTempMemory = 4,
- seqGrabAppendToFile = 8,
- seqGrabDontAddMovieResource = 16
- } SeqGrabDataOutputEnum;
-
- typedef enum {
- seqGrabRecord = 1,
- seqGrabPreview = 2,
- seqGrabPlayDuringRecord = 4
- } SeqGrabUsageEnum;
-
- typedef enum {
- seqGrabHasBounds = 1,
- seqGrabHasVolume = 2,
- seqGrabHasDiscreteSamples = 4
- } SeqGrabChannelInfoEnum;
-
- typedef struct seqGrabFrameInfo {
- long frameOffset;
- long frameTime;
- long frameSize;
- SGChannel frameChannel;
- long frameRefCon;
- } seqGrabFrameInfo;
-
- pascal ComponentResult SGInitialize(SeqGrabComponent s) = {0x2f3c,0,1,0x7000,0xa82a};
-
- pascal ComponentResult SGSetDataOutput(SeqGrabComponent s, FSSpec *movieFile, long whereFlags) = {0x2f3c,8,2,0x7000,0xa82a};
- pascal ComponentResult SGGetDataOutput(SeqGrabComponent s, FSSpec *movieFile, long *whereFlags) = {0x2f3c,8,3,0x7000,0xa82a};
-
- pascal ComponentResult SGSetGWorld(SeqGrabComponent s, CGrafPtr gp, GDHandle gd) = {0x2f3c,8,4,0x7000,0xa82a};
- pascal ComponentResult SGGetGWorld(SeqGrabComponent s, CGrafPtr *gp, GDHandle *gd) = {0x2f3c,8,5,0x7000,0xa82a};
-
- pascal ComponentResult SGNewChannel(SeqGrabComponent s, OSType channelType, SGChannel *ref) = {0x2f3c,8,6,0x7000,0xa82a};
- pascal ComponentResult SGDisposeChannel(SeqGrabComponent s, SGChannel c) = {0x2f3c,4,7,0x7000,0xa82a};
-
- pascal ComponentResult SGStartPreview(SeqGrabComponent s) = {0x2f3c,0,16,0x7000,0xa82a};
- pascal ComponentResult SGStartRecord(SeqGrabComponent s) = {0x2f3c,0,17,0x7000,0xa82a};
- pascal ComponentResult SGIdle(SeqGrabComponent s) = {0x2f3c,0,18,0x7000,0xa82a};
- pascal ComponentResult SGStop(SeqGrabComponent s) = {0x2f3c,0,19,0x7000,0xa82a};
-
- pascal ComponentResult SGPause(SeqGrabComponent s, Boolean pause) = {0x2f3c,2,20,0x7000,0xa82a};
-
- pascal ComponentResult SGPrepare(SeqGrabComponent s, Boolean prepareForPreview, Boolean prepareForRecord) = {0x2f3c,4,21,0x7000,0xa82a};
- pascal ComponentResult SGRelease(SeqGrabComponent s) = {0x2f3c,0,22,0x7000,0xa82a};
-
- pascal Movie SGGetMovie(SeqGrabComponent s) = {0x2f3c,0,23,0x7000,0xa82a};
-
- pascal ComponentResult SGSetMaximumRecordTime(SeqGrabComponent s, unsigned long ticks) = {0x2f3c,4,24,0x7000,0xa82a};
- pascal ComponentResult SGGetMaximumRecordTime(SeqGrabComponent s, unsigned long *ticks) = {0x2f3c,4,25,0x7000,0xa82a};
-
- pascal ComponentResult SGGetStorageSpaceRemaining(SeqGrabComponent s, unsigned long *bytes) = {0x2f3c,4,26,0x7000,0xa82a};
- pascal ComponentResult SGGetTimeRemaining(SeqGrabComponent s, long *ticksLeft) = {0x2f3c,4,27,0x7000,0xa82a};
-
- #define grabPictOffScreen (1)
- pascal ComponentResult SGGrabPict(SeqGrabComponent s, PicHandle *p, const Rect *bounds,
- short offscreenDepth, long grabPictFlags) = {0x2f3c,14,28,0x7000,0xa82a};
-
- pascal ComponentResult SGGetLastMovieResID(SeqGrabComponent s, short *resID) = {0x2f3c,4,29,0x7000,0xa82a};
-
- #define sgFlagControlledGrab (1)
-
- pascal ComponentResult SGSetFlags(SeqGrabComponent s, long sgFlags) = {0x2f3c,4,30,0x7000,0xa82a};
-
- pascal ComponentResult SGGetFlags(SeqGrabComponent s, long *sgFlags) = {0x2f3c,4,31,0x7000,0xa82a};
-
- #if 0
- pascal ComponentResult SGGrabMovie(SeqGrabComponent s, ....) = {0x2f3c,0,1,0x7000,0xa82a};
- #endif
-
- /*
- General Channel stuff
- */
- pascal ComponentResult SGSetChannelUsage(SGChannel c, long usage) = {0x2f3c,4,128,0x7000,0xa82a};
- pascal ComponentResult SGGetChannelUsage(SGChannel c, long *usage) = {0x2f3c,4,129,0x7000,0xa82a};
-
- pascal ComponentResult SGSetChannelBounds(SGChannel c, const Rect *bounds) = {0x2f3c,4,130,0x7000,0xa82a};
- pascal ComponentResult SGGetChannelBounds(SGChannel c, Rect *bounds) = {0x2f3c,4,131,0x7000,0xa82a};
-
- pascal ComponentResult SGSetChannelVolume(SGChannel c, short volume) = {0x2f3c,2,132,0x7000,0xa82a};
- pascal ComponentResult SGGetChannelVolume(SGChannel c, short *volume) = {0x2f3c,4,133,0x7000,0xa82a};
-
- pascal ComponentResult SGGetChannelInfo(SGChannel c, long *channelInfo) = {0x2f3c,4,134,0x7000,0xa82a};
-
- #define channelPlayNormal 0
- #define channelPlayFast 1
- #define channelPlayHighQuality 2
- #define channelPlayAllData 4
-
- pascal ComponentResult SGSetChannelPlayFlags(SGChannel c, long playFlags) = {0x2f3c,4,135,0x7000,0xa82a};
- pascal ComponentResult SGGetChannelPlayFlags(SGChannel c, long *playFlags) = {0x2f3c,4,136,0x7000,0xa82a};
-
- pascal ComponentResult SGSetChannelMaxFrames(SGChannel c, long frameCount) = {0x2f3c,4,137,0x7000,0xa82a};
- pascal ComponentResult SGGetChannelMaxFrames(SGChannel c, long *frameCount) = {0x2f3c,4,138,0x7000,0xa82a};
-
- pascal ComponentResult SGSetChannelRefCon(SGChannel c, long refCon) = {0x2f3c,4,139,0x7000,0xa82a};
-
- /*
- Video stuff
- */
-
- typedef struct SGCompressInfo {
- Ptr buffer;
- unsigned long bufferSize;
- unsigned char similarity;
- unsigned char reserved;
- } SGCompressInfo;
-
- typedef pascal ComponentResult (*GrabProc)(SGChannel c, short bufferNum, long refCon);
- typedef pascal ComponentResult (*GrabCompleteProc)(SGChannel c, short bufferNum, Boolean *done, long refCon);
-
- typedef pascal ComponentResult (*DisplayProc)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
-
- typedef pascal ComponentResult (*CompressProc)(SGChannel c, short bufferNum, long refCon);
- typedef pascal ComponentResult (*CompressCompleteProc)(SGChannel c, short bufferNum,
- Boolean *done, SGCompressInfo *ci, long refCon);
-
- typedef pascal ComponentResult (*AddFrameProc)(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale,
- const SGCompressInfo *ci, long refCon);
-
- typedef pascal ComponentResult (*TransferFrameProc)(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn, long refCon);
-
- typedef struct VideoBottles {
- short procCount;
- GrabProc grabProc;
- GrabCompleteProc grabCompleteProc;
- DisplayProc displayProc;
- CompressProc compressProc;
- CompressCompleteProc compressCompleteProc;
- AddFrameProc addFrameProc;
- TransferFrameProc transferFrameProc;
- } VideoBottles;
-
- pascal ComponentResult SGGetSrcVideoBounds(SGChannel c, Rect *r) = {0x2f3c,4,256,0x7000,0xa82a};
- pascal ComponentResult SGSetVideoRect(SGChannel c, Rect *r) = {0x2f3c,4,257,0x7000,0xa82a};
- pascal ComponentResult SGGetVideoRect(SGChannel c, Rect *r) = {0x2f3c,4,258,0x7000,0xa82a};
-
- pascal ComponentResult SGGetVideoCompressorType(SGChannel c, OSType *compressorType) = {0x2f3c,4,259,0x7000,0xa82a};
- pascal ComponentResult SGSetVideoCompressorType(SGChannel c, OSType compressorType) = {0x2f3c,4,260,0x7000,0xa82a};
-
- pascal ComponentResult SGSetVideoCompressor(SGChannel c, short depth, CompressorComponent compressor,
- CodecQ spatialQuality, CodecQ temporalQuality, long keyFrameRate) = {0x2f3c,18,261,0x7000,0xa82a};
- pascal ComponentResult SGGetVideoCompressor(SGChannel c, short *depth, CompressorComponent *compressor,
- CodecQ *spatialQuality, CodecQ *temporalQuality, long *keyFrameRate) = {0x2f3c,20,262,0x7000,0xa82a};
-
- pascal ComponentInstance SGGetVideoDigitizerComponent(SGChannel c) = {0x2f3c,0,263,0x7000,0xa82a};
- pascal ComponentResult SGSetVideoDigitizerComponent(SGChannel c, ComponentInstance vdig) = {0x2f3c,4,264,0x7000,0xa82a};
- pascal ComponentResult SGVideoDigitizerChanged(SGChannel c) = {0x2f3c,0,265,0x7000,0xa82a};
-
- pascal ComponentResult SGSetVideoBottlenecks(SGChannel c, VideoBottles *vb) = {0x2f3c,4,266,0x7000,0xa82a};
- pascal ComponentResult SGGetVideoBottlenecks(SGChannel c, VideoBottles *vb) = {0x2f3c,4,267,0x7000,0xa82a};
-
- pascal ComponentResult SGGrabFrame(SGChannel c, short bufferNum) = {0x2f3c,2,268,0x7000,0xa82a};
- pascal ComponentResult SGGrabFrameComplete(SGChannel c, short bufferNum, Boolean *done) = {0x2f3c,6,269,0x7000,0xa82a};
-
- pascal ComponentResult SGDisplayFrame(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn) = {0x2f3c,10,270,0x7000,0xa82a};
-
- pascal ComponentResult SGCompressFrame(SGChannel c, short bufferNum) = {0x2f3c,2,271,0x7000,0xa82a};
- pascal ComponentResult SGCompressFrameComplete(SGChannel c, short bufferNum, Boolean *done, SGCompressInfo *ci) = {0x2f3c,10,272,0x7000,0xa82a};
-
- pascal ComponentResult SGAddFrame(SGChannel c, short bufferNum, TimeValue atTime, TimeScale scale, const SGCompressInfo *ci) = {0x2f3c,14,273,0x7000,0xa82a};
-
- pascal ComponentResult SGTransferFrameForCompress(SGChannel c, short bufferNum, MatrixRecord *mp, RgnHandle clipRgn) = {0x2f3c,10,274,0x7000,0xa82a};
-
- pascal ComponentResult SGSetCompressBuffer(SGChannel c, short depth, const Rect *compressSize) = {0x2f3c,6,279,0x7000,0xa82a};
-
- pascal ComponentResult SGGetCompressBuffer(SGChannel c, short *depth, Rect *compressSize) = {0x2f3c,8,280,0x7000,0xa82a};
-
- pascal ComponentResult SGGetBufferInfo(SGChannel c, short bufferNum,
- PixMapHandle *bufferPM, Rect *bufferRect,
- GWorldPtr *compressBuffer, Rect *compressBufferRect) = {0x2f3c,18,281,0x7000,0xa82a};
-
-
-
- /*
- Sound stuff
- */
-
- pascal ComponentResult SGSetSoundInputDriver(SGChannel c, Str255 driverName) = {0x2f3c,4,256,0x7000,0xa82a};
- pascal long SGGetSoundInputDriver(SGChannel c) = {0x2f3c,0,257,0x7000,0xa82a};
- pascal ComponentResult SGSoundInputDriverChanged(SGChannel c) = {0x2f3c,0,258,0x7000,0xa82a};
-
- pascal ComponentResult SGSetSoundRecordChunkSize(SGChannel c, long seconds) = {0x2f3c,4,259,0x7000,0xa82a};
- pascal long SGGetSoundRecordChunkSize(SGChannel c) = {0x2f3c,0,260,0x7000,0xa82a};
-
- pascal ComponentResult SGSetSoundInputRate(SGChannel c, Fixed rate) = {0x2f3c,4,261,0x7000,0xa82a};
- pascal Fixed SGGetSoundInputRate(SGChannel c) = {0x2f3c,0,262,0x7000,0xa82a};
-
-
- /*
- calls from seqGrab to Channel
- */
-
- pascal ComponentResult SGInitChannel(SGChannel c, SeqGrabComponent owner) = {0x2f3c,4,200,0x7000,0xa82a};
- pascal ComponentResult SGWriteSamples(SGChannel c, Movie m, AliasHandle theFile) = {0x2f3c,8,201,0x7000,0xa82a};
- pascal ComponentResult SGGetDataRate(SGChannel c, long *bytesPerSecond) = {0x2f3c,4,202,0x7000,0xa82a};
-
-
- /*
- calls from Channel to seqGrab
- */
-
- pascal ComponentResult SGWriteMovieData(SeqGrabComponent s, SGChannel c, Ptr p, long len, long *offset) = {0x2f3c,16,128,0x7000,0xa82a};
- pascal ComponentResult SGAddFrameReference(SeqGrabComponent s, seqGrabFrameInfo *frameInfo) = {0x2f3c,4,129,0x7000,0xa82a};
- pascal ComponentResult SGGetNextFrameReference(SeqGrabComponent s, seqGrabFrameInfo *frameInfo,
- TimeValue *frameDuration, long *frameNumber) = {0x2f3c,12,130,0x7000,0xa82a};
- pascal ComponentResult SGGetTimeBase(SeqGrabComponent s, TimeBase *tb) = {0x2f3c,4,131,0x7000,0xa82a};
-
- enum {
- noDeviceForChannel = -9400,
- grabTimeComplete = -9401,
- cantDoThatInCurrentMode = -9402,
- notEnoughMemoryToGrab = -9403,
- notEnoughDiskSpaceToGrab = -9404,
- couldntGetRequiredComponent = -9405,
- badSGChannel = -9406,
- seqGrabInfoNotAvailable = -9407,
- deviceCantMeetRequest = -9408
- };
-
-
-
- #endif _SeqGrab_
-