feat: remove sei track

This commit is contained in:
langhuihui
2024-02-26 17:16:49 +08:00
parent 5e41a2f6bb
commit b58e926819
27 changed files with 656 additions and 670 deletions

31
http.go
View File

@@ -2,7 +2,6 @@ package engine
import (
"encoding/json"
"io"
"net/http"
"os"
"strconv"
@@ -347,33 +346,3 @@ func (conf *GlobalConfig) API_replay_mp4(w http.ResponseWriter, r *http.Request)
go pub.ReadMP4Data(f)
}
}
func (conf *GlobalConfig) API_insertSEI(w http.ResponseWriter, r *http.Request) {
q := r.URL.Query()
streamPath := q.Get("streamPath")
s := Streams.Get(streamPath)
if s == nil {
util.ReturnError(util.APIErrorNoStream, NO_SUCH_STREAM, w, r)
return
}
t := q.Get("type")
tb, err := strconv.ParseInt(t, 10, 8)
if err != nil {
if t == "" {
tb = 5
} else {
util.ReturnError(util.APIErrorQueryParse, "type must a number", w, r)
return
}
}
sei, err := io.ReadAll(r.Body)
if err == nil {
if s.Tracks.AddSEI(byte(tb), sei) {
util.ReturnOK(w, r)
} else {
util.ReturnError(util.APIErrorNoSEI, "no sei track", w, r)
}
} else {
util.ReturnError(util.APIErrorNoBody, err.Error(), w, r)
}
}