mirror of
https://github.com/Monibuca/plugin-rtsp.git
synced 2025-09-27 03:56:08 +08:00
feat: add sendoptions config to avoid send options
This commit is contained in:
12
client.go
12
client.go
@@ -60,9 +60,11 @@ func (p *RTSPPuller) Connect() error {
|
|||||||
func (p *RTSPPuller) Pull() (err error) {
|
func (p *RTSPPuller) Pull() (err error) {
|
||||||
u, _ := url.Parse(p.RemoteURL)
|
u, _ := url.Parse(p.RemoteURL)
|
||||||
var res *base.Response
|
var res *base.Response
|
||||||
if res, err = p.Options(u); err != nil {
|
if rtspConfig.SendOptions {
|
||||||
p.Error("Options", zap.Error(err))
|
if res, err = p.Options(u); err != nil {
|
||||||
return
|
p.Error("Options", zap.Error(err))
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
p.Debug("Options", zap.Any("res", res))
|
p.Debug("Options", zap.Any("res", res))
|
||||||
// find published tracks
|
// find published tracks
|
||||||
@@ -126,7 +128,9 @@ func (p *RTSPPusher) Connect() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
p.SetIO(p)
|
p.SetIO(p)
|
||||||
_, err = p.Client.Options(u)
|
if rtspConfig.SendOptions {
|
||||||
|
_, err = p.Client.Options(u)
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
main.go
1
main.go
@@ -21,6 +21,7 @@ type RTSPConfig struct {
|
|||||||
UDPAddr string `default:":8000"`
|
UDPAddr string `default:":8000"`
|
||||||
RTCPAddr string `default:":8001"`
|
RTCPAddr string `default:":8001"`
|
||||||
WriteBufferCount int `default:"2048"`
|
WriteBufferCount int `default:"2048"`
|
||||||
|
SendOptions bool `default:"true"`
|
||||||
sync.Map
|
sync.Map
|
||||||
server *gortsplib.Server
|
server *gortsplib.Server
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user