defs

package
v1.20.1-soundar.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 20, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package defs contains shared definitions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatsInfo

func FormatsInfo(formats []format.Format) string

FormatsInfo returns a description of formats.

func MediasInfo

func MediasInfo(medias []*description.Media) string

MediasInfo returns a description of medias.

Types

type APIError

type APIError struct {
	Status APIErrorStatus `json:"status"`
	Error  string         `json:"error"`
}

APIError is a generic error.

type APIErrorStatus

type APIErrorStatus string

APIErrorStatus is the status of an error response.

const (
	APIErrorStatusError APIErrorStatus = "error"
)

statuses.

type APIForwardDest

type APIForwardDest struct {
	ID            uuid.UUID              `json:"id"`
	Pos           int                    `json:"pos"`
	Created       time.Time              `json:"created"`
	Conf          conf.ForwardDest       `json:"conf"`
	Protocol      APIForwardDestProtocol `json:"protocol"`
	State         APIForwardDestState    `json:"state"`
	LastError     string                 `json:"lastError"`
	OutboundBytes uint64                 `json:"outboundBytes"`
}

APIForwardDest is a forward destination.

type APIForwardDestList

type APIForwardDestList struct {
	ItemCount int              `json:"itemCount"`
	PageCount int              `json:"pageCount"`
	Items     []APIForwardDest `json:"items"`
}

APIForwardDestList is a list of forward destinations.

type APIForwardDestProtocol

type APIForwardDestProtocol string

APIForwardDestProtocol is the protocol used by a forward destination.

const (
	APIForwardDestProtocolRTMP  APIForwardDestProtocol = "rtmp"
	APIForwardDestProtocolRTMPS APIForwardDestProtocol = "rtmps"
	APIForwardDestProtocolRTSP  APIForwardDestProtocol = "rtsp"
	APIForwardDestProtocolRTSPS APIForwardDestProtocol = "rtsps"
	APIForwardDestProtocolSRT   APIForwardDestProtocol = "srt"
	APIForwardDestProtocolWHIP  APIForwardDestProtocol = "whip"
	APIForwardDestProtocolWHIPS APIForwardDestProtocol = "whips"
)

forward protocols.

type APIForwardDestState

type APIForwardDestState string

APIForwardDestState is the state of a forward destination.

const (
	APIForwardDestStateIdle       APIForwardDestState = "idle"
	APIForwardDestStateForwarding APIForwardDestState = "forwarding"
	APIForwardDestStateError      APIForwardDestState = "error"
)

forward states.

type APIHLSMuxer

type APIHLSMuxer struct {
	Path                    string    `json:"path"`
	Created                 time.Time `json:"created"`
	LastRequest             time.Time `json:"lastRequest"`
	OutboundBytes           uint64    `json:"outboundBytes"`
	OutboundFramesDiscarded uint64    `json:"outboundFramesDiscarded"`
	// deprecated
	BytesSent uint64 `json:"bytesSent" deprecated:"true"`
}

APIHLSMuxer is an HLS muxer.

type APIHLSMuxerList

type APIHLSMuxerList struct {
	ItemCount int           `json:"itemCount"`
	PageCount int           `json:"pageCount"`
	Items     []APIHLSMuxer `json:"items"`
}

APIHLSMuxerList is a list of HLS muxers.

type APIHLSServer

type APIHLSServer interface {
	APISessionsList() (*APIHLSSessionList, error)
	APISessionsGet(uuid.UUID) (*APIHLSSession, error)
	APISessionsKick(uuid.UUID) error
	APIMuxersList() (*APIHLSMuxerList, error)
	APIMuxersGet(string) (*APIHLSMuxer, error)
}

APIHLSServer contains methods used by the API and Metrics server.

type APIHLSSession

type APIHLSSession struct {
	ID            uuid.UUID `json:"id"`
	Created       time.Time `json:"created"`
	RemoteAddr    string    `json:"remoteAddr"`
	Path          string    `json:"path"`
	Query         string    `json:"query"`
	User          string    `json:"user"`
	UserAgent     string    `json:"userAgent"`
	IsCDN         bool      `json:"isCDN"`
	OutboundBytes uint64    `json:"outboundBytes"`
}

APIHLSSession is an HLS session.

type APIHLSSessionList

type APIHLSSessionList struct {
	ItemCount int             `json:"itemCount"`
	PageCount int             `json:"pageCount"`
	Items     []APIHLSSession `json:"items"`
}

APIHLSSessionList is a list of HLS sessions.

type APIInfo

