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

@@ -17,16 +17,19 @@ import (
// 3. re-publish all medias on another path.
func main() {
reader := gortsplib.Client{}
// parse source URL
sourceURL, err := base.ParseURL("rtsp://myuser:mypass@localhost:8554/mystream")
if err != nil {
panic(err)
}
reader := gortsplib.Client{
Scheme: sourceURL.Scheme,
Host: sourceURL.Host,
}
// connect to the server
err = reader.Start(sourceURL.Scheme, sourceURL.Host)
err = reader.Start2()
if err != nil {
panic(err)
}