mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-17 21:29:59 +01:00
Add possibility of Render Loopback source to replay
This commit is contained in:
@@ -117,7 +117,7 @@ void RenderSource::update(float dt)
|
||||
|
||||
if (!paused_ && session_ && rendered_output_) {
|
||||
|
||||
if (provenance_ == RENDER_EXCLUSIVE) {
|
||||
if (provenance_ == RENDER_EXCLUSIVE || reset_) {
|
||||
// temporarily exclude this RenderSource from the rendering
|
||||
groups_[View::RENDERING]->visible_ = false;
|
||||
// simulate a rendering of the session in a framebuffer
|
||||
@@ -128,6 +128,8 @@ void RenderSource::update(float dt)
|
||||
rendered_output_->end();
|
||||
// restore this RenderSource visibility
|
||||
groups_[View::RENDERING]->visible_ = true;
|
||||
// done reset
|
||||
reset_ = false;
|
||||
}
|
||||
// blit session frame to output
|
||||
else if (!session_->frame()->blit(rendered_output_))
|
||||
@@ -152,6 +154,12 @@ void RenderSource::play (bool on)
|
||||
paused_ = !on;
|
||||
}
|
||||
|
||||
void RenderSource::replay ()
|
||||
{
|
||||
// request next frame to reset
|
||||
reset_ = true;
|
||||
}
|
||||
|
||||
glm::vec3 RenderSource::resolution() const
|
||||
{
|
||||
if (rendered_output_ != nullptr)
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
void update (float dt) override;
|
||||
bool playing () const override { return !paused_; }
|
||||
void play (bool) override;
|
||||
void replay () override {}
|
||||
void replay () override;
|
||||
bool playable () const override { return true; }
|
||||
guint64 playtime () const override { return runtime_; }
|
||||
Failure failed () const override;
|
||||
@@ -50,6 +50,7 @@ protected:
|
||||
|
||||
// control
|
||||
bool paused_;
|
||||
bool reset_;
|
||||
RenderSourceProvenance provenance_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user