From 3633bcc99aedda5d9ea36c143fa339139c763d3e Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 6 Jan 2017 11:35:35 +0100 Subject: Replace EDI-to-ETI converter with a dedicated EDI source --- src/FrameMultiplexer.cpp | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'src/FrameMultiplexer.cpp') diff --git a/src/FrameMultiplexer.cpp b/src/FrameMultiplexer.cpp index c8ee299..d16ee44 100644 --- a/src/FrameMultiplexer.cpp +++ b/src/FrameMultiplexer.cpp @@ -2,7 +2,7 @@ Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2016 + Copyright (C) 2017 Matthias P. Braendli, matthias.braendli@mpb.li http://opendigitalradio.org @@ -37,24 +37,12 @@ typedef std::complex complexf; FrameMultiplexer::FrameMultiplexer( - size_t framesize, - const std::vector >& subchannels) : + const EtiSource& etiSource) : ModMux(), - d_frameSize(framesize), - mySubchannels(subchannels) + m_etiSource(etiSource) { - PDEBUG("FrameMultiplexer::FrameMultiplexer(%zu) @ %p\n", framesize, this); - -} - - -FrameMultiplexer::~FrameMultiplexer() -{ - PDEBUG("FrameMultiplexer::~FrameMultiplexer() @ %p\n", this); - } - // dataIn[0] -> PRBS // dataIn[1+] -> subchannels int FrameMultiplexer::process(std::vector dataIn, Buffer* dataOut) @@ -81,12 +69,14 @@ int FrameMultiplexer::process(std::vector dataIn, Buffer* dataOut) // Write PRBS memcpy(out, (*in)->getData(), (*in)->getLength()); ++in; + // Write subchannel - if (mySubchannels.size() != dataIn.size() - 1) { + const auto subchannels = m_etiSource.getSubchannels(); + if (subchannels.size() != dataIn.size() - 1) { throw std::out_of_range( "FrameMultiplexer detected subchannel size change!"); } - auto subchannel = mySubchannels.begin(); + auto subchannel = subchannels.begin(); while (in != dataIn.end()) { if ((*subchannel)->framesizeCu() * 8 != (*in)->getLength()) { throw std::out_of_range( -- cgit v1.2.3