Fields vs. frames, and parameter saving
Fields vs. frames, and parameter saving
- Subject: Fields vs. frames, and parameter saving
- From: "Hugh Denman" <email@hidden>
- Date: Mon, 8 Oct 2007 01:54:58 +0100
Hi everybody, two FxPlug / Final Cut Pro questions:
1) I have a plugin that would really rather work on entire frames, rather than on fields, even when dealing with interlaced footage. Here's the 'properties' implementation:
- (NSDictionary *)properties
{
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool: YES], kFxPropertyKey_SupportsRowBytes,
[NSNumber numberWithBool: NO], kFxPropertyKey_SupportsR408,
[NSNumber numberWithBool: NO], kFxPropertyKey_SupportsR4fl,
[NSNumber numberWithBool: YES], kFxPropertyKey_MayRemapTime,
[NSNumber numberWithBool: NO], kFxPropertyKey_PixelIndependent, //Don't want to process fields
[NSNumber numberWithInt:0], kFxPropertyKey_EquivalentSMPTEWipeCode,
NULL];
}
I'm still getting passed half-height fields, however. Is there anything I can do about it? If I just process even-numbered fields, and divide rowbytes by 2, am I effectively processing frames then?
2) I can't get parameter persistence to work for me, using a custom parameter defined as below [at the end of the message]. When I quit FCP after saving my project, I can see that the NSCoding interfaces are called:
/Users/hughdenman/GPP/Plugins/FxPlug/Plugin/xcode/../Plugin_FxPlug.mm (59) [diagnostic]: Storing bytes: 3616
/Users/hughdenman/GPP/Plugins/FxPlug/Plugin/xcode/../Plugin_FxPlug.mm (48) [diagnostic]: Loaded bytes: 3616
but when the project is loaded on a subsequent invocation of FCP, I see
/Users/hughdenman/GPP/Plugins/FxPlug/Plugin/xcode/../Plugin_FxPlug.mm (59) [diagnostic]: Storing bytes: 0
/Users/hughdenman/GPP/Plugins/FxPlug/Plugin/xcode/../Plugin_FxPlug.mm (48) [diagnostic]: Loaded bytes: 0
/Users/hughdenman/GPP/Plugins/FxPlug/Plugin/xcode/../Plugin_FxPlug.mm (59) [diagnostic]: Storing bytes: 0
/Users/hughdenman/GPP/Plugins/FxPlug/Plugin/xcode/../Plugin_FxPlug.mm (48) [diagnostic]: Loaded bytes: 0
I don't know why encodeWithCoder should be called before initWithCoder, but anyway, somewhere my 3616 bytes are lost!
Has anyone any ideas to help me get this working?
Thanks,
Hugh
@interface CustomDataParam : NSObject <NSCoding>
{
NSMutableData * myData;
}
-(id)init;
-(UInt32)getLength;
-(const void*)getData;
-(BOOL)setData:(void *)data
withLength:(UInt32)dataLen;
-(void)encodeWithCoder:(NSCoder*)encoder;
-(id)initWithCoder:(NSCoder*)decoder;
@end
@implementation CustomDataParam
-(id)init
{
if (![super init]) return nil;
myData = [[NSMutableData alloc] initWithLength:0];
return self;
}
-(BOOL)setData:(void *)data
withLength:(UInt32)dataLen
{
NSRange range = {0, dataLen};
[myData setLength:dataLen];
[myData replaceBytesInRange:range withBytes:data];
return YES;
}
-(UInt32)getLength
{
return [myData length];
}
-(const void*)getData
{
return [myData bytes];
}
- (id) initWithCoder:(NSCoder*)decoder
{
using namespace GPP;
if (self=[super init]) {
myData = [[decoder decodeObjectForKey:@"myData"] retain];
GPP_LOG(GPPLog::diagnostic, "Loaded bytes: " << [myData length]);
}
return self;
}
- (void) encodeWithCoder:(NSCoder*)coder
{
using namespace GPP;
GPP_LOG(GPPLog::diagnostic, "encodeWithCoder invoked...");
GPP_LOG(GPPLog::diagnostic, "Storing bytes: " << [myData length]);
[coder encodeObject:myData forKey:@"myData"];
//[myData encodeWithCoder:coder];
}
@end
--
email@hidden+353876290136
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden