mirror of
https://github.com/pion/mediadevices.git
synced 2025-09-27 12:52:20 +08:00
Add NewRTPReader to Track interface
This commit is contained in:
@@ -47,7 +47,7 @@ func main() {
|
|||||||
})
|
})
|
||||||
must(err)
|
must(err)
|
||||||
|
|
||||||
videoTrack := mediaStream.GetVideoTracks()[0].(*mediadevices.VideoTrack)
|
videoTrack := mediaStream.GetVideoTracks()[0]
|
||||||
defer videoTrack.Close()
|
defer videoTrack.Close()
|
||||||
|
|
||||||
rtpReader, err := videoTrack.NewRTPReader(vp8Params.RTPCodec().Name, mtu)
|
rtpReader, err := videoTrack.NewRTPReader(vp8Params.RTPCodec().Name, mtu)
|
||||||
|
3
track.go
3
track.go
@@ -54,6 +54,9 @@ type Track interface {
|
|||||||
// Unbind is the clean up operation that should be called after Bind. Similar to Bind, unbind will
|
// Unbind is the clean up operation that should be called after Bind. Similar to Bind, unbind will
|
||||||
// be called automatically in the future.
|
// be called automatically in the future.
|
||||||
Unbind(*webrtc.PeerConnection) error
|
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 {
|
type baseTrack struct {
|
||||||
|
Reference in New Issue
Block a user