type APIInfo struct {
	Version string    `json:"version"`
	Started time.Time `json:"started"`
}

APIInfo is a info response.

type APIMoQServer

type APIMoQServer interface {
	APISessionsList() (*APIMoQSessionList, error)
	APISessionsGet(uuid.UUID) (*APIMoQSession, error)
	APISessionsKick(uuid.UUID) error
}

APIMoQServer contains methods used by the API server.

type APIMoQSession

type APIMoQSession struct {
	ID            uuid.UUID              `json:"id"`
	Created       time.Time              `json:"created"`
	RemoteAddr    string                 `json:"remoteAddr"`
	State         APIMoQSessionState     `json:"state"`
	Path          string                 `json:"path"`
	Query         string                 `json:"query"`
	UserAgent     string                 `json:"userAgent"`
	Transport     APIMoQSessionTransport `json:"transport"`
	Version       APIMoQVersion          `json:"version"`
	InboundBytes  uint64                 `json:"inboundBytes"`
	OutboundBytes uint64                 `json:"outboundBytes"`
}

APIMoQSession is a MoQ session.

type APIMoQSessionList

type APIMoQSessionList struct {
	ItemCount int             `json:"itemCount"`
	PageCount int             `json:"pageCount"`
	Items     []APIMoQSession `json:"items"`
}

APIMoQSessionList is a list of MoQ sessions.

type APIMoQSessionState

type APIMoQSessionState string

APIMoQSessionState is the state of a MoQ session.

const (
	APIMoQSessionStateIdle    APIMoQSessionState = "idle"
	APIMoQSessionStateRead    APIMoQSessionState = "read"
	APIMoQSessionStatePublish APIMoQSessionState = "publish"
)

states.

type APIMoQSessionTransport

type APIMoQSessionTransport string

APIMoQSessionTransport is the underlying transport of a MoQ session.

const (
	APIMoQSessionTransportWebTransport APIMoQSessionTransport = "webtransport"
	APIMoQSessionTransportQUIC         APIMoQSessionTransport = "quic"
)

transports.

type APIMoQVersion

type APIMoQVersion string

APIMoQVersion is a MoQ protocol version.

const (
	APIMoQVersionDraft16 APIMoQVersion = "moqt-16"
	APIMoQVersionDraft17 APIMoQVersion = "moqt-17"
	APIMoQVersionDraft18 APIMoQVersion = "moqt-18"
	APIMoQVersionDraft19 APIMoQVersion = "moqt-19"
)

protocol versions.

type APIOK

type APIOK struct {
	Status APIOKStatus `json:"status"`
}

APIOK is returned on success.

type APIOKStatus

type APIOKStatus string

APIOKStatus is the status of a successful response.

const (
	APIOKStatusOK APIOKStatus = "ok"
)

statuses.

type APIPath

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"`
}

APIPath is a path.

type APIPathConfList

type APIPathConfList struct {
	ItemCount int         `json:"itemCount"`
	PageCount int         `json:"pageCount"`
	Items     []conf.Path `json:"items"`
}

APIPathConfList is a list of path configurations.

type APIPathList

type APIPathList struct {
	ItemCount int       `json:"itemCount"`
	PageCount int       `json:"pageCount"`
	Items     []APIPath `json:"items"`
}

APIPathList is a list of paths.

type APIPathManager

type APIPathManager interface {
	APIPathsList() (*APIPathList, error)
	APIPathsGet(string) (*APIPath, error)
	APIForwardDestList(string) (*APIForwardDestList, error)
	APIForwardDestGet(string, uuid.UUID) (*APIForwardDest, error)
}

APIPathManager contains methods used by the API and Metrics server.

type APIPathReader

type APIPathReader struct {
	Type APIPathReaderType `json:"type"`
	ID   string            `json:"id"`
}

APIPathReader is a reader.

type APIPathReaderType

type APIPathReaderType string

APIPathReaderType is the type of a path reader.

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"
)

reader types.

type APIPathSource

type APIPathSource struct {
	Type APIPathSourceType `json:"type"`
	ID   string            `json:"id"`
}

APIPathSource is a source.

type APIPathSourceType

type APIPathSourceType string

APIPathSourceType is the type of a path source.

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"
	APIPathSourceTypeMoQSource       APIPathSourceType = "moqSource"
	APIPathSourceTypeMoQSession      APIPathSourceType = "moqSession"
)

source types.

type APIPathTrack

type APIPathTrack struct {
	Codec      APIPathTrackCodec      `json:"codec"`
	CodecProps APIPathTrackCodecProps `json:"codecProps"`
}

