Plan recording worker wake decisions

This commit is contained in:
2026-06-05 07:07:28 +02:00
parent c50ea14a2a
commit 942c053c19
8 changed files with 94 additions and 13 deletions

View File

@@ -29,6 +29,13 @@ struct RecordingExportPlan {
int progress_total = 0;
};
struct RecordingWorkerIterationPlan {
bool continue_running = true;
bool encode_frame = false;
bool clear_dirty_stroke = false;
bool update_frame_label = false;
};
class RecordingServices {
public:
virtual ~RecordingServices() = default;
@@ -77,6 +84,20 @@ public:
};
}
[[nodiscard]] constexpr RecordingWorkerIterationPlan plan_recording_worker_iteration(
bool is_running_after_wake,
bool has_encoder,
bool has_canvas_document) noexcept
{
const bool encode = is_running_after_wake && has_encoder && has_canvas_document;
return {
.continue_running = is_running_after_wake,
.encode_frame = encode,
.clear_dirty_stroke = encode,
.update_frame_label = encode,
};
}
[[nodiscard]] inline pp::foundation::Status execute_recording_start_action(
RecordingStartAction action,
RecordingServices& services)