From aa020d5e3c9c88bc4611e271b3c2fff3958af59b Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 19 Feb 2015 22:00:21 +0100 Subject: [PATCH] [DEV] change channel reorder --- drain/ChannelReorder.cpp | 13 ++++++++++++- drain/Process.h | 10 ++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/drain/ChannelReorder.cpp b/drain/ChannelReorder.cpp index c169ea7..484bef1 100644 --- a/drain/ChannelReorder.cpp +++ b/drain/ChannelReorder.cpp @@ -104,7 +104,18 @@ bool drain::ChannelReorder::process(std::chrono::system_clock::time_point& _time break; default: case audio::format_int16: - { + if (m_output.getMap().size() == 1) { + DRAIN_VERBOSE("convert " << m_input.getMap() << " ==> " << m_output.getMap() << " format=" << int32_t(m_formatSize)); + int16_t* in = static_cast(_input); + int16_t* out = static_cast(_output); + for (size_t iii=0; iii<_outputNbChunk; ++iii) { + int32_t val = 0; + for (size_t jjj=0; jjj " << m_output.getMap() << " format=" << int32_t(m_formatSize)); int16_t* in = static_cast(_input); int16_t* out = static_cast(_output); diff --git a/drain/Process.h b/drain/Process.h index ee055a6..7b76417 100644 --- a/drain/Process.h +++ b/drain/Process.h @@ -102,6 +102,16 @@ namespace drain{ m_isConfigured = false; m_listAlgo.clear(); } + size_t size() { + return m_listAlgo.size(); + } + std::vector >::iterator begin() { + return m_listAlgo.begin(); + } + std::vector >::iterator end() { + return m_listAlgo.end(); + } + template void removeIfFirst() { if (m_listAlgo.size() > 0) { std::shared_ptr algoEP = std::dynamic_pointer_cast(m_listAlgo[0]);