[Python-checkins] python/dist/src/Mac/Modules/qt _Qtmodule.c, 1.19, 1.20 qtscan.py, 1.24, 1.25 qtsupport.py, 1.24, 1.25

jackjansen at users.sourceforge.net jackjansen at users.sourceforge.net
Sat Jan 3 12:23:30 EST 2004


Update of /cvsroot/python/python/dist/src/Mac/Modules/qt
In directory sc8-pr-cvs1:/tmp/cvs-serv10409

Modified Files:
	_Qtmodule.c qtscan.py qtsupport.py 
Log Message:
Added interfaces for most of the stuff in QuickTimeComponents.h.


Index: _Qtmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** _Qtmodule.c	2 Jan 2004 23:51:22 -0000	1.19
--- _Qtmodule.c	3 Jan 2004 17:23:26 -0000	1.20
***************
*** 7294,7297 ****
--- 7294,7415 ----
  
  
+ /* ---------------------- Object type SGOutput ---------------------- */
+ 
+ PyTypeObject SGOutput_Type;
+ 
+ #define SGOutputObj_Check(x) ((x)->ob_type == &SGOutput_Type || PyObject_TypeCheck((x), &SGOutput_Type))
+ 
+ typedef struct SGOutputObject {
[...9708 lines suppressed...]
+ 	{"QTVideoOutputGetIndImageDecompressor", (PyCFunction)Qt_QTVideoOutputGetIndImageDecompressor, 1,
+ 	 PyDoc_STR("(QTVideoOutputComponent vo, long index) -> (ComponentResult _rv, Component codec)")},
+ 	{"QTVideoOutputBaseSetEchoPort", (PyCFunction)Qt_QTVideoOutputBaseSetEchoPort, 1,
+ 	 PyDoc_STR("(QTVideoOutputComponent vo, CGrafPtr echoPort) -> (ComponentResult _rv)")},
  	{"AlignWindow", (PyCFunction)Qt_AlignWindow, 1,
  	 PyDoc_STR("(WindowPtr wp, Boolean front) -> None")},
***************
*** 14838,14841 ****
--- 24543,24553 ----
  	Py_INCREF(&Movie_Type);
  	PyModule_AddObject(m, "MovieType", (PyObject *)&Movie_Type);
+ 	SGOutput_Type.ob_type = &PyType_Type;
+ 	if (PyType_Ready(&SGOutput_Type) < 0) return;
+ 	Py_INCREF(&SGOutput_Type);
+ 	PyModule_AddObject(m, "SGOutput", (PyObject *)&SGOutput_Type);
+ 	/* Backward-compatible name */
+ 	Py_INCREF(&SGOutput_Type);
+ 	PyModule_AddObject(m, "SGOutputType", (PyObject *)&SGOutput_Type);
  }
  

Index: qtscan.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtscan.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** qtscan.py	2 Jan 2004 23:51:22 -0000	1.24
--- qtscan.py	3 Jan 2004 17:23:27 -0000	1.25
***************
*** 9,16 ****
  LONG = "QuickTime"
  SHORT = "qt"
! OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", "IdleManager")
  
  def main():
! 	input = ("Movies.h", "ImageCompression.h")
  	output = SHORT + "gen.py"
  	defsoutput = TOOLBOXDIR + LONG + ".py"
--- 9,18 ----
  LONG = "QuickTime"
  SHORT = "qt"
! HEADERFILES= ("Movies.h", "ImageCompression.h", "QuickTimeComponents.h")
! OBJECTS = ("Movie", "Track", "Media", "UserData", "TimeBase", "MovieController", 
! 	"IdleManager", "SGOutput")
  
  def main():
! 	input = HEADERFILES
  	output = SHORT + "gen.py"
  	defsoutput = TOOLBOXDIR + LONG + ".py"
***************
*** 18,21 ****
--- 20,24 ----
  	scanner.scan()
  	scanner.close()
+ 	scanner.gentypetest(SHORT+"typetest.py")
  	print "=== Testing definitions output code ==="
  	execfile(defsoutput, {}, {})
***************
*** 38,44 ****
--- 41,49 ----
  	def writeinitialdefs(self):
  		self.defsfile.write("def FOUR_CHAR_CODE(x): return x\n")
+ 		self.defsfile.write("xmlIdentifierUnrecognized = -1\n")
  
  	def makeblacklistnames(self):
  		return [
+ 			"xmlIdentifierUnrecognized", # const with incompatible definition
  			"DisposeMovie",		# Done on python-object disposal
  			"DisposeMovieTrack",	# ditto
***************
*** 79,82 ****
--- 84,94 ----
              # these are ImageCompression blacklists
  			"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?
  			]
  
***************
*** 157,160 ****
--- 169,209 ----
              "GWorldFlags",
              "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
  			]
  

Index: qtsupport.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/qtsupport.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** qtsupport.py	2 Jan 2004 23:51:22 -0000	1.24
--- qtsupport.py	3 Jan 2004 17:23:27 -0000	1.25
***************
*** 117,120 ****
--- 117,121 ----
  MovieController = OpaqueByValueType('MovieController', 'MovieCtlObj')
  IdleManager = OpaqueByValueType('IdleManager', 'IdleManagerObj')
+ SGOutput = OpaqueByValueType('SGOutput', 'SGOutputObj')
  
  # Other opaque objects
***************
*** 128,136 ****
  GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', 'CmpObj')
  ImageTranscoderComponent = OpaqueByValueType('ImageTranscoderComponent', 'CmpObj')
! 
  
  ComponentInstance = OpaqueByValueType('ComponentInstance', 'CmpInstObj')
  MediaHandler = OpaqueByValueType('MediaHandler', 'CmpInstObj')
  DataHandler = OpaqueByValueType('DataHandler', 'CmpInstObj')
  
  RgnHandle = OpaqueByValueType("RgnHandle", "ResObj")
--- 129,151 ----
  GraphicsExportComponent = OpaqueByValueType('GraphicsExportComponent', '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')
  MediaHandler = OpaqueByValueType('MediaHandler', '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")
***************
*** 146,149 ****
--- 161,168 ----
  AliasHandle = OpaqueByValueType("AliasHandle", "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...
  OSType_ptr = OpaqueType("OSType", "PyMac_BuildOSType", "PyMac_GetOSType")
***************
*** 170,173 ****
--- 189,193 ----
  mediaHandlerFlagsEnum = Type("mediaHandlerFlagsEnum", "l")
  ComponentResult = Type("ComponentResult", "l")
+ VideoDigitizerError = Type("ComponentResult", "l")
  HandlerError = Type("HandlerError", "l")
  Ptr = InputOnlyType("Ptr", "s")
***************
*** 247,250 ****
--- 267,284 ----
  				}""")
  
+ 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...
  
***************
*** 258,261 ****
--- 292,296 ----
  MovieController_object = MovieCtlObjectDefinition('MovieController', 'MovieCtlObj', 'MovieController')
  IdleManager_object = IdleManagerObjectDefinition('IdleManager', 'IdleManagerObj', 'IdleManager')
+ SGOutput_object = SGOutputObjectDefinition('SGOutput', 'SGOutputObj', 'SGOutput')
  
  module.addobject(IdleManager_object)
***************
*** 266,269 ****
--- 301,308 ----
  module.addobject(Track_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
***************
*** 280,283 ****
--- 319,323 ----
  Track_methods = []
  Movie_methods = []
+ SGOutput_methods = []
  execfile(INPUTFILE)
  





More information about the Python-checkins mailing list