mirror of
https://github.com/langhuihui/monibuca.git
synced 2025-12-24 13:48:04 +08:00
Compare commits
1 Commits
v5.0.2-bet
...
snap
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f89c279388 |
@@ -5,7 +5,6 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"m7s.live/v5/pkg/util"
|
||||
"net/http"
|
||||
"strconv"
|
||||
|
||||
@@ -165,7 +164,7 @@ func (o *OnvifPlugin) closeStream(resp *Response, w http.ResponseWriter, r *http
|
||||
}
|
||||
devParam, _ := parseDeviceParam(r)
|
||||
|
||||
streamPath := GenStreamPath(d.Device, util.ConvertRuneToEn(devParam.IFace))
|
||||
streamPath := GenStreamPath(d.Device, devParam.IFace)
|
||||
|
||||
stream, _ := o.Server.Streams.Get(streamPath)
|
||||
if stream == nil {
|
||||
|
||||
@@ -86,7 +86,7 @@ var authCfg = &AuthConfig{
|
||||
|
||||
func GenStreamPath(device *donvif.Device, ifname string) string {
|
||||
streamPath := strings.ReplaceAll(device.GetDeviceParams().Xaddr, ".", "_")
|
||||
streamPath = "onvif/" + ifname + "/" + strings.ReplaceAll(streamPath, ":", "_")
|
||||
streamPath = "onvif/" + util.ConvertRuneToEn(ifname) + "/" + strings.ReplaceAll(streamPath, ":", "_")
|
||||
return streamPath
|
||||
}
|
||||
func NewDeviceStatus(ip, user, passwd, port, path string, channel int) (*DeviceStatus, int, error) {
|
||||
@@ -359,15 +359,8 @@ func (d *DeviceStatus) GotoPtzPreset(presetToken string, speed *onvifTypes.PTZSp
|
||||
}
|
||||
|
||||
func (d *DeviceStatus) PullStream(ifname string, channel int) error {
|
||||
// // 从 engine 获取 RTSP 插件实例
|
||||
rtspPlugin, ok := deviceList.plugin.Server.Plugins.Get("rtsp")
|
||||
if !ok || rtspPlugin == nil {
|
||||
d.Status = StatusPullRtspError
|
||||
return fmt.Errorf("RTSP plugin not found")
|
||||
}
|
||||
|
||||
// 生成流路径
|
||||
streamPath := GenStreamPath(d.Device, util.ConvertRuneToEn(ifname))
|
||||
streamPath := GenStreamPath(d.Device, ifname)
|
||||
var rtspUrl string
|
||||
var err error
|
||||
if d.MediaUrl != "" {
|
||||
|
||||
Reference in New Issue
Block a user