diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-07-17 11:22:25 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2015-07-17 11:22:25 +0200 |
commit | bdcf14ca3a83675cfc56f8656e7f7a5ea934ba3a (patch) | |
tree | 53324537bd48256882cdd25e2d9c6c7003b47fbc /src/DabMultiplexer.cpp | |
parent | 5eb98cbc51135264ad0b82e0ba790df17f1d70c6 (diff) | |
download | dabmux-bdcf14ca3a83675cfc56f8656e7f7a5ea934ba3a.tar.gz dabmux-bdcf14ca3a83675cfc56f8656e7f7a5ea934ba3a.tar.bz2 dabmux-bdcf14ca3a83675cfc56f8656e7f7a5ea934ba3a.zip |
EDI: add options, fix AF sequence, revision
Diffstat (limited to 'src/DabMultiplexer.cpp')
-rw-r--r-- | src/DabMultiplexer.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/src/DabMultiplexer.cpp b/src/DabMultiplexer.cpp index 4ca93aa..a894621 100644 --- a/src/DabMultiplexer.cpp +++ b/src/DabMultiplexer.cpp @@ -157,7 +157,7 @@ void DabMultiplexer::set_edi_config(const edi_configuration_t& new_edi_conf) edi_afPacketiser = afPacketiser; // The AF Packet will be protected with reed-solomon and split in fragments - PFT pft(207, 3, edi_conf); + PFT pft(edi_conf); edi_pft = pft; #endif } @@ -419,7 +419,9 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu // The above Tag Items will be assembled into a TAG Packet TagPacket edi_tagpacket; - edi_tagDETI.atstf = 0; // TODO add ATST support + edi_tagDETI.atstf = 1; + edi_tagDETI.utco = 0; + edi_tagDETI.seconds = 0; date = getDabTime(); @@ -1698,6 +1700,8 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu tist->TIST = htonl(0xffffff) | 0xff; } + edi_tagDETI.tsta = tist->TIST; + timestamp += 3 << 17; if (timestamp > 0xf9ffff) { @@ -1738,9 +1742,8 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu edi_tagpacket.tag_items.push_back(&edi_tagStarPtr); edi_tagpacket.tag_items.push_back(&edi_tagDETI); - list<TagESTn>::iterator tag; - for (tag = edi_subchannels.begin(); tag != edi_subchannels.end(); ++tag) { - edi_tagpacket.tag_items.push_back(&(*tag)); + for (auto& tag : edi_subchannels) { + edi_tagpacket.tag_items.push_back(&tag); } // Assemble into one AF Packet @@ -1752,24 +1755,20 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu edi_pft.Assemble(edi_afpacket); // Send over ethernet - vector< vector<uint8_t> >::iterator edi_frag; - for (edi_frag = edi_fragments.begin(); - edi_frag != edi_fragments.end(); - ++edi_frag) { - + for (const auto& edi_frag : edi_fragments) { UdpPacket udppacket; InetAddress& addr = udppacket.getAddress(); addr.setAddress(edi_conf.dest_addr.c_str()); addr.setPort(edi_conf.dest_port); - udppacket.addData(&(edi_frag->front()), edi_frag->size()); + udppacket.addData(&(edi_frag.front()), edi_frag.size()); edi_output.send(udppacket); if (edi_conf.dump) { std::ostream_iterator<uint8_t> debug_iterator(edi_debug_file); - std::copy(edi_frag->begin(), edi_frag->end(), debug_iterator); + std::copy(edi_frag.begin(), edi_frag.end(), debug_iterator); } } @@ -1790,11 +1789,11 @@ void DabMultiplexer::mux_frame(std::vector<boost::shared_ptr<DabOutput> >& outpu udppacket.addData(&(edi_afpacket.front()), edi_afpacket.size()); edi_output.send(udppacket); - } - if (edi_conf.dump) { - std::ostream_iterator<uint8_t> debug_iterator(edi_debug_file); - std::copy(edi_afpacket.begin(), edi_afpacket.end(), debug_iterator); + if (edi_conf.dump) { + std::ostream_iterator<uint8_t> debug_iterator(edi_debug_file); + std::copy(edi_afpacket.begin(), edi_afpacket.end(), debug_iterator); + } } } #endif // HAVE_OUTPUT_EDI |