From e316b309640160d84fe3e28160595a021a6a5138 Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Sat, 15 Jan 2022 23:15:56 -0500 Subject: [PATCH] Add RID to Track and baseTrack (#376) This was added in pion/webrtc@f644649 --- mediastream_test.go | 4 ++++ track.go | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/mediastream_test.go b/mediastream_test.go index 4d432b58..9c86d479 100644 --- a/mediastream_test.go +++ b/mediastream_test.go @@ -19,6 +19,10 @@ func (track *mockMediaStreamTrack) StreamID() string { return "" } +func (track *mockMediaStreamTrack) RID() string { + return "" +} + func (track *mockMediaStreamTrack) Close() error { return nil } diff --git a/track.go b/track.go index 53fe8dc1..ca57395e 100644 --- a/track.go +++ b/track.go @@ -56,6 +56,8 @@ type Track interface { Kind() webrtc.RTPCodecType // StreamID is the group this track belongs too. This must be unique StreamID() string + // RID is the RTP Stearm ID for this track. This is only used for Simulcast + RID() string // Bind binds the current track source to the given peer connection. In Pion/webrtc v3, the bind // call will happen automatically after the SDP negotiation. Users won't need to call this manually. Bind(webrtc.TrackLocalContext) (webrtc.RTPCodecParameters, error) @@ -115,6 +117,11 @@ func (track *baseTrack) StreamID() string { return generator.String() } +// RID is only relevant if you wish to use Simulcast +func (track *baseTrack) RID() string { + return "" +} + // OnEnded sets an error handler. When a track has been created and started, if an // error occurs, handler will get called with the error given to the parameter. func (track *baseTrack) OnEnded(handler func(error)) {