Conversation
|
|
||
| // TemplateUsesSDKSource reports whether a template source request will use | ||
| // the SDK source (no Chrome/Pulse) instead of Web. | ||
| // Same heuristic as RoomCompositeUsesSDKSource. |
There was a problem hiding this comment.
do you think it's worth reducing repetition by having something like:
type sdkSourceCompatibilityChecker interface {
GetLayout() string
GetAudioOnly() bool
GetCustomBaseUrl() string
}
func UsesSDKSource(req sdkSourceCompatibilityChecker) bool {
return req.GetLayout() == "" && req.GetAudioOnly() && req.GetCustomBaseUrl() == ""
}
Both proto types already have the generated Get methods, so this works with zero changes to the proto. ThenRoomCompositeUsesSDKSource and TemplateUsesSDKSource both become UsesSDKSource(req)?
| alreadySubscribed++ | ||
| continue // Already subscribed via onTrackPublished | ||
| } | ||
| if err := s.subscribe(pub); err != nil { |
There was a problem hiding this comment.
is this a race possibility - we are subscribing to the track before the result channel is installed. If the subscription is fast enough and finishes the round trip (and gets onSubscribed callback) before we get to the startAwaitingTracks line - the result channel will be nil and the startup will silently miss both success or failure?
| } | ||
| } | ||
|
|
||
| s.completeInit() |
There was a problem hiding this comment.
What's the reason awaitMediaTracks() doesn't wait for all currently matched initial subscriptions here (or the 3s soft timeout)? awaitExpected() keeps consuming results until it reaches the expected count, but this path completes init after a single receive, which seems to let startup proceed while other requested media tracks are still in flight. That would make later successes post-init dynamic adds and later failures non-startup-fatal. Looks like behavior change.
| logger.Infow("io connection restored", "egressID", u.info.EgressId) | ||
| } | ||
| requestType, outputType := egress.GetTypes(u.info.Request) | ||
| var typesInput interface{} = u.info.Request |
| next := b.nextChannel | ||
| b.nextChannel++ | ||
| return next%2 + 1 | ||
| if b.nextChannel == livekit.AudioChannel_AUDIO_CHANNEL_LEFT { |
There was a problem hiding this comment.
very simple and makes it much easier to read 👍
https://www.notion.so/livekit/Egress-v2-Replay-Export-6813d87e17e8437db6fd8ee759df7b13?source=copy_link#32e3c4901a4280ccb693cb8d73268f01