Media-over-QUIC is a streaming protocol built upon cutting edge protocols (QUIC, HTTP3) and browser APIs (WebTransport, WebCodecs). It's slightly faster than WebRTC, has an advanced data recovery mechanism (placed at the frame level and not at the packet level), it supports additional codecs (FLAC) and is less complicated to route.
94 lines
3.7 KiB
Go
94 lines
3.7 KiB
Go
package defs
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// APIPathManager contains methods used by the API and Metrics server.
|
|
type APIPathManager interface {
|
|
APIPathsList() (*APIPathList, error)
|
|
APIPathsGet(string) (*APIPath, error)
|
|
}
|
|
|
|
// APIPathSourceType is the type of a path source.
|
|
type APIPathSourceType string
|
|
|
|
// source types.
|
|
const (
|
|
APIPathSourceTypeHLSSource APIPathSourceType = "hlsSource"
|
|
APIPathSourceTypeRedirect APIPathSourceType = "redirect"
|
|
APIPathSourceTypeRPICameraSource APIPathSourceType = "rpiCameraSource"
|
|
APIPathSourceTypeRTMPConn APIPathSourceType = "rtmpConn"
|
|
APIPathSourceTypeRTMPSConn APIPathSourceType = "rtmpsConn"
|
|
APIPathSourceTypeRTMPSource APIPathSourceType = "rtmpSource"
|
|
APIPathSourceTypeRTSPSession APIPathSourceType = "rtspSession"
|
|
APIPathSourceTypeRTSPSource APIPathSourceType = "rtspSource"
|
|
APIPathSourceTypeRTSPSSession APIPathSourceType = "rtspsSession"
|
|
APIPathSourceTypeSRTConn APIPathSourceType = "srtConn"
|
|
APIPathSourceTypeSRTSource APIPathSourceType = "srtSource"
|
|
APIPathSourceTypeMPEGTSSource APIPathSourceType = "mpegtsSource"
|
|
APIPathSourceTypeRTPSource APIPathSourceType = "rtpSource"
|
|
APIPathSourceTypeWebRTCSession APIPathSourceType = "webRTCSession"
|
|
APIPathSourceTypeWebRTCSource APIPathSourceType = "webRTCSource"
|
|
APIPathSourceTypeMoQSession APIPathSourceType = "moqSession"
|
|
)
|
|
|
|
// APIPathSource is a source.
|
|
type APIPathSource struct {
|
|
Type APIPathSourceType `json:"type"`
|
|
ID string `json:"id"`
|
|
}
|
|
|
|
// APIPathReaderType is the type of a path reader.
|
|
type APIPathReaderType string
|
|
|
|
// reader types.
|
|
const (
|
|
APIPathReaderTypeHLSSession APIPathReaderType = "hlsSession"
|
|
APIPathReaderTypeRTMPConn APIPathReaderType = "rtmpConn"
|
|
APIPathReaderTypeRTMPSConn APIPathReaderType = "rtmpsConn"
|
|
APIPathReaderTypeRTSPConn APIPathReaderType = "rtspConn"
|
|
APIPathReaderTypeRTSPSession APIPathReaderType = "rtspSession"
|
|
APIPathReaderTypeRTSPSConn APIPathReaderType = "rtspsConn"
|
|
APIPathReaderTypeRTSPSSession APIPathReaderType = "rtspsSession"
|
|
APIPathReaderTypeSRTConn APIPathReaderType = "srtConn"
|
|
APIPathReaderTypeWebRTCSession APIPathReaderType = "webRTCSession"
|
|
APIPathReaderTypeMoQSession APIPathReaderType = "moqSession"
|
|
APIPathReaderTypeHidden APIPathReaderType = "hidden"
|
|
)
|
|
|
|
// APIPathReader is a reader.
|
|
type APIPathReader struct {
|
|
Type APIPathReaderType `json:"type"`
|
|
ID string `json:"id"`
|
|
}
|
|
|
|
// APIPath is a path.
|
|
type APIPath struct {
|
|
Name string `json:"name"`
|
|
ConfName string `json:"confName"`
|
|
Ready bool `json:"ready" deprecated:"true"`
|
|
ReadyTime *time.Time `json:"readyTime" deprecated:"true"`
|
|
Available bool `json:"available"`
|
|
AvailableTime *time.Time `json:"availableTime"`
|
|
Online bool `json:"online"`
|
|
OnlineTime *time.Time `json:"onlineTime"`
|
|
Source *APIPathSource `json:"source"`
|
|
Tracks []APIPathTrackCodec `json:"tracks" deprecated:"true"`
|
|
Tracks2 []APIPathTrack `json:"tracks2"`
|
|
Readers []APIPathReader `json:"readers"`
|
|
InboundBytes uint64 `json:"inboundBytes"`
|
|
OutboundBytes uint64 `json:"outboundBytes"`
|
|
InboundFramesInError uint64 `json:"inboundFramesInError"`
|
|
// deprecated
|
|
BytesReceived uint64 `json:"bytesReceived" deprecated:"true"`
|
|
BytesSent uint64 `json:"bytesSent" deprecated:"true"`
|
|
}
|
|
|
|
// APIPathList is a list of paths.
|
|
type APIPathList struct {
|
|
ItemCount int `json:"itemCount"`
|
|
PageCount int `json:"pageCount"`
|
|
Items []APIPath `json:"items"`
|
|
}
|