APIPathTrack is a track.

func MediasToTracks

func MediasToTracks(outMedias []*description.Media) []APIPathTrack

MediasToTracks returns tracks of given medias.

type APIPathTrackCodec

type APIPathTrackCodec = formatlabel.Label

APIPathTrackCodec is a track codec.

type APIPathTrackCodecProps

type APIPathTrackCodecProps interface {
	// contains filtered or unexported methods
}

APIPathTrackCodecProps contains codec-specific properties.

type APIPathTrackCodecPropsAC3

type APIPathTrackCodecPropsAC3 struct {
	SampleRate   int `json:"sampleRate"`
	ChannelCount int `json:"channelCount"`
}

APIPathTrackCodecPropsAC3 contains codec-specific properties of AC3.

type APIPathTrackCodecPropsAV1

type APIPathTrackCodecPropsAV1 struct {
	Width   int `json:"width"`
	Height  int `json:"height"`
	Profile int `json:"profile"`
	Level   int `json:"level"`
	Tier    int `json:"tier"`
}

APIPathTrackCodecPropsAV1 contains codec-specific properties of AV1.

type APIPathTrackCodecPropsG711

type APIPathTrackCodecPropsG711 struct {
	MULaw        bool `json:"muLaw"`
	SampleRate   int  `json:"sampleRate"`
	ChannelCount int  `json:"channelCount"`
}

APIPathTrackCodecPropsG711 contains codec-specific properties of G711.

type APIPathTrackCodecPropsH264

type APIPathTrackCodecPropsH264 struct {
	Width   int    `json:"width"`
	Height  int    `json:"height"`
	Profile string `json:"profile"`
	Level   string `json:"level"`
}

APIPathTrackCodecPropsH264 contains codec-specific properties of H264.

type APIPathTrackCodecPropsH265

type APIPathTrackCodecPropsH265 struct {
	Width   int    `json:"width"`
	Height  int    `json:"height"`
	Profile string `json:"profile"`
	Level   string `json:"level"`
}

APIPathTrackCodecPropsH265 contains codec-specific properties of H265.

type APIPathTrackCodecPropsLPCM

type APIPathTrackCodecPropsLPCM struct {
	BitDepth     int `json:"bitDepth"`
	SampleRate   int `json:"sampleRate"`
	ChannelCount int `json:"channelCount"`
}

APIPathTrackCodecPropsLPCM contains codec-specific properties of LPCM.

type APIPathTrackCodecPropsMPEG4Audio

type APIPathTrackCodecPropsMPEG4Audio struct {
	SampleRate   int `json:"sampleRate"`
	ChannelCount int `json:"channelCount"`
}

APIPathTrackCodecPropsMPEG4Audio contains codec-specific properties of MPEG4Audio.

type APIPathTrackCodecPropsOpus

type APIPathTrackCodecPropsOpus struct {
	ChannelCount int `json:"channelCount"`
}

APIPathTrackCodecPropsOpus contains codec-specific properties of Opus.

type APIPathTrackCodecPropsVP9

type APIPathTrackCodecPropsVP9 struct {
	Profile int `json:"profile"`
}

APIPathTrackCodecPropsVP9 contains codec-specific properties of VP9.

type APIRTMPConn

type APIRTMPConn struct {
	ID                      uuid.UUID        `json:"id"`
	Created                 time.Time        `json:"created"`
	RemoteAddr              string           `json:"remoteAddr"`
	State                   APIRTMPConnState `json:"state"`
	Path                    string           `json:"path"`
	Query                   string           `json:"query"`
	User                    string           `json:"user"`
	UserAgent               string           `json:"userAgent"`
	InboundBytes            uint64           `json:"inboundBytes"`
	OutboundBytes           uint64           `json:"outboundBytes"`
	OutboundFramesDiscarded uint64           `json:"outboundFramesDiscarded"`
	// deprecated
	BytesReceived uint64 `json:"bytesReceived" deprecated:"true"`
	BytesSent     uint64 `json:"bytesSent" deprecated:"true"`
}

APIRTMPConn is a RTMP connection.

type APIRTMPConnList

type APIRTMPConnList struct {
	ItemCount int           `json:"itemCount"`
	PageCount int           `json:"pageCount"`
	Items     []APIRTMPConn `json:"items"`
}

APIRTMPConnList is a list of RTMP connections.

type APIRTMPConnState

type APIRTMPConnState string

APIRTMPConnState is the state of a RTMP connection.

