// describe the plug-in in context static OfxStatus describeInContext( OfxImageEffectHandle effect, OfxPropertySetHandle inArgs) { OfxPropertySetHandle props; // define the single output clip in both contexts gEffectSuite->clipDefine(effect, "Output", &props); // set the component types we can handle on out output gPropertySuite->propSetString(props, kOfxImageEffectPropSupportedComponents, 0, kOfxImageComponentRGBA); // define the single source clip in both contexts gEffectSuite->clipDefine(effect, "Source", &props); // set the component types we can handle on our main input gPropertySuite->propSetString(props, kOfxImageEffectPropSupportedComponents, 0, kOfxImageComponentRGBA); return kOfxStatOK; }
The describe in context action is called once for each context that a plug-in says it can work in. Here the plug-in must define the clips it will use and any parameters it may need for that context. The set of clips and parameters need not be the same for each context, though typically a core of parameters and some clips will be the same. Note that, as with the describe action, the describe in context action is passed a descriptor rather than an instance.
The first thing our function does is to define the clip called "Output" which is mandatory for the filter context. This function returns a property set which is used to describe how the effect wants to deal with that clip. In this case the effect says that it will only accept RGBA images on the output. Next it does the same for the mandated "Source" clip. Having defined the two clips needed for this context it returns.