datarhei-dragonfork-core/config
Zac Gaetano 9d38e9ccdb feat(webrtc): add app/webrtc subsystem + lifecycle hooks
Introduces the subsystem layer that sits alongside api.API and wires
the M1 core/webrtc primitives into the per-process restream lifecycle.

app/webrtc/subsystem.go:
  - Subsystem struct holding the global WebRTC config, core PeerFactory,
    per-process stream map, and logger
  - New(config.DataWebRTC, logger) constructor
  - Enabled(), Hooks(), Close(), lookup() methods

app/webrtc/lifecycle.go:
  - onProcessStart: allocates an adjacent UDP port pair, binds two
    Pion Sources (video on V, audio on V+1), registers them under the
    process id, and returns the two RTP output legs to append to the
    FFmpeg command.
  - onProcessStop: tears down the pair.
  - allocAdjacentPair: retries up to 10 times to find a free (V, V+1)
    pair since the kernel's ephemeral picker can hand us an odd port.
  - splitRTPLegs: converts BuildArgs' flat []string into two ConfigIO
    entries by splitting on the second -map token.

core/webrtc/peer.go + forward.go:
  - Adds PeerFactory.CreatePeerFromSources for the M2 two-source
    forwarding mode (video and audio on separate UDP ports, no
    payload-type sniffing). Leaves CreatePeer intact for the M1 PoC.
  - Adds forwardRTPSplit companion goroutine.

config/data.go:
  - Promote anonymous WebRTC struct to named type DataWebRTC so
    app/webrtc can accept it by value.
2026-04-17 10:02:00 -04:00
..
copy Fix proper version handling for uploading a new config 2022-10-10 16:19:45 +02:00
store Fix default search paths for config file 2023-09-07 16:23:15 +02:00
v1 Fix tests 2023-02-21 12:57:33 +01:00
v2 Fix tests 2023-02-21 12:57:33 +01:00
value Fix parsing S3 storage definition from environment variable 2023-04-13 12:19:20 +02:00
vars Add tests 2023-01-24 13:40:36 +01:00
config.go feat(config): add webrtc global config block 2026-04-17 09:51:02 -04:00
config_test.go Fix tests 2023-02-21 12:57:33 +01:00
data.go feat(webrtc): add app/webrtc subsystem + lifecycle hooks 2026-04-17 10:02:00 -04:00
data_test.go Use abstract filesystem for stores 2023-02-01 16:09:20 +01:00