Skip to content

Commit

Permalink
Add RID to Track and baseTrack (pion#376)
Browse files Browse the repository at this point in the history
This was added in pion/webrtc@f644649
  • Loading branch information
Sean-Der authored Jan 16, 2022
1 parent 596b8c4 commit e316b30
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mediastream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ func (track *mockMediaStreamTrack) StreamID() string {
return ""
}

func (track *mockMediaStreamTrack) RID() string {
return ""
}

func (track *mockMediaStreamTrack) Close() error {
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions track.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)) {
Expand Down

0 comments on commit e316b30

Please sign in to comment.