Files
core/http/api/avstream.go
Jan Stabenow eb1cc37456 Add GoSRT & improvements (repo-merge)
Commits (Ingo Oppermann):
- Add experimental SRT connection stats and logs
- Hide /config/reload endpoint in reade-only mode
- Add SRT server
- Create v16 in go.mod
- Fix data races, tests, lint, and update dependencies
- Add trailing slash for routed directories (datarhei/restreamer#340)
- Allow relative URLs in content in static routes

Co-Authored-By: Ingo Oppermann <57445+ioppermann@users.noreply.github.com>
2022-06-23 22:13:58 +02:00

55 lines
1.1 KiB
Go

package api
import (
"github.com/datarhei/core/v16/restream/app"
)
type AVstreamIO struct {
State string `json:"state" enums:"running,idle" jsonschema:"enum=running,enum=idle"`
Packet uint64 `json:"packet"`
Time uint64 `json:"time"`
Size uint64 `json:"size_kb"`
}
func (i *AVstreamIO) Unmarshal(io *app.AVstreamIO) {
if io == nil {
return
}
i.State = io.State
i.Packet = io.Packet
i.Time = io.Time
i.Size = io.Size
}
type AVstream struct {
Input AVstreamIO `json:"input"`
Output AVstreamIO `json:"output"`
Aqueue uint64 `json:"aqueue"`
Queue uint64 `json:"queue"`
Dup uint64 `json:"dup"`
Drop uint64 `json:"drop"`
Enc uint64 `json:"enc"`
Looping bool `json:"looping"`
Duplicating bool `json:"duplicating"`
GOP string `json:"gop"`
}
func (a *AVstream) Unmarshal(av *app.AVstream) {
if av == nil {
return
}
a.Aqueue = av.Aqueue
a.Queue = av.Queue
a.Dup = av.Dup
a.Drop = av.Drop
a.Enc = av.Enc
a.Looping = av.Looping
a.Duplicating = av.Duplicating
a.GOP = av.GOP
a.Input.Unmarshal(&av.Input)
a.Output.Unmarshal(&av.Output)
}