mirror of
https://github.com/aler9/gortsplib
synced 2025-10-08 16:40:09 +08:00
remove Get from function names
This commit is contained in:
@@ -334,7 +334,7 @@ func (c *ConnClient) SetupUdp(u *url.URL, track *Track, rtpPort int,
|
|||||||
return 0, 0, nil, fmt.Errorf("SETUP: transport header: %s", err)
|
return 0, 0, nil, fmt.Errorf("SETUP: transport header: %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
rtpServerPort, rtcpServerPort := th.GetPorts("server_port")
|
rtpServerPort, rtcpServerPort := th.Ports("server_port")
|
||||||
if rtpServerPort == 0 {
|
if rtpServerPort == 0 {
|
||||||
return 0, 0, nil, fmt.Errorf("SETUP: server ports not provided")
|
return 0, 0, nil, fmt.Errorf("SETUP: server ports not provided")
|
||||||
}
|
}
|
||||||
|
@@ -27,8 +27,8 @@ func ReadHeaderTransport(v HeaderValue) (HeaderTransport, error) {
|
|||||||
return ht, nil
|
return ht, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetValue gets a value from the header.
|
// Value gets a value from the header.
|
||||||
func (ht HeaderTransport) GetValue(key string) string {
|
func (ht HeaderTransport) Value(key string) string {
|
||||||
prefix := key + "="
|
prefix := key + "="
|
||||||
for t := range ht {
|
for t := range ht {
|
||||||
if strings.HasPrefix(t, prefix) {
|
if strings.HasPrefix(t, prefix) {
|
||||||
@@ -38,9 +38,9 @@ func (ht HeaderTransport) GetValue(key string) string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetPorts gets a given header value and parses its ports.
|
// Ports gets a given header value and parses its ports.
|
||||||
func (ht HeaderTransport) GetPorts(key string) (int, int) {
|
func (ht HeaderTransport) Ports(key string) (int, int) {
|
||||||
val := ht.GetValue(key)
|
val := ht.Value(key)
|
||||||
if val == "" {
|
if val == "" {
|
||||||
return 0, 0
|
return 0, 0
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user