const (
	APIRTMPConnStateIdle    APIRTMPConnState = "idle"
	APIRTMPConnStateRead    APIRTMPConnState = "read"
	APIRTMPConnStatePublish APIRTMPConnState = "publish"
)

states.

type APIRTMPServer

type APIRTMPServer interface {
	APIConnsList() (*APIRTMPConnList, error)
	APIConnsGet(uuid.UUID) (*APIRTMPConn, error)
	APIConnsKick(uuid.UUID) error
}

APIRTMPServer contains methods used by the API and Metrics server.

type APIRTSPConn

type APIRTSPConn struct {
	ID            uuid.UUID  `json:"id"`
	Created       time.Time  `json:"created"`
	RemoteAddr    string     `json:"remoteAddr"`
	Session       *uuid.UUID `json:"session"`
	Tunnel        string     `json:"tunnel"`
	InboundBytes  uint64     `json:"inboundBytes"`
	OutboundBytes uint64     `json:"outboundBytes"`
	BytesReceived uint64     `json:"bytesReceived" deprecated:"true"`
	BytesSent     uint64     `json:"bytesSent" deprecated:"true"`
}

APIRTSPConn is a RTSP connection.

type APIRTSPConnsList

type APIRTSPConnsList struct {
	ItemCount int           `json:"itemCount"`
	PageCount int           `json:"pageCount"`
	Items     []APIRTSPConn `json:"items"`
}

APIRTSPConnsList is a list of RTSP connections.

type APIRTSPServer

type APIRTSPServer interface {
	APIConnsList() (*APIRTSPConnsList, error)
	APIConnsGet(uuid.UUID) (*APIRTSPConn, error)
	APISessionsList() (*APIRTSPSessionList, error)
	APISessionsGet(uuid.UUID) (*APIRTSPSession, error)
	APISessionsKick(uuid.UUID) error
}

APIRTSPServer contains methods used by the API and Metrics server.

type APIRTSPSession

type APIRTSPSession struct {
	ID                             uuid.UUID           `json:"id"`
	Created                        time.Time           `json:"created"`
	RemoteAddr                     string              `json:"remoteAddr"`
	State                          APIRTSPSessionState `json:"state"`
	Path                           string              `json:"path"`
	Query                          string              `json:"query"`
	User                           string              `json:"user"`
	UserAgent                      string              `json:"userAgent"`
	Transport                      *string             `json:"transport"`
	Profile                        *string             `json:"profile"`
	Conns                          []uuid.UUID         `json:"conns"`
	InboundBytes                   uint64              `json:"inboundBytes"`
	InboundRTPPackets              uint64              `json:"inboundRTPPackets"`
	InboundRTPPacketsLost          uint64              `json:"inboundRTPPacketsLost"`
	InboundRTPPacketsInError       uint64              `json:"inboundRTPPacketsInError"`
	InboundRTPPacketsJitter        float64             `json:"inboundRTPPacketsJitter"`
	InboundRTCPPackets             uint64              `json:"inboundRTCPPackets"`
	InboundRTCPPacketsInError      uint64              `json:"inboundRTCPPacketsInError"`
	OutboundBytes                  uint64              `json:"outboundBytes"`
	OutboundRTPPackets             uint64              `json:"outboundRTPPackets"`
	OutboundRTPPacketsReportedLost uint64              `json:"outboundRTPPacketsReportedLost"`
	OutboundRTPPacketsDiscarded    uint64              `json:"outboundRTPPacketsDiscarded"`
	OutboundRTCPPackets            uint64              `json:"outboundRTCPPackets"`
	// deprecated
	BytesReceived       uint64  `json:"bytesReceived" deprecated:"true"`
	BytesSent           uint64  `json:"bytesSent" deprecated:"true"`
	RTPPacketsReceived  uint64  `json:"rtpPacketsReceived" deprecated:"true"`
	RTPPacketsSent      uint64  `json:"rtpPacketsSent" deprecated:"true"`
	RTPPacketsLost      uint64  `json:"rtpPacketsLost" deprecated:"true"`
	RTPPacketsInError   uint64  `json:"rtpPacketsInError" deprecated:"true"`
	RTPPacketsJitter    float64 `json:"rtpPacketsJitter" deprecated:"true"`
	RTCPPacketsReceived uint64  `json:"rtcpPacketsReceived" deprecated:"true"`
	RTCPPacketsSent     uint64  `json:"rtcpPacketsSent" deprecated:"true"`
	RTCPPacketsInError  uint64  `json:"rtcpPacketsInError" deprecated:"true"`
}

APIRTSPSession is a RTSP session.

type APIRTSPSessionList

