feat: add pullproxy support gb28181 type

This commit is contained in:
pggiroro
2025-06-23 23:39:15 +08:00
parent 0d3d86518d
commit 7b6259ed67

View File

@@ -6,6 +6,7 @@ import (
"net"
"net/url"
"path/filepath"
"regexp"
"strings"
"time"
@@ -287,6 +288,12 @@ func (s *Server) AddPullProxy(ctx context.Context, req *pb.PullProxyInfo) (res *
pullProxyConfig.Type = "flv"
case ".mp4":
pullProxyConfig.Type = "mp4"
default:
pattern := `^\d{20}/\d{20}$`
re := regexp.MustCompile(pattern)
if re.MatchString(u.Path) {
pullProxyConfig.Type = "gb28181"
}
}
}
}
@@ -489,4 +496,4 @@ func (p *PullProxyManager) CheckToPull(streamPath string) {
pullProxy.Pull()
}
}
}
}