Added mechanisms to detect when a source failed, and to remove it if its

the case.
This commit is contained in:
brunoherbelin
2020-05-10 17:45:37 +02:00
parent 80b86e8b37
commit 1b8e3accea
5 changed files with 46 additions and 10 deletions

View File

@@ -28,6 +28,9 @@ public:
inline std::string name () const { return name_; }
inline const char *initials() const { return initials_; }
// an overlay can be displayed on top of the source
virtual void setOverlayVisible(bool on);
// get handle on the node used to manipulate the source in a view
inline Group *group(View::Mode m) const { return groups_.at(m); }
inline Node *node(View::Mode m) const { return static_cast<Node*>(groups_.at(m)); }
@@ -44,12 +47,12 @@ public:
// every Source shall be rendered before draw
virtual void render() = 0;
// an overlay can be displayed on top of the source
virtual void setOverlayVisible(bool on);
// accept all kind of visitors
virtual void accept (Visitor& v);
// informs if the source failed (and might have to be deleted)
virtual bool failed() const { return false; }
protected:
// name
std::string name_;
@@ -112,9 +115,10 @@ public:
~MediaSource();
// implementation of source API
FrameBuffer *frame() const;
void render();
void accept (Visitor& v);
FrameBuffer *frame() const override;
void render() override;
void accept (Visitor& v) override;
bool failed() const override;
// Media specific interface
void setPath(const std::string &p);