-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Participant Composite #474
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! I think we may just consider relying a bit more on contexts for some of the cancellation/timeout handling.
pkg/gstreamer/bin.go
Outdated
stateErr <- b.bin.SetState(state) | ||
}() | ||
select { | ||
case <-time.After(stateChangeTimeout): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a context help here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if you're passing the context into other functions/doing more with deadlines I'd agree, but for simple cases like this I prefer the simplicity of time.After. One line less without the defer cancel()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. My point would be that I think that ideal (b *Bin) SetState
(and potentially callers as well) should take a context as well, allowing the caller to cancel the wait on timeout.
Retrofitting all this is beyond the scope of this PR, of course.
} | ||
|
||
select { | ||
case <-time.After(stateChangeTimeout): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A context may be a bit more straightforward here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
@@ -326,16 +380,21 @@ func (s *SDKSource) onTrackSubscribed(track *webrtc.TrackRemote, pub *lksdk.Remo | |||
if !s.initialized.IsBroken() { | |||
s.mu.Lock() | |||
switch s.RequestType { | |||
case types.RequestTypeParticipant: | |||
s.filenameReplacements["{publisher_identity}"] = s.Identity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would we make pID a replacement policy too? not sure if that needs to be onTrackSubscribed tho.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could add ID if/when someone asks, I think for the most part identity is more useful
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah you are right.. this is participant composite.. identity is the main thing people would care about.
No description provided.