type APIRTSPSessionList struct {
	ItemCount int              `json:"itemCount"`
	PageCount int              `json:"pageCount"`
	Items     []APIRTSPSession `json:"items"`
}

APIRTSPSessionList is a list of RTSP sessions.

type APIRTSPSessionState

type APIRTSPSessionState string

APIRTSPSessionState is the state of a RTSP session.

const (
	APIRTSPSessionStateIdle    APIRTSPSessionState = "idle"
	APIRTSPSessionStateRead    APIRTSPSessionState = "read"
	APIRTSPSessionStatePublish APIRTSPSessionState = "publish"
)

states.

type APIRecording

type APIRecording struct {
	Name     string                `json:"name"`
	Segments []APIRecordingSegment `json:"segments"`
}

APIRecording is a recording.

type APIRecordingList

type APIRecordingList struct {
	ItemCount int            `json:"itemCount"`
	PageCount int            `json:"pageCount"`
	Items     []APIRecording `json:"items"`
}

APIRecordingList is a list of recordings.

type APIRecordingSegment

type APIRecordingSegment struct {
	Start time.Time `json:"start"`
}

APIRecordingSegment is a recording segment.

type APISRTConn

type APISRTConn struct {
	ID         uuid.UUID       `json:"id"`
	Created    time.Time       `json:"created"`
	RemoteAddr string          `json:"remoteAddr"`
	State      APISRTConnState `json:"state"`
	Path       string          `json:"path"`
	Query      string          `json:"query"`
	User       string          `json:"user"`

	// The total number of sent DATA packets, including retransmitted packets
	PacketsSent uint64 `json:"packetsSent"`
	// The total number of received DATA packets, including retransmitted packets
	PacketsReceived uint64 `json:"packetsReceived"`
	// The total number of unique DATA packets sent by the SRT sender
	PacketsSentUnique uint64 `json:"packetsSentUnique"`
	// The total number of unique original, retransmitted or recovered by the packet filter DATA packets
	// received in time, decrypted without errors and, as a result, scheduled for delivery to the
	// upstream application by the SRT receiver.
	PacketsReceivedUnique uint64 `json:"packetsReceivedUnique"`
	// The total number of data packets considered or reported as lost at the sender side.
	// Does not correspond to the packets detected as lost at the receiver side.
	PacketsSendLoss uint64 `json:"packetsSendLoss"`
	// The total number of SRT DATA packets detected as presently missing (either reordered or lost) at the receiver side
	PacketsReceivedLoss uint64 `json:"packetsReceivedLoss"`
	// The total number of retransmitted packets sent by the SRT sender
	PacketsRetrans uint64 `json:"packetsRetrans"`
	// The total number of retransmitted packets registered at the receiver side
	PacketsReceivedRetrans uint64 `json:"packetsReceivedRetrans"`
	// The total number of sent ACK (Acknowledgement) control packets
	PacketsSentACK uint64 `json:"packetsSentACK"`
	// The total number of received ACK (Acknowledgement) control packets
	PacketsReceivedACK uint64 `json:"packetsReceivedACK"`
	// The total number of sent NAK (Negative Acknowledgement) control packets
	PacketsSentNAK uint64 `json:"packetsSentNAK"`
	// The total number of received NAK (Negative Acknowledgement) control packets
	PacketsReceivedNAK uint64 `json:"packetsReceivedNAK"`
	// The total number of sent KM (Key Material) control packets
	PacketsSentKM uint64 `json:"packetsSentKM"`
	// The total number of received KM (Key Material) control packets
	PacketsReceivedKM uint64 `json:"packetsReceivedKM"`
	// The total accumulated time in microseconds, during which the SRT sender has some data to transmit,
	// including packets that have been sent, but not yet acknowledged
	UsSndDuration uint64 `json:"usSndDuration"`

	PacketsReceivedBelated uint64 `json:"packetsReceivedBelated"`
	// The total number of dropped by the SRT sender DATA packets that have no chance to be delivered in time
	PacketsSendDrop uint64 `json:"packetsSendDrop"`
	// The total number of dropped by the SRT receiver and, as a result,
	// not delivered to the upstream application DATA packets
	PacketsReceivedDrop uint64 `json:"packetsReceivedDrop"`
	// The total number of packets that failed to be decrypted at the receiver side
	PacketsReceivedUndecrypt uint64 `json:"packetsReceivedUndecrypt"`

	// Same as packetsReceived, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesReceived uint64 `json:"bytesReceived"`
	// Same as packetsSent, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesSent uint64 `json:"bytesSent"`
	// Same as packetsSentUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesSentUnique uint64 `json:"bytesSentUnique"`
	// Same as packetsReceivedUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesReceivedUnique uint64 `json:"bytesReceivedUnique"`
	// Same as packetsReceivedLoss, but expressed in bytes, including payload and all the headers (IP, TCP, SRT),
	// bytes for the presently missing (either reordered or lost) packets' payloads are estimated
	// based on the average packet size
	BytesReceivedLoss uint64 `json:"bytesReceivedLoss"`
	// Same as packetsRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesRetrans uint64 `json:"bytesRetrans"`
	// Same as packetsReceivedRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesReceivedRetrans uint64 `json:"bytesReceivedRetrans"`
	// Same as PacketsReceivedBelated, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesReceivedBelated uint64 `json:"bytesReceivedBelated"`
	// Same as packetsSendDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesSendDrop uint64 `json:"bytesSendDrop"`
	// Same as packetsReceivedDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesReceivedDrop uint64 `json:"bytesReceivedDrop"`
	// Same as packetsReceivedUndecrypt, but expressed in bytes, including payload and all the headers (IP, TCP, SRT)
	BytesReceivedUndecrypt uint64 `json:"bytesReceivedUndecrypt"`

	// Current minimum time interval between which consecutive packets are sent, in microseconds
	UsPacketsSendPeriod float64 `json:"usPacketsSendPeriod"`
	// The maximum number of packets that can be "in flight"
	PacketsFlowWindow uint64 `json:"packetsFlowWindow"`
	// The number of packets in flight
	PacketsFlightSize uint64 `json:"packetsFlightSize"`
	// Smoothed round-trip time (SRTT), an exponentially-weighted moving average (EWMA)
	// of an endpoint's RTT samples, in milliseconds
	MsRTT float64 `json:"msRTT"`
	// Current transmission bandwidth, in Mbps
	MbpsSendRate float64 `json:"mbpsSendRate"`
	// Current receiving bandwidth, in Mbps
	MbpsReceiveRate float64 `json:"mbpsReceiveRate"`
	// Estimated capacity of the network link, in Mbps
	MbpsLinkCapacity float64 `json:"mbpsLinkCapacity"`
	// The available space in the sender's buffer, in bytes
	BytesAvailSendBuf uint64 `json:"bytesAvailSendBuf"`
	// The available space in the receiver's buffer, in bytes
	BytesAvailReceiveBuf uint64 `json:"bytesAvailReceiveBuf"`
	// Transmission bandwidth limit, in Mbps
	MbpsMaxBW float64 `json:"mbpsMaxBW"`
	// Maximum Segment Size (MSS), in bytes
	ByteMSS uint64 `json:"byteMSS"`
	// The number of packets in the sender's buffer that are already scheduled
	// for sending or even possibly sent, but not yet acknowledged
	PacketsSendBuf uint64 `json:"packetsSendBuf"`
	// Instantaneous (current) value of packetsSndBuf, but expressed in bytes,
	// including payload and all headers (IP, TCP, SRT)
	BytesSendBuf uint64 `json:"bytesSendBuf"`
	// The timespan (msec) of packets in the sender's buffer (unacknowledged packets)
	MsSendBuf uint64 `json:"msSendBuf"`
	// Timestamp-based Packet Delivery Delay value of the peer
	MsSendTsbPdDelay uint64 `json:"msSendTsbPdDelay"`
	// The number of acknowledged packets in receiver's buffer
	PacketsReceiveBuf uint64 `json:"packetsReceiveBuf"`
	// Instantaneous (current) value of packetsRcvBuf, expressed in bytes, including payload and all headers (IP, TCP, SRT)
	BytesReceiveBuf uint64 `json:"bytesReceiveBuf"`
	// The timespan (msec) of acknowledged packets in the receiver's buffer
	MsReceiveBuf uint64 `json:"msReceiveBuf"`
	// Timestamp-based Packet Delivery Delay value set on the socket via SRTO_RCVLATENCY or SRTO_LATENCY
	MsReceiveTsbPdDelay uint64 `json:"msReceiveTsbPdDelay"`
	// Instant value of the packet reorder tolerance
	PacketsReorderTolerance uint64 `json:"packetsReorderTolerance"`
	// Accumulated difference between the current time and the time-to-play of a packet that is received late
	PacketsReceivedAvgBelatedTime uint64 `json:"packetsReceivedAvgBelatedTime"`
	// Percentage of resent data vs. sent data
	PacketsSendLossRate float64 `json:"packetsSendLossRate"`
	// Percentage of retransmitted data vs. received data
	PacketsReceivedLossRate float64 `json:"packetsReceivedLossRate"`

	OutboundFramesDiscarded uint64 `json:"outboundFramesDiscarded"`
}

