summaryrefslogtreecommitdiffstats
path: root/lib/edi/STIWriter.hpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-10-01 15:16:59 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-10-01 15:16:59 +0200
commite0cf82871fe24348101a0b565ea309e074e3663b (patch)
tree3412b5b4da94a66ef56aeac2c4196a3ec50cb619 /lib/edi/STIWriter.hpp
parent5ea9d01de68fc9d0f4c6578d41b09bfe541ea20f (diff)
downloaddabmux-e0cf82871fe24348101a0b565ea309e074e3663b.tar.gz
dabmux-e0cf82871fe24348101a0b565ea309e074e3663b.tar.bz2
dabmux-e0cf82871fe24348101a0b565ea309e074e3663b.zip
Pull code from common f2a36aa
Diffstat (limited to 'lib/edi/STIWriter.hpp')
-rw-r--r--lib/edi/STIWriter.hpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/edi/STIWriter.hpp b/lib/edi/STIWriter.hpp
index 16cbfe8..fc08e97 100644
--- a/lib/edi/STIWriter.hpp
+++ b/lib/edi/STIWriter.hpp
@@ -23,6 +23,7 @@
#include "common.hpp"
#include "STIDecoder.hpp"
#include <cstdint>
+#include <functional>
#include <string>
#include <vector>
#include <list>
@@ -38,6 +39,9 @@ struct sti_frame_t {
class STIWriter : public STIDataCollector {
public:
+ // The callback gets called for every STI frame that gets assembled
+ STIWriter(std::function<void(sti_frame_t&&)>&& frame_callback);
+
// Tell the ETIWriter what EDI protocol we receive in *ptr.
// This is not part of the ETI data, but is used as check
virtual void update_protocol(
@@ -59,12 +63,8 @@ class STIWriter : public STIDataCollector {
virtual void update_odr_version(const odr_version_data& data);
virtual void assemble(void);
-
- // Return the assembled frame or an empty frame if not ready
- sti_frame_t getFrame();
-
private:
- void reinit(void);
+ std::function<void(sti_frame_t&&)> m_frame_callback;
bool m_proto_valid = false;
@@ -84,7 +84,6 @@ class STIWriter : public STIDataCollector {
audio_level_data m_audio_levels;
odr_version_data m_version_data;
- sti_frame_t m_stiFrame;
};
}