# HG changeset patch # User Chris Cannam # Date 1539864896 -3600 # Node ID 73b3dd65e0b3f92ab73ad1caa7c8dfd589348815 # Parent d93e34684da74c8a0944fa1e8704fc4bc508bf45 Some debug + tidying diff -r d93e34684da7 -r 73b3dd65e0b3 transform/FeatureExtractionModelTransformer.cpp --- a/transform/FeatureExtractionModelTransformer.cpp Thu Oct 18 13:12:58 2018 +0100 +++ b/transform/FeatureExtractionModelTransformer.cpp Thu Oct 18 13:14:56 2018 +0100 @@ -40,6 +40,8 @@ #include +//#define DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN 1 + FeatureExtractionModelTransformer::FeatureExtractionModelTransformer(Input in, const Transform &transform) : ModelTransformer(in, transform), @@ -656,9 +658,11 @@ Transform primaryTransform = m_transforms[0]; while (!input->isReady() && !m_abandoned) { - cerr << "FeatureExtractionModelTransformer::run: Waiting for input model to be ready..." << endl; + SVDEBUG << "FeatureExtractionModelTransformer::run: Waiting for input model to be ready..." << endl; usleep(500000); } + SVDEBUG << "FeatureExtractionModelTransformer::run: Waited, ready = " + << input->isReady() << ", m_abandoned = " << m_abandoned << endl; if (m_abandoned) return; sv_samplerate_t sampleRate = input->getSampleRate(); @@ -678,6 +682,7 @@ bool frequencyDomain = (m_plugin->getInputDomain() == Vamp::Plugin::FrequencyDomain); + std::vector fftModels; if (frequencyDomain) { @@ -754,10 +759,12 @@ contextStart + contextDuration) break; } -// SVDEBUG << "FeatureExtractionModelTransformer::run: blockFrame " -// << blockFrame << ", endFrame " << endFrame << ", blockSize " -// << blockSize << endl; - +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::run: blockFrame " + << blockFrame << ", endFrame " << endFrame << ", blockSize " + << blockSize << endl; +#endif + int completion = int ((((blockFrame - contextStart) / stepSize) * 99) / (contextDuration / stepSize + 1)); @@ -777,7 +784,8 @@ buffers[ch][i*2] = 0.f; buffers[ch][i*2+1] = 0.f; } - } + } + error = fftModels[ch]->getError(); if (error != "") { SVCERR << "FeatureExtractionModelTransformer::run: Abandoning, error is " << error << endl; @@ -793,8 +801,10 @@ if (m_abandoned) break; Vamp::Plugin::FeatureSet features = m_plugin->process - (buffers, RealTime::frame2RealTime(blockFrame, sampleRate).toVampRealTime()); - + (buffers, + RealTime::frame2RealTime(blockFrame, sampleRate) + .toVampRealTime()); + if (m_abandoned) break; for (int j = 0; j < (int)m_outputNos.size(); ++j) { @@ -1122,8 +1132,10 @@ void FeatureExtractionModelTransformer::setCompletion(int n, int completion) { -// SVDEBUG << "FeatureExtractionModelTransformer::setCompletion(" -// << completion << ")" << endl; +#ifdef DEBUG_FEATURE_EXTRACTION_TRANSFORMER_RUN + SVDEBUG << "FeatureExtractionModelTransformer::setCompletion(" + << completion << ")" << endl; +#endif if (isOutput(n)) {