mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 07:06:58 +08:00
client: merge Client and ClientConn
This commit is contained in:
@@ -52,12 +52,12 @@ func main() {
|
||||
}
|
||||
|
||||
// connect to the server and start publishing the track
|
||||
conn, err := c.DialPublish("rtsp://localhost:8554/mystream",
|
||||
err = c.DialPublish("rtsp://localhost:8554/mystream",
|
||||
gortsplib.Tracks{track})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
defer conn.Close()
|
||||
defer c.Close()
|
||||
|
||||
buf := make([]byte, 2048)
|
||||
for {
|
||||
@@ -68,7 +68,7 @@ func main() {
|
||||
}
|
||||
|
||||
// route RTP packets to the server
|
||||
err = conn.WritePacketRTP(0, buf[:n])
|
||||
err = c.WritePacketRTP(0, buf[:n])
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user