server: fill SSRC in SETUP responses and RTP-Info in PLAY responses automatically

This commit is contained in:
aler9
2021-06-17 15:39:18 +02:00
committed by Alessandro Ros
parent 3f3226b53d
commit db28e87ecb
9 changed files with 383 additions and 89 deletions

View File

@@ -91,19 +91,19 @@ func (sh *serverHandler) OnAnnounce(ctx *gortsplib.ServerHandlerOnAnnounceCtx) (
}
// called after receiving a SETUP request.
func (sh *serverHandler) OnSetup(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, *uint32, error) {
func (sh *serverHandler) OnSetup(ctx *gortsplib.ServerHandlerOnSetupCtx) (*base.Response, *gortsplib.ServerStream, error) {
log.Printf("setup request")
// no one is publishing yet
if sh.stream == nil {
return &base.Response{
StatusCode: base.StatusNotFound,
}, nil, nil, nil
}, nil, nil
}
return &base.Response{
StatusCode: base.StatusOK,
}, sh.stream, nil, nil
}, sh.stream, nil
}
// called after receiving a PLAY request.