| 806 | } |
| 807 | |
| 808 | bool |
| 809 | OfxClipInstance::getInputImageInternal(const OfxTime time, |
| 810 | const ViewSpec viewParam, |
| 811 | const OfxRectD *optionalBounds, |
| 812 | const std::string* ofxPlane, |
| 813 | const ImageBitDepthEnum* textureDepth, |
| 814 | OFX::Host::ImageEffect::Image** retImage, |
| 815 | OFX::Host::ImageEffect::Texture** retTexture) |
| 816 | { |
| 817 | assert( !isOutput() ); |
| 818 | assert( (retImage && !retTexture) || (!retImage && retTexture) ); |
| 819 | |
| 820 | ClipDataTLSPtr tls = _imp->tlsData->getTLSData(); |
| 821 | RenderActionDataPtr renderData; |
| 822 | |
| 823 | //If components param is not set (i.e: the plug-in uses regular clipGetImage call) then figure out the plane from the TLS set in OfxEffectInstance::render |
| 824 | //otherwise use the param sent by the plug-in call of clipGetImagePlane |
| 825 | if (tls) { |
| 826 | if ( !tls->renderData.empty() ) { |
| 827 | renderData = tls->renderData.back(); |
| 828 | assert(renderData); |
| 829 | } |
| 830 | } |
| 831 | |
| 832 | |
| 833 | EffectInstancePtr effect = getEffectHolder(); |
| 834 | assert(effect); |
| 835 | int inputnb = getInputNb(); |
| 836 | const std::string& thisClipComponents = getComponents(); |
| 837 | |
| 838 | //If components param is not set (i.e: the plug-in uses regular clipGetImage call) then figure out the plane from the TLS set in OfxEffectInstance::render |
| 839 | //otherwise use the param sent by the plug-in call of clipGetImagePlane |
| 840 | |
| 841 | //bool isMultiplanar = effect->isMultiPlanar(); |
| 842 | ImagePlaneDesc comp; |
| 843 | if (!ofxPlane) { |
| 844 | EffectInstance::ComponentsNeededMapPtr neededComps; |
| 845 | effect->getThreadLocalNeededComponents(&neededComps); |
| 846 | bool foundCompsInTLS = false; |
| 847 | if (neededComps) { |
| 848 | EffectInstance::ComponentsNeededMap::iterator found = neededComps->find(inputnb); |
| 849 | if ( found != neededComps->end() ) { |
| 850 | if ( found->second.empty() ) { |
| 851 | ///We are in the case of a multi-plane effect who did not specify correctly the needed components for an input |
| 852 | //fallback on the basic components indicated on the clip |
| 853 | //This could be the case for example for the Mask Input |
| 854 | ImagePlaneDesc pairedComp; |
| 855 | ImagePlaneDesc::mapOFXComponentsTypeStringToPlanes( thisClipComponents, &comp, &pairedComp ); |
| 856 | |
| 857 | foundCompsInTLS = true; |
| 858 | //qDebug() << _imp->nodeInstance->getScriptName_mt_safe().c_str() << " didn't specify any needed components via getClipComponents for clip " << getName().c_str(); |
| 859 | } else { |
| 860 | comp = found->second.front(); |
| 861 | foundCompsInTLS = true; |
| 862 | } |
| 863 | } |
| 864 | } |
| 865 |
nothing calls this directly
no test coverage detected