mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-26 01:40:27 +08:00
feat: remove sei track
This commit is contained in:
31
http.go
31
http.go
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user