mirror of
https://github.com/pion/webrtc.git
synced 2025-09-26 19:21:12 +08:00
Implement Interceptors
Provide API so that handling around RTP can be easily defined by the user. See the design doc here[0] [0] https://github.com/pion/webrtc-v3-design/issues/34
This commit is contained in:
@@ -11,10 +11,11 @@ type TrackLocalWriter interface {
|
||||
Write(b []byte) (int, error)
|
||||
}
|
||||
|
||||
// TrackLocalContext is the Context passed when a TrackLocal has been Binded/Unbinded from a PeerConnection
|
||||
// TrackLocalContext is the Context passed when a TrackLocal has been Binded/Unbinded from a PeerConnection, and used
|
||||
// in Interceptors.
|
||||
type TrackLocalContext struct {
|
||||
id string
|
||||
codecs []RTPCodecParameters
|
||||
params RTPParameters
|
||||
ssrc SSRC
|
||||
writeStream TrackLocalWriter
|
||||
}
|
||||
@@ -22,7 +23,13 @@ type TrackLocalContext struct {
|
||||
// CodecParameters returns the negotiated RTPCodecParameters. These are the codecs supported by both
|
||||
// PeerConnections and the SSRC/PayloadTypes
|
||||
func (t *TrackLocalContext) CodecParameters() []RTPCodecParameters {
|
||||
return t.codecs
|
||||
return t.params.Codecs
|
||||
}
|
||||
|
||||
// HeaderExtensions returns the negotiated RTPHeaderExtensionParameters. These are the header extensions supported by
|
||||
// both PeerConnections and the SSRC/PayloadTypes
|
||||
func (t *TrackLocalContext) HeaderExtensions() []RTPHeaderExtensionParameter {
|
||||
return t.params.HeaderExtensions
|
||||
}
|
||||
|
||||
// SSRC requires the negotiated SSRC of this track
|
||||
|
Reference in New Issue
Block a user