add files and ci
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m34s
All checks were successful
Create and publish a Docker image 🚀 / build-and-push-image (push) Successful in 1m34s
This commit is contained in:
23
track.go
Normal file
23
track.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/pion/rtp"
|
||||
"github.com/pion/webrtc/v4"
|
||||
)
|
||||
|
||||
type Track struct {
|
||||
Local *webrtc.TrackLocalStaticRTP
|
||||
}
|
||||
|
||||
func NewTrack(remote *webrtc.TrackRemote) *Track {
|
||||
local, _ := webrtc.NewTrackLocalStaticRTP(
|
||||
remote.Codec().RTPCodecCapability,
|
||||
remote.ID(),
|
||||
remote.StreamID(),
|
||||
)
|
||||
return &Track{Local: local}
|
||||
}
|
||||
|
||||
func (t *Track) Write(pkt *rtp.Packet) {
|
||||
t.Local.WriteRTP(pkt)
|
||||
}
|
||||
Reference in New Issue
Block a user