change OnFrame signature

This commit is contained in:
aler9
2020-11-19 11:57:23 +01:00
parent 8a8a8d9b5a
commit 5019561d3f
9 changed files with 81 additions and 100 deletions

View File

@@ -23,18 +23,10 @@ func main() {
}
defer conn.Close()
readerDone := make(chan struct{})
// read frames from the server
conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte, err error) {
if err != nil {
fmt.Printf("ERR: %v\n", err)
close(readerDone)
return
}
done := conn.OnFrame(func(id int, typ gortsplib.StreamType, buf []byte) {
fmt.Printf("frame from track %d, type %v: %v\n", id, typ, buf)
})
<-readerDone
<-done
}