Create publisher for remote srt stream

This commit is contained in:
Ingo Oppermann
2022-08-12 18:42:53 +03:00
parent c04ab1e82f
commit b51a38c99e
331 changed files with 18224 additions and 12383 deletions

View File

@@ -218,17 +218,17 @@ func DefaultConfig() Config {
// UnmarshalURL takes a SRT URL and parses out the configuration. A SRT URL is
// srt://[host]:[port]?[key1]=[value1]&[key2]=[value2]...
func (c *Config) UnmarshalURL(addr string) error {
func (c *Config) UnmarshalURL(addr string) (string, error) {
u, err := url.Parse(addr)
if err != nil {
return err
return "", err
}
if u.Scheme != "srt" {
return fmt.Errorf("the URL doesn't seem to be an srt:// URL")
return "", fmt.Errorf("the URL doesn't seem to be an srt:// URL")
}
return c.UnmarshalQuery(u.RawQuery)
return u.Host, c.UnmarshalQuery(u.RawQuery)
}
// UnmarshalQuery parses a query string and interprets it as a configuration