From: Klaus R. <kre...@us...> - 2007-06-28 19:13:27
|
Update of /cvsroot/ming/ming/py_ext In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1588/py_ext Modified Files: ming.py ming_wrap.c Log Message: python bindings: 1) The nice Python (ming.py) binding does not have SWFVideoStream. 2) The low-level Python binding (ming_wrap.c) has a bug in SWFVideoStream which causes an incorrect additional layer of pointer indirection on SWFVideoStream objects. submitted by: Joris van Rantwijk Index: ming_wrap.c =================================================================== RCS file: /cvsroot/ming/ming/py_ext/ming_wrap.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ming_wrap.c 27 Nov 2006 00:53:37 -0000 1.5 --- ming_wrap.c 28 Jun 2007 19:13:20 -0000 1.6 *************** *** 7105,7109 **** } result = newSWFVideoStream_fromFile(arg1); ! resultobj = SWIG_NewPointerObj((SWFVideoStream *)memcpy((SWFVideoStream *)malloc(sizeof(SWFVideoStream)),&result,sizeof(SWFVideoStream)), SWIGTYPE_p_SWFVideoStream, SWIG_POINTER_OWN | 0 ); return resultobj; fail: --- 7105,7109 ---- } result = newSWFVideoStream_fromFile(arg1); ! resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_SWFVideoStream, SWIG_POINTER_OWN | 0 ); return resultobj; fail: *************** *** 7133,7137 **** } result = newSWFVideoStream_fromInput(arg1); ! resultobj = SWIG_NewPointerObj((SWFVideoStream *)memcpy((SWFVideoStream *)malloc(sizeof(SWFVideoStream)),&result,sizeof(SWFVideoStream)), SWIGTYPE_p_SWFVideoStream, SWIG_POINTER_OWN | 0 ); return resultobj; fail: --- 7133,7137 ---- } result = newSWFVideoStream_fromInput(arg1); ! resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_SWFVideoStream, SWIG_POINTER_OWN | 0 ); return resultobj; fail: *************** *** 7146,7150 **** if (!PyArg_ParseTuple(args,(char *)":newSWFVideoStream")) SWIG_fail; result = newSWFVideoStream(); ! resultobj = SWIG_NewPointerObj((SWFVideoStream *)memcpy((SWFVideoStream *)malloc(sizeof(SWFVideoStream)),&result,sizeof(SWFVideoStream)), SWIGTYPE_p_SWFVideoStream, SWIG_POINTER_OWN | 0 ); return resultobj; fail: --- 7146,7150 ---- if (!PyArg_ParseTuple(args,(char *)":newSWFVideoStream")) SWIG_fail; result = newSWFVideoStream(); ! resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_SWFVideoStream, SWIG_POINTER_OWN | 0 ); return resultobj; fail: *************** *** 7158,7162 **** int arg2 ; int arg3 ; - void *argp1 ; int res1 = 0 ; int val2 ; --- 7158,7161 ---- *************** *** 7170,7182 **** if (!PyArg_ParseTuple(args,(char *)"OOO:SWFVideoStream_setDimension",&obj0,&obj1,&obj2)) SWIG_fail; { ! res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_SWFVideoStream, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SWFVideoStream_setDimension" "', argument " "1"" of type '" "SWFVideoStream""'"); } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SWFVideoStream_setDimension" "', argument " "1"" of type '" "SWFVideoStream""'"); - } else { - arg1 = *((SWFVideoStream *)(argp1)); - } } ecode2 = SWIG_AsVal_int(obj1, &val2); --- 7169,7176 ---- if (!PyArg_ParseTuple(args,(char *)"OOO:SWFVideoStream_setDimension",&obj0,&obj1,&obj2)) SWIG_fail; { ! res1 = SWIG_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SWFVideoStream, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SWFVideoStream_setDimension" "', argument " "1"" of type '" "SWFVideoStream""'"); } } ecode2 = SWIG_AsVal_int(obj1, &val2); *************** *** 7202,7206 **** SWFVideoStream arg1 ; int result; - void *argp1 ; int res1 = 0 ; PyObject * obj0 = 0 ; --- 7196,7199 ---- *************** *** 7208,7220 **** if (!PyArg_ParseTuple(args,(char *)"O:SWFVideoStream_getNumFrames",&obj0)) SWIG_fail; { ! res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_SWFVideoStream, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SWFVideoStream_getNumFrames" "', argument " "1"" of type '" "SWFVideoStream""'"); } - if (!argp1) { - SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SWFVideoStream_getNumFrames" "', argument " "1"" of type '" "SWFVideoStream""'"); - } else { - arg1 = *((SWFVideoStream *)(argp1)); - } } result = (int)SWFVideoStream_getNumFrames(arg1); --- 7201,7208 ---- if (!PyArg_ParseTuple(args,(char *)"O:SWFVideoStream_getNumFrames",&obj0)) SWIG_fail; { ! res1 = SWIG_ConvertPtr(obj0, (void **)&arg1, SWIGTYPE_p_SWFVideoStream, 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SWFVideoStream_getNumFrames" "', argument " "1"" of type '" "SWFVideoStream""'"); } } result = (int)SWFVideoStream_getNumFrames(arg1); Index: ming.py =================================================================== RCS file: /cvsroot/ming/ming/py_ext/ming.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ming.py 12 Feb 2007 17:07:16 -0000 1.19 --- ming.py 28 Jun 2007 19:13:20 -0000 1.20 *************** *** 677,680 **** --- 677,688 ---- mingc.SWFButton_addAction(self.this, action, flags) + class SWFVideoStream(SWFBase): + def __init__(self): + self.this = mingc.newSWFVideoStream() + def setDimension(self, w, h): + return mingc.SWFVideoStream_setDimension(self.this, w, h) + def getNumFrames(self): + return mingc.SWFVideoStream_getNumFrames(self.this) + def SWFBUTTON_KEYPRESS(c): |