move webrtc tunnels to relay/tunnel/rtc, unblock gomobile bind
This commit is contained in:
1 parent
799146771a
commit
ac5d890970
28 files changed
+173
-137
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package rtc
|
||||
|
||||
import (
|
||||
"whitelist-bypass/relay/common"
|
||||
|
||||
"github.com/kulikov0/headless-client/webrtc"
|
||||
)
|
||||
|
||||
func DrainSenderRTCP(sender *webrtc.RTPSender) {
|
||||
if sender == nil {
|
||||
return
|
||||
}
|
||||
buf := make([]byte, 1500)
|
||||
for {
|
||||
if _, _, err := sender.Read(buf); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func DrainTrack(track *webrtc.TrackRemote) {
|
||||
if track == nil {
|
||||
return
|
||||
}
|
||||
buf := make([]byte, common.UDPBufSize)
|
||||
for {
|
||||
if _, _, err := track.Read(buf); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user