diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-11 15:54:34 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-04-11 15:54:34 +0200 |
commit | 00d7d4141614ef295d8bbfeece0e9dc11152a6ae (patch) | |
tree | ca6825ef236a483404c05973974d5df5b6a34ce0 /src/InputReader.h | |
parent | a1bd2965c58806dd9c2d0323b1f97deeff2f048f (diff) | |
parent | 9a1f5fa40020247ed25fbe553d2ce71fa53d9e95 (diff) | |
download | dabmod-00d7d4141614ef295d8bbfeece0e9dc11152a6ae.tar.gz dabmod-00d7d4141614ef295d8bbfeece0e9dc11152a6ae.tar.bz2 dabmod-00d7d4141614ef295d8bbfeece0e9dc11152a6ae.zip |
Merge branch 'next' into easydabv3
Diffstat (limited to 'src/InputReader.h')
-rw-r--r-- | src/InputReader.h | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/InputReader.h b/src/InputReader.h index d229417..98eab2b 100644 --- a/src/InputReader.h +++ b/src/InputReader.h @@ -41,6 +41,7 @@ #if defined(HAVE_ZEROMQ) # include "zmq.hpp" # include "ThreadsafeQueue.h" +# include "RemoteControl.h" #endif #include "Log.h" #include "Socket.h" @@ -158,10 +159,10 @@ struct zmq_input_overflow : public std::exception #if defined(HAVE_ZEROMQ) /* A ZeroMQ input. See www.zeromq.org for more info */ -class InputZeroMQReader : public InputReader +class InputZeroMQReader : public InputReader, public RemoteControllable { public: - InputZeroMQReader() = default; + InputZeroMQReader(); InputZeroMQReader(const InputZeroMQReader& other) = delete; InputZeroMQReader& operator=(const InputZeroMQReader& other) = delete; ~InputZeroMQReader(); @@ -170,12 +171,24 @@ class InputZeroMQReader : public InputReader virtual int GetNextFrame(void* buffer) override; virtual std::string GetPrintableInfo() const override; + /* Base function to set parameters. */ + virtual void set_parameter( + const std::string& parameter, + const std::string& value) override; + + /* Getting a parameter always returns a string. */ + virtual const std::string get_parameter( + const std::string& parameter) const override; + private: std::atomic<bool> m_running = ATOMIC_VAR_INIT(false); std::string m_uri; size_t m_max_queued_frames = 0; ThreadsafeQueue<std::vector<uint8_t> > m_in_messages; + mutable std::mutex m_last_in_messages_size_mutex; + size_t m_last_in_messages_size = 0; + void RecvProcess(void); zmq::context_t m_zmqcontext; // is thread-safe |