Using the FxPlug SDK 1.2.5 and Motion 4, I make a new Filter plugin, and take out all the "functional" code. So, I end up with a main plugin .m file that looks like:
#import "MyPlugin.h"
#import <FxPlug/FxPlugSDK.h>
#include <OpenGL/gl.h>
#include <OpenGL/glext.h>
#include <OpenGL/glu.h>
@implementation MyPlugin
- (id)initWithAPIManager:(id)apiManager;
{
_apiManager = apiManager;
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (BOOL)variesOverTime
{
return NO;
}
- (NSDictionary *)properties
{
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool: YES], kFxPropertyKey_SupportsRowBytes,
[NSNumber numberWithBool: NO], kFxPropertyKey_SupportsR408,
[NSNumber numberWithBool: NO], kFxPropertyKey_SupportsR4fl,
[NSNumber numberWithBool: NO], kFxPropertyKey_MayRemapTime,
[NSNumber numberWithInt:0], kFxPropertyKey_EquivalentSMPTEWipeCode,
NULL];
}
- (BOOL)addParameters
{
return YES;
}
- (BOOL)parameterChanged:(UInt32)parmId
{
return YES;
}
- (BOOL)getOutputWidth:(UInt32 *)width
height:(UInt32 *)height
withInput:(FxImageInfo)inputInfo
withInfo:(FxRenderInfo)renderInfo
{
if ( width != NULL && height != NULL )
{
*width = inputInfo.width;
*height = inputInfo.height;
return YES;
}
else
return NO;
}
- (BOOL)renderOutput:(FxImage *)outputImage
withInput:(FxImage *)inputImage
withInfo:(FxRenderInfo)renderInfo
{
return NO;
}
- (BOOL)frameSetup:(FxRenderInfo)renderInfo
inputInfo:(FxImageInfo)inputInfo
hardware:(BOOL *)canRenderHardware
software:(BOOL *)canRenderSoftware
{
*canRenderSoftware = YES;
*canRenderHardware = NO;
return YES;
}
- (BOOL)frameCleanup
{
return YES;
}
@end
If I then make a 300-frame 32-bit (or 16-bit) project in Motion, load in the same "mushroom slice" clip (or any other clip I have), apply this filter, and press the "play" button, the first time through the project I get nothing but blank images (which isn't surprising). As motion wraps and starts playing the clip a second time, the processing gets VERY slow and eventually (usually around frame 208), I get an image that looks like a half-width rendition of the red channel of the frame and motion freezes. Eventually, it will die with an "EXC_BAD_ACCESS" exception. This is very repeatable on my system and on my client's system. Any ideas or thoughts? I'm kind of at a loss here.(Note: 8-bit Motion projects appear to work OK, but my clients needs a 32-bit project for other processing he plans to do)