Migrate to pion/webrtc v3 (#254)

* Add initial pion/webrtc v3 migration

* Use custom timestamps when sending video packets

* Update dependencies
This commit is contained in:
sergystepanov 2021-01-04 21:09:03 +03:00 committed by GitHub
parent 10db5d6c88
commit 0898fb06ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 240 additions and 235 deletions

View file

@ -157,12 +157,13 @@ func (r *Room) startVideo(width, height int, videoCodec encoder.VideoCodec) {
for data := range eoutput {
// TODO: r.rtcSessions is rarely updated. Lock will hold down perf
for _, webRTC := range r.rtcSessions {
if !webRTC.IsConnected() {
continue
}
// encode frame
// fanout imageChannel
if webRTC.IsConnected() {
// NOTE: can block here
webRTC.ImageChannel <- webrtc.WebFrame{Data: data.Data, Timestamp: data.Timestamp}
}
// NOTE: can block here
webRTC.ImageChannel <- webrtc.WebFrame{Data: data.Data, Timestamp: data.Timestamp}
}
}
}()