MCPcopy Index your code
hub / github.com/Monibuca/engine / API_replay_ts

Method API_replay_ts

http.go:300–327  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

298}
299
300func (conf *GlobalConfig) API_replay_ts(w http.ResponseWriter, r *http.Request) {
301 q := r.URL.Query()
302 streamPath := q.Get("streamPath")
303 if streamPath == "" {
304 streamPath = "dump/ts"
305 }
306 dumpFile := q.Get("dump")
307 if dumpFile == "" {
308 dumpFile = streamPath + ".ts"
309 }
310 f, err := os.Open(dumpFile)
311 if err != nil {
312 util.ReturnError(util.APIErrorOpen, err.Error(), w, r)
313 return
314 }
315 var pub TSPublisher
316 if err := Engine.Publish(streamPath, &pub); err != nil {
317 util.ReturnError(util.APIErrorPublish, err.Error(), w, r)
318 } else {
319 tsReader := NewTSReader(&pub)
320 pub.SetIO(f)
321 go func() {
322 tsReader.Feed(f)
323 tsReader.Close()
324 }()
325 util.ReturnOK(w, r)
326 }
327}
328
329func (conf *GlobalConfig) API_replay_mp4(w http.ResponseWriter, r *http.Request) {
330 q := r.URL.Query()

Callers

nothing calls this directly

Calls 9

CloseMethod · 0.95
ReturnErrorFunction · 0.92
ReturnOKFunction · 0.92
NewTSReaderFunction · 0.85
ErrorMethod · 0.65
PublishMethod · 0.65
SetIOMethod · 0.65
GetMethod · 0.45
FeedMethod · 0.45

Tested by

no test coverage detected