move base elements into base folder

This commit is contained in:
aler9
2020-10-04 17:32:26 +02:00
parent 973464ed1d
commit 662138a0cf
28 changed files with 352 additions and 297 deletions

View File

@@ -24,36 +24,36 @@ func main() {
defer wg.Wait()
defer conn.CloseUDPListeners()
for _, track := range tracks {
for trackId := range tracks {
// read RTP frames
wg.Add(1)
go func(track *gortsplib.Track) {
go func(trackId int) {
defer wg.Done()
for {
buf, err := conn.ReadFrameUDP(track, gortsplib.StreamTypeRtp)
buf, err := conn.ReadFrameUDP(trackId, gortsplib.StreamTypeRtp)
if err != nil {
break
}
fmt.Printf("frame from track %d, type RTP: %v\n", track.Id, buf)
fmt.Printf("frame from track %d, type RTP: %v\n", trackId, buf)
}
}(track)
}(trackId)
// read RTCP frames
wg.Add(1)
go func(track *gortsplib.Track) {
go func(trackId int) {
defer wg.Done()
for {
buf, err := conn.ReadFrameUDP(track, gortsplib.StreamTypeRtcp)
buf, err := conn.ReadFrameUDP(trackId, gortsplib.StreamTypeRtcp)
if err != nil {
break
}
fmt.Printf("frame from track %d, type RTCP: %v\n", track.Id, buf)
fmt.Printf("frame from track %d, type RTCP: %v\n", trackId, buf)
}
}(track)
}(trackId)
}
err = conn.LoopUDP()