APISRTConn is a SRT connection.

type APISRTConnList

type APISRTConnList struct {
	ItemCount int          `json:"itemCount"`
	PageCount int          `json:"pageCount"`
	Items     []APISRTConn `json:"items"`
}

APISRTConnList is a list of SRT connections.

type APISRTConnState

type APISRTConnState string

APISRTConnState is the state of a SRT connection.

const (
	APISRTConnStateIdle    APISRTConnState = "idle"
	APISRTConnStateRead    APISRTConnState = "read"
	APISRTConnStatePublish APISRTConnState = "publish"
)

states.

type APISRTServer

type APISRTServer interface {
	APIConnsList() (*APISRTConnList, error)
	APIConnsGet(uuid.UUID) (*APISRTConn, error)
	APIConnsKick(uuid.UUID) error
}

APISRTServer contains methods used by the API and Metrics server.

type APIWebRTCServer

type APIWebRTCServer interface {
	APISessionsList() (*APIWebRTCSessionList, error)
	APISessionsGet(uuid.UUID) (*APIWebRTCSession, error)
	APISessionsKick(uuid.UUID) error
}

APIWebRTCServer contains methods used by the API and Metrics server.

type APIWebRTCSession

type APIWebRTCSession struct {
	ID                        uuid.UUID             `json:"id"`
	Created                   time.Time             `json:"created"`
	RemoteAddr                string                `json:"remoteAddr"`
	PeerConnectionEstablished bool                  `json:"peerConnectionEstablished"`
	LocalCandidate            string                `json:"localCandidate"`
	RemoteCandidate           string                `json:"remoteCandidate"`
	State                     APIWebRTCSessionState `json:"state"`
	Path                      string                `json:"path"`
	Query                     string                `json:"query"`
	User                      string                `json:"user"`
	UserAgent                 string                `json:"userAgent"`
	InboundBytes              uint64                `json:"inboundBytes"`
	InboundRTPPackets         uint64                `json:"inboundRTPPackets"`
	InboundRTPPacketsLost     uint64                `json:"inboundRTPPacketsLost"`
	InboundRTPPacketsJitter   float64               `json:"inboundRTPPacketsJitter"`
	InboundRTCPPackets        uint64                `json:"inboundRTCPPackets"`
	OutboundBytes             uint64                `json:"outboundBytes"`
	OutboundRTPPackets        uint64                `json:"outboundRTPPackets"`
	OutboundRTCPPackets       uint64                `json:"outboundRTCPPackets"`
	OutboundFramesDiscarded   uint64                `json:"outboundFramesDiscarded"`
	// deprecated
	BytesReceived       uint64  `json:"bytesReceived" deprecated:"true"`
	BytesSent           uint64  `json:"bytesSent" deprecated:"true"`
	RTPPacketsReceived  uint64  `json:"rtpPacketsReceived" deprecated:"true"`
	RTPPacketsSent      uint64  `json:"rtpPacketsSent" deprecated:"true"`
	RTPPacketsLost      uint64  `json:"rtpPacketsLost" deprecated:"true"`
	RTPPacketsJitter    float64 `json:"rtpPacketsJitter" deprecated:"true"`
	RTCPPacketsReceived uint64  `json:"rtcpPacketsReceived" deprecated:"true"`
	RTCPPacketsSent     uint64  `json:"rtcpPacketsSent" deprecated:"true"`
}

