summaryrefslogtreecommitdiffstats
path: root/src/FrameMultiplexer.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-06 11:35:35 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2017-01-06 11:35:35 +0100
commit3633bcc99aedda5d9ea36c143fa339139c763d3e (patch)
tree6c296bee8cfb6aabb292fe6fc040708c7e4d2e7a /src/FrameMultiplexer.cpp
parent67c82c97dfcfc68d4bd71f5773d21c34c8733c83 (diff)
downloaddabmod-3633bcc99aedda5d9ea36c143fa339139c763d3e.tar.gz
dabmod-3633bcc99aedda5d9ea36c143fa339139c763d3e.tar.bz2
dabmod-3633bcc99aedda5d9ea36c143fa339139c763d3e.zip
Replace EDI-to-ETI converter with a dedicated EDI source
Diffstat (limited to 'src/FrameMultiplexer.cpp')
-rw-r--r--src/FrameMultiplexer.cpp24
1 files changed, 7 insertions, 17 deletions
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<float> complexf;
FrameMultiplexer::FrameMultiplexer(
- size_t framesize,
- const std::vector<std::shared_ptr<SubchannelSource> >& 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<Buffer*> dataIn, Buffer* dataOut)
@@ -81,12 +69,14 @@ int FrameMultiplexer::process(std::vector<Buffer*> 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(