使用rtsp拉流时将参数传入订阅者

This commit is contained in:
dexter
2023-01-02 21:12:45 +08:00
parent 187335d311
commit 7f4bfe4c78
4 changed files with 31 additions and 41 deletions

View File

@@ -40,7 +40,11 @@ func (conf *RTSPConfig) OnDescribe(ctx *gortsplib.ServerHandlerOnDescribeCtx) (*
RTSPPlugin.Debug("describe request")
var suber RTSPSubscriber
suber.SetIO(ctx.Conn.NetConn())
if err := RTSPPlugin.Subscribe(ctx.Path, &suber); err == nil {
streamPath := ctx.Path
if ctx.Query != "" {
streamPath = streamPath + "?" + ctx.Query
}
if err := RTSPPlugin.Subscribe(streamPath, &suber); err == nil {
RTSPPlugin.Debug("describe replay ok")
conf.Store(ctx.Conn, &suber)
return &base.Response{