mirror of
https://github.com/gowvp/gb28181.git
synced 2026-04-22 15:07:10 +08:00
app 统一用 rtp
This commit is contained in:
@@ -62,12 +62,9 @@ func (c *Core) AddStreamProxy(ctx context.Context, in *AddStreamProxyInput) (*St
|
||||
if err := copier.Copy(&out, in); err != nil {
|
||||
slog.ErrorContext(ctx, "Copy", "err", err)
|
||||
}
|
||||
if in.App == "rtp" {
|
||||
return nil, reason.ErrBadRequest.With("请更换 app 参数")
|
||||
}
|
||||
out.ID = c.uniqueID.UniqueID(bz.IDPrefixRTSP)
|
||||
out.Stream = out.ID
|
||||
out.App = "pull"
|
||||
out.App = "rtp"
|
||||
if err := c.store.StreamProxy().Add(ctx, &out); err != nil {
|
||||
if orm.IsDuplicatedKey(err) {
|
||||
return nil, reason.ErrDB.SetMsg("stream 重复,请勿重复添加")
|
||||
|
||||
@@ -161,10 +161,11 @@ func (w WebHookAPI) onRTPServerTimeout(c *gin.Context, in *onRTPServerTimeoutInp
|
||||
return newDefaultOutputOK(), nil
|
||||
}
|
||||
|
||||
// onStreamNotFound 流不存在事件
|
||||
// TODO: 重启后立即播放,会出发 "channel not exist" 待处理
|
||||
func (w WebHookAPI) onStreamNotFound(c *gin.Context, in *onStreamNotFoundInput) (DefaultOutput, error) {
|
||||
w.log.InfoContext(c.Request.Context(), "webhook onStreamNotFound", "app", in.App, "stream", in.Stream, "schema", in.Schema, "mediaServerID", in.MediaServerID)
|
||||
// 防止重复触发
|
||||
if in.Schema != "rtmp" {
|
||||
if !(in.Schema == "rtmp" || in.Schema == "rtsp") {
|
||||
return newDefaultOutputOK(), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user