Update pion/interceptor for NACKs

Generate + Respond interceptors
This commit is contained in:
tarrencev
2020-12-13 22:57:08 -08:00
committed by Sean DuBois
parent 85ced4ad69
commit a54b74cdb7
15 changed files with 162 additions and 29 deletions

View File

@@ -123,11 +123,23 @@ func main() { // nolint:gocognit
panic(err)
}
_, err = peerConnection.AddTrack(localTrack)
rtpSender, err := peerConnection.AddTrack(localTrack)
if err != nil {
panic(err)
}
// Read incoming RTCP packets
// Before these packets are retuned they are processed by interceptors. For things
// like NACK this needs to be called.
go func() {
rtcpBuf := make([]byte, 1500)
for {
if _, _, rtcpErr := rtpSender.Read(rtcpBuf); rtcpErr != nil {
return
}
}
}()
// Set the remote SessionDescription
err = peerConnection.SetRemoteDescription(recvOnlyOffer)
if err != nil {