Mercurial > hg > vamp-plugin-sdk
comparison src/vamp-hostsdk/PluginInputDomainAdapter.cpp @ 283:6c9f10b8a53a
* Add skeleton
author | cannam |
---|---|
date | Thu, 23 Apr 2009 08:59:24 +0000 |
parents | 4454843ff384 |
children | 283e15f6e548 |
comparison
equal
deleted
inserted
replaced
282:e0b7a35ea18e | 283:6c9f10b8a53a |
---|---|
220 | 220 |
221 return m_plugin->initialise(channels, stepSize, blockSize); | 221 return m_plugin->initialise(channels, stepSize, blockSize); |
222 } | 222 } |
223 | 223 |
224 if (blockSize < 2) { | 224 if (blockSize < 2) { |
225 std::cerr << "ERROR: Vamp::HostExt::PluginInputDomainAdapter::Impl::initialise: blocksize < 2 not supported" << std::endl; | 225 std::cerr << "ERROR: PluginInputDomainAdapter::initialise: blocksize < 2 not supported" << std::endl; |
226 return false; | 226 return false; |
227 } | 227 } |
228 | 228 |
229 if (blockSize & (blockSize-1)) { | 229 if (blockSize & (blockSize-1)) { |
230 std::cerr << "ERROR: Vamp::HostExt::PluginInputDomainAdapter::Impl::initialise: non-power-of-two\nblocksize " << blockSize << " not supported" << std::endl; | 230 std::cerr << "ERROR: PluginInputDomainAdapter::initialise: non-power-of-two\nblocksize " << blockSize << " not supported" << std::endl; |
231 return false; | 231 return false; |
232 } | 232 } |
233 | 233 |
234 if (m_channels > 0) { | 234 if (m_channels > 0) { |
235 for (int c = 0; c < m_channels; ++c) { | 235 for (int c = 0; c < m_channels; ++c) { |
309 size_t | 309 size_t |
310 PluginInputDomainAdapter::Impl::makeBlockSizeAcceptable(size_t blockSize) const | 310 PluginInputDomainAdapter::Impl::makeBlockSizeAcceptable(size_t blockSize) const |
311 { | 311 { |
312 if (blockSize < 2) { | 312 if (blockSize < 2) { |
313 | 313 |
314 std::cerr << "WARNING: Vamp::HostExt::PluginInputDomainAdapter::Impl::initialise: blocksize < 2 not" << std::endl | 314 std::cerr << "WARNING: PluginInputDomainAdapter::initialise: blocksize < 2 not" << std::endl |
315 << "supported, increasing from " << blockSize << " to 2" << std::endl; | 315 << "supported, increasing from " << blockSize << " to 2" << std::endl; |
316 blockSize = 2; | 316 blockSize = 2; |
317 | 317 |
318 } else if (blockSize & (blockSize-1)) { | 318 } else if (blockSize & (blockSize-1)) { |
319 | 319 |
338 | 338 |
339 if (blockSize - nearest > (nearest*2) - blockSize) { | 339 if (blockSize - nearest > (nearest*2) - blockSize) { |
340 nearest = nearest*2; | 340 nearest = nearest*2; |
341 } | 341 } |
342 | 342 |
343 std::cerr << "WARNING: Vamp::HostExt::PluginInputDomainAdapter::Impl::initialise: non-power-of-two\nblocksize " << blockSize << " not supported, using blocksize " << nearest << " instead" << std::endl; | 343 std::cerr << "WARNING: PluginInputDomainAdapter::initialise: non-power-of-two\nblocksize " << blockSize << " not supported, using blocksize " << nearest << " instead" << std::endl; |
344 blockSize = nearest; | 344 blockSize = nearest; |
345 | 345 |
346 #endif | 346 #endif |
347 } | 347 } |
348 | 348 |