Files
Aiden 6b0638336a
All checks were successful
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Successful in 2m47s
CI / Windows Release Package (push) Successful in 2m53s
Phase 7 step 1
2026-05-11 20:39:01 +10:00

44 lines
1.0 KiB
C++

#pragma once
#include <string>
enum class VideoBackendLifecycleState
{
Uninitialized,
Discovering,
Discovered,
Configuring,
Configured,
Prerolling,
Running,
Degraded,
Stopping,
Stopped,
Failed
};
struct VideoBackendLifecycleTransition
{
VideoBackendLifecycleState previous = VideoBackendLifecycleState::Uninitialized;
VideoBackendLifecycleState current = VideoBackendLifecycleState::Uninitialized;
bool accepted = false;
std::string reason;
std::string errorMessage;
};
class VideoBackendLifecycle
{
public:
VideoBackendLifecycleState State() const;
const std::string& FailureReason() const;
VideoBackendLifecycleTransition TransitionTo(VideoBackendLifecycleState next, const std::string& reason);
VideoBackendLifecycleTransition Fail(const std::string& reason);
static bool CanTransition(VideoBackendLifecycleState current, VideoBackendLifecycleState next);
static const char* StateName(VideoBackendLifecycleState state);
private:
VideoBackendLifecycleState mState = VideoBackendLifecycleState::Uninitialized;
std::string mFailureReason;
};