/** @file * @author Edouard DUPIN * @copyright 2011, Edouard DUPIN, all right reserved * @license APACHE v2.0 (see license file) */ #include #include #include "debug.h" #include "debug.h" airtalgo::ChannelReorder::ChannelReorder() { } void airtalgo::ChannelReorder::configurationChange() { airtalgo::autoLogInOut("ChannelReorder (config)"); airtalgo::Algo::configurationChange(); if (m_input.getFormat() != m_output.getFormat()) { AIRTALGO_ERROR("can not support Format Change ..."); m_needProcess = false; } if (m_input.getFrequency() != m_output.getFrequency()) { AIRTALGO_ERROR("can not support frequency Change ..."); m_needProcess = false; } if (m_input.getMap() == m_output.getMap()) { // nothing to process... m_needProcess = false; AIRTALGO_INFO(" no need to convert ... " << m_input.getMap() << " ==> " << m_output.getMap()); return; } } bool airtalgo::ChannelReorder::process(std::chrono::system_clock::time_point& _time, void* _input, size_t _inputNbChunk, void*& _output, size_t& _outputNbChunk) { //airtalgo::autoLogInOut("ChannelReorder"); _outputNbChunk = _inputNbChunk; // chack if we need to process: if (m_needProcess == false) { _output = _input; return true; } if (_input == nullptr) { _output = &(m_outputData[0]); _outputNbChunk = 0; AIRTALGO_ERROR("null pointer input ... "); return false; } m_outputData.resize(_outputNbChunk*m_output.getMap().size()*m_formatSize); _output = &(m_outputData[0]); // real process: (only depend of data size): switch (m_output.getFormat()) { default: case format_int16: { AIRTALGO_INFO("convert " << m_input.getMap() << " ==> " << m_output.getMap()); int16_t* in = static_cast(_input); int16_t* out = static_cast(_output); for (size_t kkk=0; kkk " << m_output.getMap()); uint32_t* in = static_cast(_input); uint32_t* out = static_cast(_output); for (size_t kkk=0; kkk