api: return static sources in paths/list even if sourceOnDemand is true

This commit is contained in:
aler9
2022-08-04 20:28:10 +02:00
parent ac0a5e9fc7
commit 7067c02030
6 changed files with 315 additions and 174 deletions

View File

@@ -19,8 +19,8 @@ import (
type rtspSourceParent interface {
log(logger.Level, string, ...interface{})
onSourceStaticSetReady(req pathSourceStaticSetReadyReq) pathSourceStaticSetReadyRes
onSourceStaticSetNotReady(req pathSourceStaticSetNotReadyReq)
onSourceStaticImplSetReady(req pathSourceStaticSetReadyReq) pathSourceStaticSetReadyRes
onSourceStaticImplSetNotReady(req pathSourceStaticSetNotReadyReq)
}
type rtspSource struct {
@@ -125,9 +125,7 @@ func (s *rtspSource) run(ctx context.Context) error {
}
}
res := s.parent.onSourceStaticSetReady(pathSourceStaticSetReadyReq{
tracks: c.Tracks(),
})
res := s.parent.onSourceStaticImplSetReady(pathSourceStaticSetReadyReq{tracks: tracks})
if res.err != nil {
return res.err
}
@@ -135,7 +133,7 @@ func (s *rtspSource) run(ctx context.Context) error {
s.Log(logger.Info, "ready")
defer func() {
s.parent.onSourceStaticSetNotReady(pathSourceStaticSetNotReadyReq{})
s.parent.onSourceStaticImplSetNotReady(pathSourceStaticSetNotReadyReq{})
}()
c.OnPacketRTP = func(ctx *gortsplib.ClientOnPacketRTPCtx) {