simplify UDP configuration

This commit is contained in:
aler9
2021-03-06 09:46:24 +01:00
parent 964331cacd
commit 260af6e041
6 changed files with 96 additions and 110 deletions

View File

@@ -147,20 +147,10 @@ func handleConn(conn *gortsplib.ServerConn) {
}
func main() {
// to publish or read UDP streams, two UDP listeners must be created
udpRTPListener, err := gortsplib.NewServerUDPListener(":8000")
if err != nil {
panic(err)
}
udpRTCPListener, err := gortsplib.NewServerUDPListener(":8001")
if err != nil {
panic(err)
}
// create configuration
conf := gortsplib.ServerConf{
UDPRTPListener: udpRTPListener,
UDPRTCPListener: udpRTCPListener,
UDPRTPAddress: ":8000",
UDPRTCPAddress: ":8001",
}
// create server