Introducing multiple levels of Source Failure

This allows Mixer manager to deal with failed sources with the appropriate action: try to repair, leave for user to recreate, or delete.
This commit is contained in:
Bruno Herbelin
2023-03-22 22:50:08 +01:00
parent 9b4ef00278
commit f91522fc14
18 changed files with 159 additions and 127 deletions

View File

@@ -113,9 +113,9 @@ Session *SessionSource::detach()
return giveaway;
}
bool SessionSource::failed() const
Source::Failure SessionSource::failed() const
{
return failed_;
return failed_ ? FAIL_CRITICAL : FAIL_NONE;
}
uint SessionSource::texture() const
@@ -149,15 +149,9 @@ void SessionSource::update(float dt)
timer_ += guint64(dt * 1000.f) * GST_USECOND;
}
// delete source which failed
if ( !session_->failedSources().empty() ) {
Source *failure = *(session_->failedSources().cbegin());
Log::Info("Source '%s' deleted from Child Session %s.", failure->name().c_str(), std::to_string(session_->id()).c_str());
session_->deleteSource( failure );
// fail session if all sources failed
if ( session_->size() < 1)
failed_ = true;
}
// fail session if all its sources failed
if ( session_->failedSources().size() == session_->size() )
failed_ = true;
}