mirror of
https://github.com/giongto35/cloud-game.git
synced 2026-07-25 02:57:24 +00:00
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:
parent
10db5d6c88
commit
0898fb06ca
5 changed files with 240 additions and 235 deletions
|
|
@ -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}
|
||||
}
|
||||
}
|
||||
}()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue