#include "ofxImageEffect.h" #define kOfxImageEffectActionGetFramesNeeded "OfxImageEffectActionGetFramesNeeded"
handlehandle to the instance, cast to an
inArgshas the following property...
kOfxPropTimethe effect time for which we need to calculate the frames needed on input
outArgshas a set of properties, one for each input clip, named "OfxImageClipPropFrameRange_" with the name of the clip post-pended. For example "OfxImageClipPropFrameRange_Source". All these properties are multi-dimensional doubles, with the dimension is a multiple of two. Each pair of values indicates a continuous range of frames that is needed on the given input. They are all initalised to the default value.
This action lets the host ask the effect what frames are needed from each input clip to process a given frame. For example a temporal based degrainer may need several frames around the frame to render to do its work.
This action need only ever be called if the plugin has set the
property on the plugin descriptor to be true. Otherwise the host assumes that the only frame needed from the inputs is the current one and this action is not called.
Note that each clip can have it's required frame range specified, and that you can specify discontinuous sets of ranges for each clip, for example...
// The effect always needs the initial frame of the source as well as the previous and current frame double rangeSource; // required ranges on the source rangeSource = 0; // we always need frame 0 of the source rangeSource = 0; rangeSource = currentFrame - 1; // we also need the previous and current frame on the source rangeSource = currentFrame; gPropHost->propSetDoubleN(outArgs, "OfxImageClipPropFrameRange_Source", 4, rangeSource);
Which sets two discontinuous range of frames from the 'Source' clip required as input.
The default frame range is simply the single frame, kOfxPropTime..kOfxPropTime, found on the
property set. All the frame ranges in the
property set must initialised to this value before the action is called.