Added interfaces for most of the stuff in QuickTimeComponents.h.
This commit is contained in:
parent
ff8505dc89
commit
007b8eb7c4
File diff suppressed because it is too large
Load Diff
|
@ -8,15 +8,18 @@ from scantools import Scanner
|
||||||
|
|
||||||
LONG = "QuickTime"
|
LONG = "QuickTime"
|
||||||
SHORT = "qt"
|
SHORT = "qt"
|
||||||
OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", "IdleManager")
|
HEADERFILES= ("Movies.h", "ImageCompression.h", "QuickTimeComponents.h")
|
||||||
|
OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController",
|
||||||
|
"IdleManager", "SGOutput")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
input = ("Movies.h", "ImageCompression.h")
|
input = HEADERFILES
|
||||||
output = SHORT + "gen.py"
|
output = SHORT + "gen.py"
|
||||||
defsoutput = TOOLBOXDIR + LONG + ".py"
|
defsoutput = TOOLBOXDIR + LONG + ".py"
|
||||||
scanner = MyScanner(input, output, defsoutput)
|
scanner = MyScanner(input, output, defsoutput)
|
||||||
scanner.scan()
|
scanner.scan()
|
||||||
scanner.close()
|
scanner.close()
|
||||||
|
scanner.gentypetest(SHORT+"typetest.py")
|
||||||
print "=== Testing definitions output code ==="
|
print "=== Testing definitions output code ==="
|
||||||
execfile(defsoutput, {}, {})
|
execfile(defsoutput, {}, {})
|
||||||
print "=== Done scanning and generating, now importing the generated code... ==="
|
print "=== Done scanning and generating, now importing the generated code... ==="
|
||||||
|
@ -37,9 +40,11 @@ class MyScanner(Scanner):
|
||||||
|
|
||||||
def writeinitialdefs(self):
|
def writeinitialdefs(self):
|
||||||
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
|
self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
|
||||||
|
self.defsfile.write("xmlIdentifierUnrecognized = -1\n")
|
||||||
|
|
||||||
def makeblacklistnames(self):
|
def makeblacklistnames(self):
|
||||||
return [
|
return [
|
||||||
|
"xmlIdentifierUnrecognized", # const with incompatible definition
|
||||||
"DisposeMovie", # Done on python-object disposal
|
"DisposeMovie", # Done on python-object disposal
|
||||||
"DisposeMovieTrack", # ditto
|
"DisposeMovieTrack", # ditto
|
||||||
"DisposeTrackMedia", # ditto
|
"DisposeTrackMedia", # ditto
|
||||||
|
@ -78,6 +83,13 @@ class MyScanner(Scanner):
|
||||||
|
|
||||||
# these are ImageCompression blacklists
|
# these are ImageCompression blacklists
|
||||||
"GraphicsExportGetInputPtr",
|
"GraphicsExportGetInputPtr",
|
||||||
|
|
||||||
|
# QuickTimeComponents
|
||||||
|
# These two need some help: the first returns a point to a databuffer that
|
||||||
|
# the second disposes. Generate manually?
|
||||||
|
"VDCompressDone",
|
||||||
|
"VDReleaseCompressBuffer",
|
||||||
|
"QTVideoOutputGetGWorldParameters", # How useful is this?
|
||||||
]
|
]
|
||||||
|
|
||||||
def makeblacklisttypes(self):
|
def makeblacklisttypes(self):
|
||||||
|
@ -156,6 +168,43 @@ class MyScanner(Scanner):
|
||||||
"PixMapPtr",
|
"PixMapPtr",
|
||||||
"GWorldFlags",
|
"GWorldFlags",
|
||||||
"void_ptr", # XXX Being lazy, this one is doable.
|
"void_ptr", # XXX Being lazy, this one is doable.
|
||||||
|
|
||||||
|
# These are from QuickTimeComponents
|
||||||
|
"CDataHandlerUPP",
|
||||||
|
"CharDataHandlerUPP",
|
||||||
|
"CommentHandlerUPP",
|
||||||
|
"DataHCompletionUPP",
|
||||||
|
"'MovieExportGetDataUPP",
|
||||||
|
"MovieExportGetPropertyUPP",
|
||||||
|
"PreprocessInstructionHandlerUPP",
|
||||||
|
"SGModalFilterUPP",
|
||||||
|
"StartDocumentHandlerUPP",
|
||||||
|
"StartElementHandlerUPP",
|
||||||
|
"VdigIntUPP",
|
||||||
|
"SGDataUPP",
|
||||||
|
"EndDocumentHandlerUPP",
|
||||||
|
"EndElementHandlerUPP",
|
||||||
|
"VideoBottles", # Record full of UPPs
|
||||||
|
|
||||||
|
"SCParams",
|
||||||
|
"ICMCompletionProcRecordPtr",
|
||||||
|
"DataHVolumeList",
|
||||||
|
"DigitizerInfo",
|
||||||
|
"SGCompressInfo",
|
||||||
|
"SeqGrabExtendedFrameInfoPtr",
|
||||||
|
"SeqGrabFrameInfoPtr",
|
||||||
|
"TCTextOptionsPtr",
|
||||||
|
"SGCompressInfo_ptr",
|
||||||
|
"SGDeviceList",
|
||||||
|
"TextDisplayData",
|
||||||
|
"TimeCodeDef",
|
||||||
|
"TimeCodeRecord",
|
||||||
|
"TweenRecord",
|
||||||
|
"VDGamRecPtr",
|
||||||
|
"ToneDescription", # XXXX Just lazy: this one is easy.
|
||||||
|
"XMLDoc",
|
||||||
|
"UInt64", # XXXX lazy
|
||||||
|
"UInt64_ptr", # XXXX lazy
|
||||||
]
|
]
|
||||||
|
|
||||||
def makerepairinstructions(self):
|
def makerepairinstructions(self):
|
||||||
|
|
|
@ -116,6 +116,7 @@ UserData = OpaqueByValueType('UserData', 'UserDataObj')
|
||||||
TimeBase = OpaqueByValueType('TimeBase', 'TimeBaseObj')
|
TimeBase = OpaqueByValueType('TimeBase', 'TimeBaseObj')
|
||||||
MovieController = OpaqueByValueType('MovieController', 'MovieCtlObj')
|
MovieController = OpaqueByValueType('MovieController', 'MovieCtlObj')
|
||||||
IdleManager = OpaqueByValueType('IdleManager', 'IdleManagerObj')
|
IdleManager = OpaqueByValueType('IdleManager', 'IdleManagerObj')
|
||||||
|
SGOutput = OpaqueByValueType('SGOutput', 'SGOutputObj')
|
||||||
|
|
||||||
# Other opaque objects
|
# Other opaque objects
|
||||||
Component = OpaqueByValueType('Component', 'CmpObj')
|
Component = OpaqueByValueType('Component', 'CmpObj')
|
||||||
|
@ -127,11 +128,25 @@ CodecComponent = OpaqueByValueType('CodecComponent', 'CmpObj')
|
||||||
GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpObj')
|
GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpObj')
|
||||||
GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj')
|
GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj')
|
||||||
ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj')
|
ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj')
|
||||||
|
DataCodecComponent = OpaqueByValueType('DataCodecComponent', 'CmpObj')
|
||||||
|
GraphicImageMovieImportComponent = OpaqueByValueType('GraphicImageMovieImportComponent', 'CmpObj')
|
||||||
|
MovieExportComponent = OpaqueByValueType('MovieExportComponent', 'CmpObj')
|
||||||
|
MovieImportComponent = OpaqueByValueType('MovieImportComponent', 'CmpObj')
|
||||||
|
QTVideoOutputComponent = OpaqueByValueType('QTVideoOutputComponent', 'CmpObj')
|
||||||
|
SeqGrabComponent = OpaqueByValueType('SeqGrabComponent', 'CmpObj')
|
||||||
|
TextExportComponent = OpaqueByValueType('TextExportComponent', 'CmpObj')
|
||||||
|
TweenerComponent = OpaqueByValueType('TweenerComponent', 'CmpObj')
|
||||||
|
pnotComponent = OpaqueByValueType('pnotComponent', 'CmpObj')
|
||||||
|
VideoDigitizerComponent = OpaqueByValueType('VideoDigitizerComponent', 'CmpObj')
|
||||||
|
|
||||||
ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj')
|
ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj')
|
||||||
MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj')
|
MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj')
|
||||||
DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj')
|
DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj')
|
||||||
|
SGChannel = OpaqueByValueType('SGChannel', 'CmpInstObj')
|
||||||
|
|
||||||
|
ConstFSSpecPtr = FSSpec_ptr
|
||||||
|
GrafPtr = OpaqueByValueType("GrafPtr", "GrafObj")
|
||||||
|
Byte = Boolean # XXXX For GetPaused and SetPaused
|
||||||
|
|
||||||
RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
|
RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
|
||||||
PicHandle = OpaqueByValueType("PicHandle", "ResObj")
|
PicHandle = OpaqueByValueType("PicHandle", "ResObj")
|
||||||
|
@ -145,6 +160,10 @@ CGrafPtr = OpaqueByValueType("CGrafPtr", "GrafObj")
|
||||||
GDHandle = OpaqueByValueType("GDHandle", "OptResObj")
|
GDHandle = OpaqueByValueType("GDHandle", "OptResObj")
|
||||||
AliasHandle = OpaqueByValueType("AliasHandle", "ResObj")
|
AliasHandle = OpaqueByValueType("AliasHandle", "ResObj")
|
||||||
SoundDescriptionHandle = OpaqueByValueType("SoundDescriptionHandle", "ResObj")
|
SoundDescriptionHandle = OpaqueByValueType("SoundDescriptionHandle", "ResObj")
|
||||||
|
VdigBufferRecListHandle = OpaqueByValueType("VdigBufferRecListHandle", "ResObj")
|
||||||
|
VDCompressionListHandle = OpaqueByValueType("VDCompressionListHandle", "ResObj")
|
||||||
|
TimeCodeDescriptionHandle = OpaqueByValueType("TimeCodeDescriptionHandle", "ResObj")
|
||||||
|
DataHFileTypeOrderingHandle = OpaqueByValueType("DataHFileTypeOrderingHandle", "ResObj")
|
||||||
# Silly Apple, passing an OStype by reference...
|
# Silly Apple, passing an OStype by reference...
|
||||||
OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType")
|
OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType")
|
||||||
# And even sillier: passing floats by address
|
# And even sillier: passing floats by address
|
||||||
|
@ -169,6 +188,7 @@ dataRefAttributesFlags = Type("dataRefAttributesFlags", "l")
|
||||||
playHintsEnum = Type("playHintsEnum", "l")
|
playHintsEnum = Type("playHintsEnum", "l")
|
||||||
mediaHandlerFlagsEnum = Type("mediaHandlerFlagsEnum", "l")
|
mediaHandlerFlagsEnum = Type("mediaHandlerFlagsEnum", "l")
|
||||||
ComponentResult = Type("ComponentResult", "l")
|
ComponentResult = Type("ComponentResult", "l")
|
||||||
|
VideoDigitizerError = Type("ComponentResult", "l")
|
||||||
HandlerError = Type("HandlerError", "l")
|
HandlerError = Type("HandlerError", "l")
|
||||||
Ptr = InputOnlyType("Ptr", "s")
|
Ptr = InputOnlyType("Ptr", "s")
|
||||||
StringPtr = Type("StringPtr", "s")
|
StringPtr = Type("StringPtr", "s")
|
||||||
|
@ -246,6 +266,20 @@ class IdleManagerObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
|
||||||
return NULL;
|
return NULL;
|
||||||
}""")
|
}""")
|
||||||
|
|
||||||
|
class SGOutputObjectDefinition(PEP253Mixin, GlobalObjectDefinition):
|
||||||
|
# XXXX I'm not sure I fully understand how SGOutput works. It seems it's always tied
|
||||||
|
# to a specific SeqGrabComponent, but I'm not 100% sure. Also, I'm not sure all the
|
||||||
|
# routines that return an SGOutput actually return a *new* SGOutput. Need to read up on
|
||||||
|
# this.
|
||||||
|
def outputCheckNewArg(self):
|
||||||
|
Output("""if (itself == NULL) {
|
||||||
|
PyErr_SetString(Qt_Error,"Cannot create null SGOutput");
|
||||||
|
return NULL;
|
||||||
|
}""")
|
||||||
|
# def outputFreeIt(self, itselfname):
|
||||||
|
# Output("SGDisposeOutput(%s);", itselfname)
|
||||||
|
|
||||||
|
|
||||||
# From here on it's basically all boiler plate...
|
# From here on it's basically all boiler plate...
|
||||||
|
|
||||||
# Create the generator groups and link them
|
# Create the generator groups and link them
|
||||||
|
@ -257,6 +291,7 @@ UserData_object = UserDataObjectDefinition('UserData', 'UserDataObj', 'UserData'
|
||||||
TimeBase_object = TimeBaseObjectDefinition('TimeBase', 'TimeBaseObj', 'TimeBase')
|
TimeBase_object = TimeBaseObjectDefinition('TimeBase', 'TimeBaseObj', 'TimeBase')
|
||||||
MovieController_object = MovieCtlObjectDefinition('MovieController', 'MovieCtlObj', 'MovieController')
|
MovieController_object = MovieCtlObjectDefinition('MovieController', 'MovieCtlObj', 'MovieController')
|
||||||
IdleManager_object = IdleManagerObjectDefinition('IdleManager', 'IdleManagerObj', 'IdleManager')
|
IdleManager_object = IdleManagerObjectDefinition('IdleManager', 'IdleManagerObj', 'IdleManager')
|
||||||
|
SGOutput_object = SGOutputObjectDefinition('SGOutput', 'SGOutputObj', 'SGOutput')
|
||||||
|
|
||||||
module.addobject(IdleManager_object)
|
module.addobject(IdleManager_object)
|
||||||
module.addobject(MovieController_object)
|
module.addobject(MovieController_object)
|
||||||
|
@ -265,6 +300,10 @@ module.addobject(UserData_object)
|
||||||
module.addobject(Media_object)
|
module.addobject(Media_object)
|
||||||
module.addobject(Track_object)
|
module.addobject(Track_object)
|
||||||
module.addobject(Movie_object)
|
module.addobject(Movie_object)
|
||||||
|
module.addobject(SGOutput_object)
|
||||||
|
|
||||||
|
# Test which types we are still missing.
|
||||||
|
execfile(string.lower(MODPREFIX) + 'typetest.py')
|
||||||
|
|
||||||
# Create the generator classes used to populate the lists
|
# Create the generator classes used to populate the lists
|
||||||
Function = OSErrWeakLinkFunctionGenerator
|
Function = OSErrWeakLinkFunctionGenerator
|
||||||
|
@ -279,6 +318,7 @@ UserData_methods = []
|
||||||
Media_methods = []
|
Media_methods = []
|
||||||
Track_methods = []
|
Track_methods = []
|
||||||
Movie_methods = []
|
Movie_methods = []
|
||||||
|
SGOutput_methods = []
|
||||||
execfile(INPUTFILE)
|
execfile(INPUTFILE)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue