I am running into some odd behavior porting a video filter over from Windows to Mac. As far as I know, the filter is running properly on Windows.
The portion of the video filter I am working on that is not necessarily custom is pretty much a cut and paste of the Simple_Video_Filter example project in the SDK. Specifically, the code run at the following selectors in the video filter I am working on is the same as in the example project: fsInitSpec, fshasSetupDialog, fsSetup (except for differing init of custom controls for my filter), fsCanHandlePAR, fsGetPixelFormatsSupported (except for additional formats my filter can handle). Also, the signature of the entry function for my filter - xFilter - is the same as that of the sample project.
The crash is occuring soon after entry into the code for the fsExecute selector. The crash is occurring in a part of this section which is also a cut and paste from the sample project:
result = fsNoErr;
// Get the data from specsHandle
paramsH = (filterParamsH)(*theData)->specsHandle;
// Get the frame dimensions
In a seemingly non deterministic fashion, the code will crash on the call to '((*theData)->piSuites->ppixFuncs->ppixGetBounds)((*theData)->destination, &box);' due to a EXC_BAD_ACCESS signal being received. A look at the memory reveals that 'theData' seems ok, however the 'piSuites' member of 'theData' is NULL, and hence the crash. In the sample it doesn't seem that one would have to specifically check for a non null 'piSuites', 'ppixFuncs' ect so long as we have 'theData' (and also 'paramsH')
As it seems that everything else leading up to the calling of the line of code that is crashing is pretty much cut and paste, I am somewhat at a loss.
Has anyone seen similar behavior and knows the remedy?
Thanks in advance,
Not sure why it isn't providing a valid piSuites pointer during fsExecute. You're not able to reproduce it in the Simple Video Filter sample, right? If you can find any steps to reproduce the NULL pointer, that would be really interesting for us.
This one is kind of embarrassing. The Mac project that was crashing was sourcing Premiere SDK header files from, I believe, what is marked in our source tree as the Windows SDK (if not simply the Windows SDK, then also an older version of the SDK at that - I forget).
For what it's worth, the headers for the Win and Mac SDKs are the same. It's just the sample projects that different in the SDKs. Glad to hear it's working now.