From 7bf5464fd231b1572493974a8cabde85eedae406 Mon Sep 17 00:00:00 2001 From: Aiden Date: Fri, 22 May 2026 15:06:26 +1000 Subject: [PATCH] reorganization --- CMakeLists.txt | 12 ++++++--- README.md | 7 +++-- docs/CURRENT_SYSTEM_ARCHITECTURE.md | 5 +++- src/RenderCadenceCompositor.cpp | 4 +-- src/app/AppConfig.h | 4 +-- src/app/RenderCadenceApp.h | 6 ++--- src/video/{ => core}/VideoIOEdges.h | 0 src/video/{ => core}/VideoIOFormat.cpp | 0 src/video/{ => core}/VideoIOFormat.h | 0 src/video/{ => core}/VideoIOTypes.h | 0 src/video/{ => core}/VideoOutputThread.h | 0 src/video/{ => decklink}/DeckLinkAPI_h.h | 0 src/video/{ => decklink}/DeckLinkAPI_i.c | 0 .../{ => decklink}/DeckLinkDisplayMode.cpp | 0 .../{ => decklink}/DeckLinkDisplayMode.h | 0 .../{ => decklink}/DeckLinkFrameTransfer.cpp | 0 .../{ => decklink}/DeckLinkFrameTransfer.h | 0 src/video/{ => decklink}/DeckLinkInput.cpp | 0 src/video/{ => decklink}/DeckLinkInput.h | 0 .../{ => decklink}/DeckLinkInputThread.h | 0 src/video/{ => decklink}/DeckLinkOutput.cpp | 0 src/video/{ => decklink}/DeckLinkOutput.h | 0 .../{ => decklink}/DeckLinkOutputThread.h | 0 src/video/{ => decklink}/DeckLinkSession.cpp | 0 src/video/{ => decklink}/DeckLinkSession.h | 0 .../{ => decklink}/DeckLinkVideoIOFormat.cpp | 0 .../{ => decklink}/DeckLinkVideoIOFormat.h | 0 src/video/{ => legacy}/VideoBackend.cpp | 0 src/video/{ => legacy}/VideoBackend.h | 0 .../{ => legacy}/VideoBackendLifecycle.cpp | 0 .../{ => legacy}/VideoBackendLifecycle.h | 0 .../OutputProductionController.cpp | 0 .../OutputProductionController.h | 0 .../{ => playout}/RenderCadenceController.cpp | 0 .../{ => playout}/RenderCadenceController.h | 0 src/video/{ => playout}/RenderOutputQueue.cpp | 0 src/video/{ => playout}/RenderOutputQueue.h | 0 .../{ => playout}/SystemOutputFramePool.cpp | 0 .../{ => playout}/SystemOutputFramePool.h | 0 src/video/{ => playout}/VideoPlayoutPolicy.h | 0 .../{ => playout}/VideoPlayoutScheduler.cpp | 0 .../{ => playout}/VideoPlayoutScheduler.h | 0 tests/CMakeLists.txt | 26 +++++++++---------- 43 files changed, 37 insertions(+), 27 deletions(-) rename src/video/{ => core}/VideoIOEdges.h (100%) rename src/video/{ => core}/VideoIOFormat.cpp (100%) rename src/video/{ => core}/VideoIOFormat.h (100%) rename src/video/{ => core}/VideoIOTypes.h (100%) rename src/video/{ => core}/VideoOutputThread.h (100%) rename src/video/{ => decklink}/DeckLinkAPI_h.h (100%) rename src/video/{ => decklink}/DeckLinkAPI_i.c (100%) rename src/video/{ => decklink}/DeckLinkDisplayMode.cpp (100%) rename src/video/{ => decklink}/DeckLinkDisplayMode.h (100%) rename src/video/{ => decklink}/DeckLinkFrameTransfer.cpp (100%) rename src/video/{ => decklink}/DeckLinkFrameTransfer.h (100%) rename src/video/{ => decklink}/DeckLinkInput.cpp (100%) rename src/video/{ => decklink}/DeckLinkInput.h (100%) rename src/video/{ => decklink}/DeckLinkInputThread.h (100%) rename src/video/{ => decklink}/DeckLinkOutput.cpp (100%) rename src/video/{ => decklink}/DeckLinkOutput.h (100%) rename src/video/{ => decklink}/DeckLinkOutputThread.h (100%) rename src/video/{ => decklink}/DeckLinkSession.cpp (100%) rename src/video/{ => decklink}/DeckLinkSession.h (100%) rename src/video/{ => decklink}/DeckLinkVideoIOFormat.cpp (100%) rename src/video/{ => decklink}/DeckLinkVideoIOFormat.h (100%) rename src/video/{ => legacy}/VideoBackend.cpp (100%) rename src/video/{ => legacy}/VideoBackend.h (100%) rename src/video/{ => legacy}/VideoBackendLifecycle.cpp (100%) rename src/video/{ => legacy}/VideoBackendLifecycle.h (100%) rename src/video/{ => playout}/OutputProductionController.cpp (100%) rename src/video/{ => playout}/OutputProductionController.h (100%) rename src/video/{ => playout}/RenderCadenceController.cpp (100%) rename src/video/{ => playout}/RenderCadenceController.h (100%) rename src/video/{ => playout}/RenderOutputQueue.cpp (100%) rename src/video/{ => playout}/RenderOutputQueue.h (100%) rename src/video/{ => playout}/SystemOutputFramePool.cpp (100%) rename src/video/{ => playout}/SystemOutputFramePool.h (100%) rename src/video/{ => playout}/VideoPlayoutPolicy.h (100%) rename src/video/{ => playout}/VideoPlayoutScheduler.cpp (100%) rename src/video/{ => playout}/VideoPlayoutScheduler.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b3c11f..185643e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,10 @@ set(VIDEO_SHADER_INCLUDE_DIRS "${SRC_DIR}/shader" "${SRC_DIR}/telemetry" "${SRC_DIR}/video" + "${SRC_DIR}/video/core" + "${SRC_DIR}/video/decklink" + "${SRC_DIR}/video/legacy" + "${SRC_DIR}/video/playout" ) function(video_shader_target_defaults target) @@ -121,8 +125,8 @@ set(MSDF_ATLAS_GEN_README_FILE "${MSDF_ATLAS_GEN_ROOT}/README.md") set(RENDER_CADENCE_APP_REQUIRED_FILES "${SRC_DIR}/RenderCadenceCompositor.cpp" - "${SRC_DIR}/video/DeckLinkAPI_i.c" - "${SRC_DIR}/video/DeckLinkAPI_h.h" + "${SRC_DIR}/video/decklink/DeckLinkAPI_i.c" + "${SRC_DIR}/video/decklink/DeckLinkAPI_h.h" ) video_shader_files_exist(RENDER_CADENCE_APP_MISSING_FILES ${RENDER_CADENCE_APP_REQUIRED_FILES}) @@ -138,8 +142,8 @@ else() "${SRC_DIR}/*.h" ) list(REMOVE_ITEM RENDER_CADENCE_APP_SOURCES - "${SRC_DIR}/video/VideoBackend.cpp" - "${SRC_DIR}/video/VideoBackend.h" + "${SRC_DIR}/video/legacy/VideoBackend.cpp" + "${SRC_DIR}/video/legacy/VideoBackend.h" ) add_executable(RenderCadenceCompositor ${RENDER_CADENCE_APP_SOURCES}) diff --git a/README.md b/README.md index b5bef49..56a8e74 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,10 @@ Native app internals are grouped by boundary: - `render/`: render thread, readback, runtime render scene, and shared-context shader program preparation. - `runtime/`: shader catalog support, layer model, Slang build bridge, font atlas build, and runtime-state persistence. - `shader/`: shader package parsing and Slang compilation helpers. -- `video/`: DeckLink input/output edges, format helpers, and scheduling. +- `video/core/`: backend-neutral video IO handoff contracts, formats, and output scheduling thread. +- `video/decklink/`: current DeckLink input/output backend. +- `video/playout/`: backend-adjacent playout policy, queues, frame pools, and scheduling helpers. +- `video/legacy/`: older backend pipeline pieces kept separate while the new edge model settles. ## Requirements @@ -281,7 +284,7 @@ If `SLANG_ROOT` or `MSDF_ATLAS_GEN_ROOT` is not set, the workflow falls back to - Audio. - Genlock. - Logs. -- Add more video I/O backends now that the DeckLink path is behind `videoio/`. +- Add more video I/O backends now that the DeckLink path is isolated under `src/video/decklink/`. - Support a separate sound shader `.slang` file in shader packages. (https://www.shadertoy.com/view/XsBXWt) - Add WebView2 for an embedded native control surface. - MSDF typography rasterisation diff --git a/docs/CURRENT_SYSTEM_ARCHITECTURE.md b/docs/CURRENT_SYSTEM_ARCHITECTURE.md index e2751ef..1b7e220 100644 --- a/docs/CURRENT_SYSTEM_ARCHITECTURE.md +++ b/docs/CURRENT_SYSTEM_ARCHITECTURE.md @@ -25,7 +25,10 @@ Primary source areas: - `src/render/thread`: render thread lifecycle, cadence loop, metrics, and runtime shader commit mailbox - `src/render/runtime`: render-thread-owned runtime shader scene, renderer, text texture upload cache, and shared-context shader prepare worker - `src/frames`: system-memory frame exchange -- `src/video`: generic video IO edge contracts, DeckLink input/output edges, and scheduling +- `src/video/core`: generic video IO edge contracts, formats, and output scheduling thread +- `src/video/decklink`: current DeckLink input/output backend +- `src/video/playout`: backend-adjacent playout policy, queues, frame pools, and scheduling helpers +- `src/video/legacy`: older backend pipeline pieces kept separate from the current app path - `src/runtime/catalog`: supported shader catalog and package filtering - `src/runtime/layers`: app-side runtime layer model, restore, reload, and render snapshot construction - `src/runtime/shader`: background Slang build bridge and prepared shader artifact types diff --git a/src/RenderCadenceCompositor.cpp b/src/RenderCadenceCompositor.cpp index b413590..dd2384a 100644 --- a/src/RenderCadenceCompositor.cpp +++ b/src/RenderCadenceCompositor.cpp @@ -5,8 +5,8 @@ #include "frames/SystemFrameExchange.h" #include "logging/Logger.h" #include "render/thread/RenderThread.h" -#include "video/DeckLinkInput.h" -#include "video/DeckLinkInputThread.h" +#include "video/decklink/DeckLinkInput.h" +#include "video/decklink/DeckLinkInputThread.h" #include "DeckLinkDisplayMode.h" #include "VideoIOFormat.h" diff --git a/src/app/AppConfig.h b/src/app/AppConfig.h index ebfc2a5..c886eb6 100644 --- a/src/app/AppConfig.h +++ b/src/app/AppConfig.h @@ -4,8 +4,8 @@ #include "../logging/Logger.h" #include "../preview/PreviewConfig.h" #include "../telemetry/TelemetryHealthMonitor.h" -#include "../video/DeckLinkOutput.h" -#include "../video/VideoOutputThread.h" +#include "DeckLinkOutput.h" +#include "VideoOutputThread.h" #include #include diff --git a/src/app/RenderCadenceApp.h b/src/app/RenderCadenceApp.h index fb09189..eed64f1 100644 --- a/src/app/RenderCadenceApp.h +++ b/src/app/RenderCadenceApp.h @@ -7,9 +7,9 @@ #include "../control/RuntimeStateJson.h" #include "../preview/PreviewWindowThread.h" #include "../telemetry/TelemetryHealthMonitor.h" -#include "../video/DeckLinkOutput.h" -#include "../video/VideoIOEdges.h" -#include "../video/VideoOutputThread.h" +#include "DeckLinkOutput.h" +#include "VideoIOEdges.h" +#include "VideoOutputThread.h" #include #include diff --git a/src/video/VideoIOEdges.h b/src/video/core/VideoIOEdges.h similarity index 100% rename from src/video/VideoIOEdges.h rename to src/video/core/VideoIOEdges.h diff --git a/src/video/VideoIOFormat.cpp b/src/video/core/VideoIOFormat.cpp similarity index 100% rename from src/video/VideoIOFormat.cpp rename to src/video/core/VideoIOFormat.cpp diff --git a/src/video/VideoIOFormat.h b/src/video/core/VideoIOFormat.h similarity index 100% rename from src/video/VideoIOFormat.h rename to src/video/core/VideoIOFormat.h diff --git a/src/video/VideoIOTypes.h b/src/video/core/VideoIOTypes.h similarity index 100% rename from src/video/VideoIOTypes.h rename to src/video/core/VideoIOTypes.h diff --git a/src/video/VideoOutputThread.h b/src/video/core/VideoOutputThread.h similarity index 100% rename from src/video/VideoOutputThread.h rename to src/video/core/VideoOutputThread.h diff --git a/src/video/DeckLinkAPI_h.h b/src/video/decklink/DeckLinkAPI_h.h similarity index 100% rename from src/video/DeckLinkAPI_h.h rename to src/video/decklink/DeckLinkAPI_h.h diff --git a/src/video/DeckLinkAPI_i.c b/src/video/decklink/DeckLinkAPI_i.c similarity index 100% rename from src/video/DeckLinkAPI_i.c rename to src/video/decklink/DeckLinkAPI_i.c diff --git a/src/video/DeckLinkDisplayMode.cpp b/src/video/decklink/DeckLinkDisplayMode.cpp similarity index 100% rename from src/video/DeckLinkDisplayMode.cpp rename to src/video/decklink/DeckLinkDisplayMode.cpp diff --git a/src/video/DeckLinkDisplayMode.h b/src/video/decklink/DeckLinkDisplayMode.h similarity index 100% rename from src/video/DeckLinkDisplayMode.h rename to src/video/decklink/DeckLinkDisplayMode.h diff --git a/src/video/DeckLinkFrameTransfer.cpp b/src/video/decklink/DeckLinkFrameTransfer.cpp similarity index 100% rename from src/video/DeckLinkFrameTransfer.cpp rename to src/video/decklink/DeckLinkFrameTransfer.cpp diff --git a/src/video/DeckLinkFrameTransfer.h b/src/video/decklink/DeckLinkFrameTransfer.h similarity index 100% rename from src/video/DeckLinkFrameTransfer.h rename to src/video/decklink/DeckLinkFrameTransfer.h diff --git a/src/video/DeckLinkInput.cpp b/src/video/decklink/DeckLinkInput.cpp similarity index 100% rename from src/video/DeckLinkInput.cpp rename to src/video/decklink/DeckLinkInput.cpp diff --git a/src/video/DeckLinkInput.h b/src/video/decklink/DeckLinkInput.h similarity index 100% rename from src/video/DeckLinkInput.h rename to src/video/decklink/DeckLinkInput.h diff --git a/src/video/DeckLinkInputThread.h b/src/video/decklink/DeckLinkInputThread.h similarity index 100% rename from src/video/DeckLinkInputThread.h rename to src/video/decklink/DeckLinkInputThread.h diff --git a/src/video/DeckLinkOutput.cpp b/src/video/decklink/DeckLinkOutput.cpp similarity index 100% rename from src/video/DeckLinkOutput.cpp rename to src/video/decklink/DeckLinkOutput.cpp diff --git a/src/video/DeckLinkOutput.h b/src/video/decklink/DeckLinkOutput.h similarity index 100% rename from src/video/DeckLinkOutput.h rename to src/video/decklink/DeckLinkOutput.h diff --git a/src/video/DeckLinkOutputThread.h b/src/video/decklink/DeckLinkOutputThread.h similarity index 100% rename from src/video/DeckLinkOutputThread.h rename to src/video/decklink/DeckLinkOutputThread.h diff --git a/src/video/DeckLinkSession.cpp b/src/video/decklink/DeckLinkSession.cpp similarity index 100% rename from src/video/DeckLinkSession.cpp rename to src/video/decklink/DeckLinkSession.cpp diff --git a/src/video/DeckLinkSession.h b/src/video/decklink/DeckLinkSession.h similarity index 100% rename from src/video/DeckLinkSession.h rename to src/video/decklink/DeckLinkSession.h diff --git a/src/video/DeckLinkVideoIOFormat.cpp b/src/video/decklink/DeckLinkVideoIOFormat.cpp similarity index 100% rename from src/video/DeckLinkVideoIOFormat.cpp rename to src/video/decklink/DeckLinkVideoIOFormat.cpp diff --git a/src/video/DeckLinkVideoIOFormat.h b/src/video/decklink/DeckLinkVideoIOFormat.h similarity index 100% rename from src/video/DeckLinkVideoIOFormat.h rename to src/video/decklink/DeckLinkVideoIOFormat.h diff --git a/src/video/VideoBackend.cpp b/src/video/legacy/VideoBackend.cpp similarity index 100% rename from src/video/VideoBackend.cpp rename to src/video/legacy/VideoBackend.cpp diff --git a/src/video/VideoBackend.h b/src/video/legacy/VideoBackend.h similarity index 100% rename from src/video/VideoBackend.h rename to src/video/legacy/VideoBackend.h diff --git a/src/video/VideoBackendLifecycle.cpp b/src/video/legacy/VideoBackendLifecycle.cpp similarity index 100% rename from src/video/VideoBackendLifecycle.cpp rename to src/video/legacy/VideoBackendLifecycle.cpp diff --git a/src/video/VideoBackendLifecycle.h b/src/video/legacy/VideoBackendLifecycle.h similarity index 100% rename from src/video/VideoBackendLifecycle.h rename to src/video/legacy/VideoBackendLifecycle.h diff --git a/src/video/OutputProductionController.cpp b/src/video/playout/OutputProductionController.cpp similarity index 100% rename from src/video/OutputProductionController.cpp rename to src/video/playout/OutputProductionController.cpp diff --git a/src/video/OutputProductionController.h b/src/video/playout/OutputProductionController.h similarity index 100% rename from src/video/OutputProductionController.h rename to src/video/playout/OutputProductionController.h diff --git a/src/video/RenderCadenceController.cpp b/src/video/playout/RenderCadenceController.cpp similarity index 100% rename from src/video/RenderCadenceController.cpp rename to src/video/playout/RenderCadenceController.cpp diff --git a/src/video/RenderCadenceController.h b/src/video/playout/RenderCadenceController.h similarity index 100% rename from src/video/RenderCadenceController.h rename to src/video/playout/RenderCadenceController.h diff --git a/src/video/RenderOutputQueue.cpp b/src/video/playout/RenderOutputQueue.cpp similarity index 100% rename from src/video/RenderOutputQueue.cpp rename to src/video/playout/RenderOutputQueue.cpp diff --git a/src/video/RenderOutputQueue.h b/src/video/playout/RenderOutputQueue.h similarity index 100% rename from src/video/RenderOutputQueue.h rename to src/video/playout/RenderOutputQueue.h diff --git a/src/video/SystemOutputFramePool.cpp b/src/video/playout/SystemOutputFramePool.cpp similarity index 100% rename from src/video/SystemOutputFramePool.cpp rename to src/video/playout/SystemOutputFramePool.cpp diff --git a/src/video/SystemOutputFramePool.h b/src/video/playout/SystemOutputFramePool.h similarity index 100% rename from src/video/SystemOutputFramePool.h rename to src/video/playout/SystemOutputFramePool.h diff --git a/src/video/VideoPlayoutPolicy.h b/src/video/playout/VideoPlayoutPolicy.h similarity index 100% rename from src/video/VideoPlayoutPolicy.h rename to src/video/playout/VideoPlayoutPolicy.h diff --git a/src/video/VideoPlayoutScheduler.cpp b/src/video/playout/VideoPlayoutScheduler.cpp similarity index 100% rename from src/video/VideoPlayoutScheduler.cpp rename to src/video/playout/VideoPlayoutScheduler.cpp diff --git a/src/video/VideoPlayoutScheduler.h b/src/video/playout/VideoPlayoutScheduler.h similarity index 100% rename from src/video/VideoPlayoutScheduler.h rename to src/video/playout/VideoPlayoutScheduler.h diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1ebdf33..f930b1b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -20,13 +20,13 @@ add_video_shader_test(RenderCadenceCompositorTelemetryTests add_video_shader_test(RenderCadenceCompositorFrameExchangeTests "${SRC_DIR}/frames/SystemFrameExchange.cpp" - "${SRC_DIR}/video/VideoIOFormat.cpp" + "${SRC_DIR}/video/core/VideoIOFormat.cpp" "${TEST_DIR}/RenderCadenceCompositorFrameExchangeTests.cpp" ) add_video_shader_test(RenderCadenceCompositorInputFrameMailboxTests "${SRC_DIR}/frames/InputFrameMailbox.cpp" - "${SRC_DIR}/video/VideoIOFormat.cpp" + "${SRC_DIR}/video/core/VideoIOFormat.cpp" "${TEST_DIR}/RenderCadenceCompositorInputFrameMailboxTests.cpp" ) @@ -128,49 +128,49 @@ add_video_shader_test(Std140BufferTests ) add_video_shader_test(VideoIOFormatTests - "${SRC_DIR}/video/DeckLinkVideoIOFormat.cpp" - "${SRC_DIR}/video/VideoIOFormat.cpp" + "${SRC_DIR}/video/decklink/DeckLinkVideoIOFormat.cpp" + "${SRC_DIR}/video/core/VideoIOFormat.cpp" "${TEST_DIR}/VideoIOFormatTests.cpp" ) add_video_shader_test(VideoPlayoutSchedulerTests - "${SRC_DIR}/video/VideoPlayoutScheduler.cpp" + "${SRC_DIR}/video/playout/VideoPlayoutScheduler.cpp" "${TEST_DIR}/VideoPlayoutSchedulerTests.cpp" ) add_video_shader_test(VideoOutputThreadTests - "${SRC_DIR}/video/VideoIOFormat.cpp" + "${SRC_DIR}/video/core/VideoIOFormat.cpp" "${TEST_DIR}/VideoOutputThreadTests.cpp" ) add_video_shader_test(OutputProductionControllerTests - "${SRC_DIR}/video/OutputProductionController.cpp" + "${SRC_DIR}/video/playout/OutputProductionController.cpp" "${TEST_DIR}/OutputProductionControllerTests.cpp" ) add_video_shader_test(RenderOutputQueueTests - "${SRC_DIR}/video/RenderOutputQueue.cpp" + "${SRC_DIR}/video/playout/RenderOutputQueue.cpp" "${TEST_DIR}/RenderOutputQueueTests.cpp" ) add_video_shader_test(RenderCadenceControllerTests - "${SRC_DIR}/video/RenderCadenceController.cpp" + "${SRC_DIR}/video/playout/RenderCadenceController.cpp" "${TEST_DIR}/RenderCadenceControllerTests.cpp" ) add_video_shader_test(SystemOutputFramePoolTests - "${SRC_DIR}/video/SystemOutputFramePool.cpp" - "${SRC_DIR}/video/VideoIOFormat.cpp" + "${SRC_DIR}/video/playout/SystemOutputFramePool.cpp" + "${SRC_DIR}/video/core/VideoIOFormat.cpp" "${TEST_DIR}/SystemOutputFramePoolTests.cpp" ) add_video_shader_test(VideoBackendLifecycleTests - "${SRC_DIR}/video/VideoBackendLifecycle.cpp" + "${SRC_DIR}/video/legacy/VideoBackendLifecycle.cpp" "${TEST_DIR}/VideoBackendLifecycleTests.cpp" ) add_video_shader_test(VideoIODeviceFakeTests - "${SRC_DIR}/video/VideoIOFormat.cpp" + "${SRC_DIR}/video/core/VideoIOFormat.cpp" "${TEST_DIR}/VideoIODeviceFakeTests.cpp" )