From 0eac34529bb2af1d295bc03e6ef4d5ec73c40151 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Mon, 1 Jun 2026 14:58:58 -0400 Subject: [PATCH] feat(deltacast): wire source_config.port/board into capture start Parse the recorder's SOURCE_CONFIG JSON in the bootstrap and pass the deltacast capture channel (`port`) and optional `board` into captureManager.start(), so a recorder can select which of the board's 8 channels to capture. Co-Authored-By: Claude Opus 4.8 --- services/capture/src/index.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/services/capture/src/index.js b/services/capture/src/index.js index 678e073..942f97c 100644 --- a/services/capture/src/index.js +++ b/services/capture/src/index.js @@ -63,6 +63,13 @@ async function bootstrapAutoStart() { const streamKey = envOpt('STREAM_KEY'); const sourceUrl = envOpt('SOURCE_URL'); const device = envInt('DEVICE_INDEX'); + // SOURCE_CONFIG is the recorder's source_config JSON (set by recorders.js). + // For deltacast it carries the capture channel (`port`) and optional `board`. + let sourceConfig = {}; + try { sourceConfig = JSON.parse(process.env.SOURCE_CONFIG || '{}') || {}; } + catch (e) { console.warn('[bootstrap] bad SOURCE_CONFIG JSON:', e.message); } + const port = Number.isInteger(sourceConfig.port) ? sourceConfig.port : undefined; + const board = Number.isInteger(sourceConfig.board) ? sourceConfig.board : undefined; console.log(`[bootstrap] starting ${sourceType} ingest (listen=${listen} port=${listenPort || 'n/a'})...`); try { @@ -72,6 +79,8 @@ async function bootstrapAutoStart() { binId: envOpt('BIN_ID') || null, clipName, device, + port, + board, sourceType, sourceUrl, listen,