http
This commit is contained in:
@@ -47,6 +47,8 @@ Included now:
|
||||
- small JSON writer for future HTTP/WebSocket payloads
|
||||
- JSON serialization for cadence telemetry snapshots
|
||||
- background logging with `log`, `warning`, and `error` levels
|
||||
- local HTTP control server matching the OpenAPI route surface
|
||||
- startup config provider for `config/runtime-host.json`
|
||||
- compact telemetry
|
||||
- non-GL frame-exchange tests
|
||||
|
||||
@@ -101,12 +103,53 @@ build\vs2022-x64-debug\Debug\RenderCadenceCompositor.exe --shader solid-color
|
||||
|
||||
Use `--no-shader` to keep the simple motion fallback only.
|
||||
|
||||
## Startup Config
|
||||
|
||||
On startup the app loads `config/runtime-host.json` through `AppConfigProvider`, then applies explicit CLI overrides.
|
||||
|
||||
Currently consumed fields:
|
||||
|
||||
- `serverPort`
|
||||
- `shaderLibrary`
|
||||
- `oscBindAddress`
|
||||
- `oscPort`
|
||||
- `oscSmoothing`
|
||||
- `inputVideoFormat`
|
||||
- `inputFrameRate`
|
||||
- `outputVideoFormat`
|
||||
- `outputFrameRate`
|
||||
- `autoReload`
|
||||
- `maxTemporalHistoryFrames`
|
||||
- `previewFps`
|
||||
- `enableExternalKeying`
|
||||
|
||||
The loaded config is treated as a read-only startup snapshot. Subsystems that need config should receive this snapshot or a narrowed config struct from app orchestration; they should not reload files independently.
|
||||
|
||||
Supported CLI overrides:
|
||||
|
||||
- `--shader <shader-id>`
|
||||
- `--no-shader`
|
||||
- `--port <port>`
|
||||
|
||||
## Expected Telemetry
|
||||
|
||||
Startup, shutdown, shader-build, and render-thread event messages are written through the app logger. Telemetry is intentionally separate and remains a compact once-per-second cadence line.
|
||||
|
||||
The logger writes to the console, `OutputDebugStringA`, and `logs/render-cadence-compositor.log` by default. Render-thread log calls use the non-blocking path so diagnostics do not become cadence blockers.
|
||||
|
||||
## HTTP Control Server
|
||||
|
||||
The app starts a local HTTP control server on `http://127.0.0.1:8080` by default, searching nearby ports if that one is busy.
|
||||
|
||||
Current endpoints:
|
||||
|
||||
- `GET /api/state`: returns an OpenAPI-shaped state scaffold with cadence telemetry under `performance.cadence`
|
||||
- `GET /docs/openapi.yaml` and `GET /openapi.yaml`: serves the OpenAPI document
|
||||
- `GET /docs`: serves Swagger UI
|
||||
- OpenAPI POST routes are present but return `{ "ok": false, "error": "Endpoint is not implemented in RenderCadenceCompositor yet." }`
|
||||
|
||||
The HTTP server runs on its own thread. It samples/copies telemetry through callbacks and does not call render work or DeckLink scheduling.
|
||||
|
||||
The app prints one line per second:
|
||||
|
||||
```text
|
||||
@@ -191,10 +234,12 @@ This app keeps the same core behavior but splits it into modules that can grow:
|
||||
- `frames/`: system-memory handoff
|
||||
- `platform/`: COM/Win32/hidden GL context support
|
||||
- `render/`: cadence, simple rendering, PBO readback
|
||||
- `control/`: local HTTP API edge
|
||||
- `json/`: compact JSON serialization helpers
|
||||
- `video/`: DeckLink output wrapper and scheduling thread
|
||||
- `telemetry/`: cadence telemetry
|
||||
- `app/`: startup/shutdown orchestration
|
||||
- `app/AppConfigProvider`: startup config loading and CLI overrides
|
||||
|
||||
## Next Porting Steps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user