Add NewRTPReader to Track interface

This commit is contained in:
Lukas Herman
2020-11-02 22:28:01 -08:00
parent 115be126ec
commit 7cbda134b0
2 changed files with 4 additions and 1 deletions

View File

@@ -47,7 +47,7 @@ func main() {
})
must(err)
videoTrack := mediaStream.GetVideoTracks()[0].(*mediadevices.VideoTrack)
videoTrack := mediaStream.GetVideoTracks()[0]
defer videoTrack.Close()
rtpReader, err := videoTrack.NewRTPReader(vp8Params.RTPCodec().Name, mtu)

View File

@@ -54,6 +54,9 @@ type Track interface {
// Unbind is the clean up operation that should be called after Bind. Similar to Bind, unbind will
// be called automatically in the future.
Unbind(*webrtc.PeerConnection) error
// NewRTPReader creates a new reader from the source. The reader will encode the source, and packetize
// the encoded data in RTP format with given mtu size.
NewRTPReader(codecName string, mtu int) (RTPReadCloser, error)
}
type baseTrack struct {