client: add Start2; deprecate Start (#801)

This commit is contained in:
Alessandro Ros
2025-07-05 13:02:45 +02:00
committed by GitHub
parent 616fa7ea89
commit 9c1011567a
32 changed files with 278 additions and 144 deletions

View File

@@ -18,16 +18,19 @@ import (
// 3. save the content of these streams in a file in MPEG-TS format.
func main() {
c := gortsplib.Client{}
// parse URL
u, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/stream")
if err != nil {
panic(err)
}
c := gortsplib.Client{
Scheme: u.Scheme,
Host: u.Host,
}
// connect to the server
err = c.Start(u.Scheme, u.Host)
err = c.Start2()
if err != nil {
panic(err)
}