diff options
| author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-07-11 10:42:09 +0200 |
|---|---|---|
| committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2025-07-11 10:42:09 +0200 |
| commit | 7e59a191cd2545a4b024c6cf78a4c7c6c1d4956e (patch) | |
| tree | 896a1705c3440042d7310900adba8dcb25c9a81d /src/Outputs.cpp | |
| parent | 228ec291a58869a19b368a536f3ea0fcd97a57b6 (diff) | |
| download | ODR-SourceCompanion-7e59a191cd2545a4b024c6cf78a4c7c6c1d4956e.tar.gz ODR-SourceCompanion-7e59a191cd2545a4b024c6cf78a4c7c6c1d4956e.tar.bz2 ODR-SourceCompanion-7e59a191cd2545a4b024c6cf78a4c7c6c1d4956e.zip | |
common: EDI per-output PFT config; allow setting TTL without UDP source
Diffstat (limited to 'src/Outputs.cpp')
| -rw-r--r-- | src/Outputs.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/Outputs.cpp b/src/Outputs.cpp index 5dd061c..7088bf1 100644 --- a/src/Outputs.cpp +++ b/src/Outputs.cpp @@ -1,6 +1,6 @@ /* ------------------------------------------------------------------ * Copyright (C) 2011 Martin Storsjo - * Copyright (C) 2020 Matthias P. Braendli + * Copyright (C) 2024 Matthias P. Braendli * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -153,29 +153,25 @@ void EDI::add_udp_destination(const std::string& host, unsigned int port) auto dest = make_shared<edi::udp_destination_t>(); dest->dest_addr = host; dest->dest_port = port; + dest->pft_settings.enable_pft = true; m_edi_conf.destinations.push_back(dest); - - // We cannot carry AF packets over UDP, because they would be too large. - m_edi_conf.enable_pft = true; } void EDI::add_tcp_destination(const std::string& host, unsigned int port) { auto dest = make_shared<edi::tcp_client_t>(); dest->dest_addr = host; - if (dest->dest_port != 0 and dest->dest_port != port) { - throw runtime_error("All EDI UDP outputs must be to the same destination port"); - } dest->dest_port = port; m_edi_conf.destinations.push_back(dest); - - m_edi_conf.dump = false; } void EDI::set_fec(int fec) { - m_edi_conf.enable_pft = true; - m_edi_conf.fec = fec; + for (auto& edi_dest : m_edi_conf.destinations) { + if (auto udp_dest = dynamic_pointer_cast<edi::udp_destination_t>(edi_dest)) { + udp_dest->pft_settings.fec = fec; + } + } } bool EDI::enabled() const |
