Migrate Mimir media bridge to RUDP

This commit is contained in:
Meta Vens 2026-06-16 18:08:40 +01:00
commit 4ed4ba190b
13 changed files with 771 additions and 36 deletions

View file

@ -0,0 +1,24 @@
using GameCult.Caching;
using MessagePack;
namespace Mimir.Runtime.Synchronization;
[CultDocument("mimir.cultmesh_media_frame", "mimir.cultmesh_media_frame.v1")]
[MessagePackObject]
public sealed record MimirCultMeshMediaFrameDocument(
[property: Key(0)]
[property: CultName]
string FrameId,
[property: Key(1)] string StreamId,
[property: Key(2)] long Sequence,
[property: Key(3)] string ProducedAtUtc,
[property: Key(4)] long TimestampNanoseconds,
[property: Key(5)] string PayloadKind,
[property: Key(6)] string Container,
[property: Key(7)] string VideoCodec,
[property: Key(8)] string AudioCodec,
[property: Key(9)] int PayloadBytes,
[property: Key(10)] byte[] Payload,
[property: Key(11)] string ProducerNode,
[property: Key(12)] string ClockDomainId,
[property: Key(13)] string[] Tags);

View file

@ -6,12 +6,14 @@ public enum MimirNetworkPayloadKind
RawAudioDebugWindow,
CompressedAudioProgramFeed,
CompressedVideoProgramFeed,
RawVideoDiagnosticWindow
RawVideoDiagnosticWindow,
MuxedAudioVideoProgramFeed
}
public enum MimirNetworkTransportKind
{
CultMeshTypedState,
CultMeshReliableUdpMedia,
LanUdpDatagrams,
SrtDiagnosticMedia,
WebRtcExperimental,
@ -68,6 +70,18 @@ public static class MimirNetworkTransportConfigurations
RejectionConditions: ["used-as-clock-authority", "used-for-local-hot-path"],
"Useful bridge. Not the Perfect Machine's synchronization core.");
public static MimirNetworkTransportConfiguration CultMeshProgramBridge { get; } = new(
"cultmesh-program-bridge",
"Reliable-UDP CultMesh media bridge for muxed program frames that OBS consumes through a local Starfire endpoint.",
MimirNetworkTransportKind.CultMeshReliableUdpMedia,
MimirNetworkPayloadKind.MuxedAudioVideoProgramFeed,
MayAffectClock: false,
CarriesRawMedia: true,
TargetLatencyMilliseconds: 500.0,
RequiredDocuments: ["mimir.cultmesh_media_frame"],
RejectionConditions: ["used-as-clock-authority", "unbounded-media-cache", "non-local-obs-egress"],
"Raven publishes rolling media-frame documents over CultNet reliable UDP; Starfire lowers them to a local OBS MPEG-TS endpoint.");
public static MimirNetworkTransportConfiguration WebRtcExperiment { get; } = CultMeshTimingState with
{
Id = "webrtc-experimental-media",
@ -84,6 +98,7 @@ public static class MimirNetworkTransportConfigurations
[
CultMeshTimingState,
RawAudioDebugWindow,
CultMeshProgramBridge,
SrtProgramBridge,
WebRtcExperiment
];