diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-01-24 21:49:37 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-01-24 21:49:37 +0100 |
commit | 713a5bc97a02e79b8e53dc96d64817f7f34ce311 (patch) | |
tree | 50fc56be4e43955ed4eba331bb3fa4790ce42f53 /src/input/Udp.h | |
parent | a7c82da68b1adc66e9ea8f4db9b1bef6c2bfd9e2 (diff) | |
download | dabmux-713a5bc97a02e79b8e53dc96d64817f7f34ce311.tar.gz dabmux-713a5bc97a02e79b8e53dc96d64817f7f34ce311.tar.bz2 dabmux-713a5bc97a02e79b8e53dc96d64817f7f34ce311.zip |
Add experimental untested STI input for AVT encoders
Diffstat (limited to 'src/input/Udp.h')
-rw-r--r-- | src/input/Udp.h | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/src/input/Udp.h b/src/input/Udp.h index 379dbf3..dc01486 100644 --- a/src/input/Udp.h +++ b/src/input/Udp.h @@ -2,7 +2,7 @@ Copyright (C) 2009 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://www.opendigitalradio.org @@ -28,11 +28,16 @@ #include <string> #include <vector> +#include <deque> +#include <boost/thread.hpp> #include "input/inputs.h" #include "UdpSocket.h" namespace Inputs { +/* A Udp input that takes incoming datagrams, concatenates them + * together and gives them back. + */ class Udp : public InputBase { public: virtual int open(const std::string& name); @@ -40,13 +45,35 @@ class Udp : public InputBase { virtual int setBitrate(int bitrate); virtual int close(); - private: + protected: UdpSocket m_sock; + std::string m_name; + + void openUdpSocket(const std::string& endpoint); + private: // The content of the UDP packets gets written into the // buffer, and the UDP packet boundaries disappear there. std::vector<uint8_t> m_buffer; }; +/* An input for STI-D(LI) carried in STI(PI, X) inside RTP inside UDP. + * Reorders incoming datagrams which must contain an RTP header and valid + * STI-D data. + * + * This is intended to be compatible with encoders from AVT. + */ +class Sti_d_Rtp : public Udp { + using vec_u8 = std::vector<uint8_t>; + + public: + virtual int open(const std::string& name); + virtual int readFrame(uint8_t* buffer, size_t size); + + private: + void receive_packet(void); + std::deque<vec_u8> m_queue; +}; + }; |