APIWebRTCSession is a WebRTC session.

type APIWebRTCSessionList

type APIWebRTCSessionList struct {
	ItemCount int                `json:"itemCount"`
	PageCount int                `json:"pageCount"`
	Items     []APIWebRTCSession `json:"items"`
}

APIWebRTCSessionList is a list of WebRTC sessions.

type APIWebRTCSessionState

type APIWebRTCSessionState string

APIWebRTCSessionState is the state of a WebRTC connection.

const (
	APIWebRTCSessionStateRead    APIWebRTCSessionState = "read"
	APIWebRTCSessionStatePublish APIWebRTCSessionState = "publish"
)

states.

type Path

type Path interface {
	Name() string
	SafeConf() *conf.Path
	ExternalCmdEnv() externalcmd.Environment
	RemovePublisher(req PathRemovePublisherReq)
	RemoveReader(req PathRemoveReaderReq)
}

Path is a path.

type PathAccessRequest

type PathAccessRequest struct {
	Name      string
	Query     string
	UserAgent string
	Publish   bool
	SkipAuth  bool

	// only if skipAuth = false
	Proto                auth.Protocol
	ID                   *uuid.UUID
	Credentials          *auth.Credentials
	IP                   net.IP
	CustomVerifyFunc     func(expectedUser string, expectedPass string) bool
	EnableAskCredentials bool
}

