feat: 自动建立实时监看媒体路径 (#51)
This commit is contained in:
@@ -4,6 +4,9 @@ import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync/atomic"
|
||||
|
||||
"yovision.local/sense/app/sense/admission"
|
||||
"yovision.local/sense/app/sense/identity"
|
||||
)
|
||||
|
||||
var activeService atomic.Pointer[Service]
|
||||
@@ -23,3 +26,12 @@ func PlaybackRoutes(ctx context.Context) ([]Route, error) {
|
||||
}
|
||||
return service.store.List(ctx)
|
||||
}
|
||||
|
||||
func ConfigureReadyProfiles(ctx context.Context, actor identity.Principal, result admission.Result) admission.MediaOutcome {
|
||||
service := activeService.Load()
|
||||
if service == nil {
|
||||
return admission.MediaOutcome{Status: "needs_attention", Detail: "摄像机已接入,媒体服务尚未就绪"}
|
||||
}
|
||||
return service.ConfigureProfiles(ctx, actor, result)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user