Modified metadata interface to be tag independent, added JSON api.

This commit is contained in:
frafall 2017-11-30 11:07:23 +01:00
parent 67083975b0
commit ce17b0010a
7 changed files with 116 additions and 33 deletions

View file

@ -83,15 +83,12 @@ public:
virtual const std::string& getId() const;
virtual const SampleFormat& getSampleFormat() const;
std::shared_ptr<msg::StreamTags> getMeta() const;
void setMeta(json j);
virtual ReaderState getState() const;
virtual json toJson() const;
//const msg::StreamTags *getMeta()
std::shared_ptr<msg::StreamTags> getMeta() const
{
return meta_;
}
protected:
std::condition_variable cv_;
@ -99,6 +96,7 @@ protected:
std::thread thread_;
std::atomic<bool> active_;
virtual void worker() = 0;
virtual bool sleep(int32_t ms);
void setState(const ReaderState& newState);
@ -112,8 +110,6 @@ protected:
std::unique_ptr<Encoder> encoder_;
std::string name_;
ReaderState state_;
// Stream metadata
std::shared_ptr<msg::StreamTags> meta_;
};