PathAccessRequest is a path access request.

func (*PathAccessRequest) ToAuthRequest

func (r *PathAccessRequest) ToAuthRequest() *auth.Request

ToAuthRequest converts a path access request into an authentication request.

type PathAddPublisherReq

type PathAddPublisherReq struct {
	Author        Publisher
	Desc          *description.Session
	UseRTPPackets bool
	ReplaceNTP    bool
	ConfToCompare *conf.Path
	AccessRequest PathAccessRequest
	Res           chan PathAddPublisherRes
}

PathAddPublisherReq contains arguments of AddPublisher().

type PathAddPublisherRes

type PathAddPublisherRes struct {
	Path      Path
	User      string
	SubStream *stream.SubStream
	Err       error
}

PathAddPublisherRes contains the response of AddPublisher().

type PathAddReaderReq

type PathAddReaderReq struct {
	Author        Reader
	AccessRequest PathAccessRequest
	Res           chan PathAddReaderRes
}

PathAddReaderReq contains arguments of AddReader().

type PathAddReaderRes

type PathAddReaderRes struct {
	Path   Path
	User   string
	Stream *stream.Stream
	Err    error
}

PathAddReaderRes contains the response of AddReader().

type PathDescribeReq

type PathDescribeReq struct {
	Author        logger.Writer
	AccessRequest PathAccessRequest
	Res           chan PathDescribeRes
}

PathDescribeReq contains arguments of Describe().

type PathDescribeRes

type PathDescribeRes struct {
	Path     Path
	Stream   *stream.Stream
	Redirect string
	Err      error
}

PathDescribeRes contains the response of Describe().

type PathFindPathConfReq

type PathFindPathConfReq struct {
	Author        logger.Writer
	AccessRequest PathAccessRequest
	Res           chan PathFindPathConfRes
}

PathFindPathConfReq contains arguments of FindPathConf().

type PathFindPathConfRes

type PathFindPathConfRes struct {
	Conf *conf.Path
	User string
	Err  error
}

PathFindPathConfRes contains the response of FindPathConf().

type PathNoStreamAvailableError

type PathNoStreamAvailableError struct {
	PathName string
}

PathNoStreamAvailableError is returned when no one is publishing.

func (*PathNoStreamAvailableError) Error

Error implements the error interface.

type PathRemovePublisherReq

type PathRemovePublisherReq struct {
	Author Publisher
	Res    chan struct{}
}

PathRemovePublisherReq contains arguments of RemovePublisher().

type PathRemoveReaderReq

type PathRemoveReaderReq struct {
	Author Reader
	Res    chan struct{}
}

PathRemoveReaderReq contains arguments of RemoveReader().

type PathSourceStaticSetNotReadyReq

type PathSourceStaticSetNotReadyReq struct {
	Res chan struct{}
}

PathSourceStaticSetNotReadyReq contains arguments of SetNotReady().

type PathSourceStaticSetReadyReq

type PathSourceStaticSetReadyReq struct {
	Desc          *description.Session
	UseRTPPackets bool
	ReplaceNTP    bool
	Res           chan PathSourceStaticSetReadyRes
}

PathSourceStaticSetReadyReq contains arguments of SetReady().

type PathSourceStaticSetReadyRes

type PathSourceStaticSetReadyRes struct {
	SubStream *stream.SubStream
	Err       error
}

PathSourceStaticSetReadyRes contains the response of SetReady().

type Publisher

type Publisher interface {
	Source
	Close()
}

Publisher is an entity that can publish a stream.

type Reader

type Reader interface {
	logger.Writer
	Close()
	APIReaderDescribe() *APIPathReader
}

Reader is an entity that can read a stream.

type Source

type Source interface {
	logger.Writer
	APISourceDescribe() *APIPathSource
}

Source is an entity that can provide a stream. it can be: - Publisher - staticsources.Handler - core.sourceRedirect

type StaticSourceRunParams

type StaticSourceRunParams struct {
	Context        context.Context
	ResolvedSource string
	Conf           *conf.Path
	ReloadConf     chan *conf.Path
}

StaticSourceRunParams is the set of params passed to Run().

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL