Re: FCP X: perform selector after delay
Re: FCP X: perform selector after delay
- Subject: Re: FCP X: perform selector after delay
- From: Pierre Jasmin <email@hidden>
- Date: Mon, 17 Oct 2011 12:56:16 -0700
- Organization: RE:Vision Effects
On 10/15/2011 8:05 AM, Eberhard Ammelt wrote:
Hello Paul,
thanks for your reply.
We have a range of QC based effects and have noticed a
potential problem.
When there are many effects in the timeline, many QC
renderers are initialized and occupy many resources but get
rarely released.
We cannot use the FxPlug2 FxHostResourcesAPI to manage these
resources, so I'm looking for a way to release QC renderers e.g.
after a certain interval of inactivity.
Eberhard, if you do a feature request, you can add my name,
It could be useful at some point (that we actually work is higher
priority) to have some sort of timer on ressource management to call
back the plugins so the plugin can somehow release recreatable
internal cache of any type. It tends to happen here when a user
decide to apply an effect on all the shots in their project. That
could also be an application of the memory suite for large blocks
(assuming you maintain a counter), in that you can scan the plugin
list and look for large usage of memory.
Pierre
RE:Vision Effects
"performSelectorOnMainThread" did work well in FCP 7 as
initialization and rendering of effects was performed on the
main thread as well but maybe it's not a good idea to release a
QC renderer on a different thread than it was created and
rendered on, even when these operations are synchronized.
I think I can avoid these threading issues by performing this
kind of housekeeping for all renderers during the render call.
Regards, Eberhard
Hi Eberhard,
Delayed operations like this will typically only work on threads
that have an associated run loop. Typically only the main thread
has a run loop.
If you are being called from a non-main thread (like a render
thread), and you want to schedule some work to be done later on
the main thread, then -performSelectorOnMainThread is probably
what you want.
If you are being called from a non-main thread (like a render
thread), and you want to schedule some work to be done later on
the non-main thread, that is more problematic. For one thing,
the render thread is probably not expecting you to add
additional work. For another, with GCD, the thread may be
deleted or re-used after the current work unit is finished. I
wouldn't recommend trying to do this.
Keep in mind that in a multithreaded application, it's important
to synchronize access to shared data like parameter values, etc.
The host app might not be prepared for your plugin to run at an
arbitrary time. So scheduling work to be performed "later" on
the main thread may lead to unpredictable problems.
What exactly are you trying to do?
- Paul
On Oct 14, 2011, at 6:10 AM, Eberhard Ammelt wrote:
Hello,
I want a selector of an FxPlug effect to
be performed after a delay in FCP X and have tried
- (void)performSelector:(SEL)aSelector
withObject:(id)anArgument afterDelay:(NSTimeInterval)delay;
and
+ (NSTimer
*)scheduledTimerWithTimeInterval:(NSTimeInterval)ti
target:(id)aTarget selector:(SEL)aSelector
userInfo:(id)userInfo repeats:(BOOL)yesOrNo;
but it seems both methods don't work on
the same thread where the effect's methods are called.
Is this only possible on a separate
thread, or is there another solution?
Thanks,
Eberhard
_______________________________________________
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
_______________________________________________
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
|
_______________________________________________
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