Documentation ¶
Overview ¶
Package defs contains shared definitions.
Index ¶
- func MediasDescription(medias []*description.Media) []string
- func MediasInfo(medias []*description.Media) string
- type APIError
- type APIHLSMuxer
- type APIHLSMuxerList
- type APIPath
- type APIPathConfList
- type APIPathList
- type APIPathSourceOrReader
- type APIRTMPConn
- type APIRTMPConnList
- type APIRTMPConnState
- type APIRTSPConn
- type APIRTSPConnsList
- type APIRTSPSession
- type APIRTSPSessionList
- type APIRTSPSessionState
- type APISRTConn
- type APISRTConnList
- type APISRTConnState
- type APIWebRTCSession
- type APIWebRTCSessionList
- type APIWebRTCSessionState
- type AuthProtocol
- type AuthenticationError
- type Path
- type PathAccessRequest
- type PathAddPublisherReq
- type PathAddPublisherRes
- type PathAddReaderReq
- type PathAddReaderRes
- type PathDescribeReq
- type PathDescribeRes
- type PathGetConfForPathReq
- type PathGetConfForPathRes
- type PathManager
- type PathNoOnePublishingError
- type PathRemovePublisherReq
- type PathRemoveReaderReq
- type PathSourceStaticSetNotReadyReq
- type PathSourceStaticSetReadyReq
- type PathSourceStaticSetReadyRes
- type PathStartPublisherReq
- type PathStartPublisherRes
- type PathStopPublisherReq
- type Publisher
- type Reader
- type Source
- type StaticSource
- type StaticSourceParent
- type StaticSourceRunParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MediasDescription ¶ added in v1.4.0
func MediasDescription(medias []*description.Media) []string
MediasDescription returns the description of medias.
func MediasInfo ¶ added in v1.4.0
func MediasInfo(medias []*description.Media) string
MediasInfo returns the description of medias.
Types ¶
type APIHLSMuxer ¶
type APIHLSMuxer struct { Path string `json:"path"` Created time.Time `json:"created"` LastRequest time.Time `json:"lastRequest"` BytesSent uint64 `json:"bytesSent"` }
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 APIPath ¶
type APIPath struct { Name string `json:"name"` ConfName string `json:"confName"` Source *APIPathSourceOrReader `json:"source"` Ready bool `json:"ready"` ReadyTime *time.Time `json:"readyTime"` Tracks []string `json:"tracks"` BytesReceived uint64 `json:"bytesReceived"` BytesSent uint64 `json:"bytesSent"` Readers []APIPathSourceOrReader `json:"readers"` }
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 APIPathSourceOrReader ¶
APIPathSourceOrReader is a source or a reader.
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"` BytesReceived uint64 `json:"bytesReceived"` BytesSent uint64 `json:"bytesSent"` }
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 APIRTSPConn ¶
type APIRTSPConn struct { ID uuid.UUID `json:"id"` Created time.Time `json:"created"` RemoteAddr string `json:"remoteAddr"` BytesReceived uint64 `json:"bytesReceived"` BytesSent uint64 `json:"bytesSent"` }
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 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"` Transport *string `json:"transport"` BytesReceived uint64 `json:"bytesReceived"` BytesSent uint64 `json:"bytesSent"` }
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 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"` BytesReceived uint64 `json:"bytesReceived"` BytesSent uint64 `json:"bytesSent"` }
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 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"` BytesReceived uint64 `json:"bytesReceived"` BytesSent uint64 `json:"bytesSent"` }
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 AuthProtocol ¶ added in v1.4.0
type AuthProtocol string
AuthProtocol is a authentication protocol.
const ( AuthProtocolRTSP AuthProtocol = "rtsp" AuthProtocolRTMP AuthProtocol = "rtmp" AuthProtocolHLS AuthProtocol = "hls" AuthProtocolWebRTC AuthProtocol = "webrtc" AuthProtocolSRT AuthProtocol = "srt" )
authentication protocols.
type AuthenticationError ¶ added in v1.4.2
type AuthenticationError struct {
Message string
}
AuthenticationError is a authentication error.
func (AuthenticationError) Error ¶ added in v1.4.2
func (e AuthenticationError) Error() string
Error implements the error interface.
type Path ¶ added in v1.4.0
type Path interface { Name() string SafeConf() *conf.Path ExternalCmdEnv() externalcmd.Environment StartPublisher(req PathStartPublisherReq) PathStartPublisherRes StopPublisher(req PathStopPublisherReq) RemovePublisher(req PathRemovePublisherReq) RemoveReader(req PathRemoveReaderReq) }
Path is a path.
type PathAccessRequest ¶ added in v1.4.0
type PathAccessRequest struct { Name string Query string Publish bool SkipAuth bool // only if skipAuth = false IP net.IP User string Pass string Proto AuthProtocol ID *uuid.UUID RTSPRequest *base.Request RTSPBaseURL *base.URL RTSPNonce string }
PathAccessRequest is an access request.
type PathAddPublisherReq ¶ added in v1.4.0
type PathAddPublisherReq struct { Author Publisher AccessRequest PathAccessRequest Res chan PathAddPublisherRes }
PathAddPublisherReq contains arguments of AddPublisher().
type PathAddPublisherRes ¶ added in v1.4.0
PathAddPublisherRes contains the response of AddPublisher().
type PathAddReaderReq ¶ added in v1.4.0
type PathAddReaderReq struct { Author Reader AccessRequest PathAccessRequest Res chan PathAddReaderRes }
PathAddReaderReq contains arguments of AddReader().
type PathAddReaderRes ¶ added in v1.4.0
PathAddReaderRes contains the response of AddReader().
type PathDescribeReq ¶ added in v1.4.0
type PathDescribeReq struct { AccessRequest PathAccessRequest Res chan PathDescribeRes }
PathDescribeReq contains arguments of Describe().
type PathDescribeRes ¶ added in v1.4.0
PathDescribeRes contains the response of Describe().
type PathGetConfForPathReq ¶ added in v1.4.0
type PathGetConfForPathReq struct { AccessRequest PathAccessRequest Res chan PathGetConfForPathRes }
PathGetConfForPathReq contains arguments of GetConfForPath().
type PathGetConfForPathRes ¶ added in v1.4.0
PathGetConfForPathRes contains the response of GetConfForPath().
type PathManager ¶ added in v1.4.0
type PathManager interface { GetConfForPath(req PathGetConfForPathReq) PathGetConfForPathRes Describe(req PathDescribeReq) PathDescribeRes AddPublisher(req PathAddPublisherReq) PathAddPublisherRes AddReader(req PathAddReaderReq) PathAddReaderRes }
PathManager is a path manager.
type PathNoOnePublishingError ¶ added in v1.4.2
type PathNoOnePublishingError struct {
PathName string
}
PathNoOnePublishingError is returned when no one is publishing.
func (PathNoOnePublishingError) Error ¶ added in v1.4.2
func (e PathNoOnePublishingError) Error() string
Error implements the error interface.
type PathRemovePublisherReq ¶ added in v1.4.0
type PathRemovePublisherReq struct { Author Publisher Res chan struct{} }
PathRemovePublisherReq contains arguments of RemovePublisher().
type PathRemoveReaderReq ¶ added in v1.4.0
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 GenerateRTPPackets bool Res chan PathSourceStaticSetReadyRes }
PathSourceStaticSetReadyReq contains arguments of SetReady().
type PathSourceStaticSetReadyRes ¶
PathSourceStaticSetReadyRes contains the response of SetReadu().
type PathStartPublisherReq ¶ added in v1.4.0
type PathStartPublisherReq struct { Author Publisher Desc *description.Session GenerateRTPPackets bool Res chan PathStartPublisherRes }
PathStartPublisherReq contains arguments of StartPublisher().
type PathStartPublisherRes ¶ added in v1.4.0
PathStartPublisherRes contains the response of StartPublisher().
type PathStopPublisherReq ¶ added in v1.4.0
type PathStopPublisherReq struct { Author Publisher Res chan struct{} }
PathStopPublisherReq contains arguments of StopPublisher().
type Publisher ¶ added in v1.4.0
type Publisher interface { Source Close() }
Publisher is an entity that can publish a stream.
type Reader ¶ added in v1.4.0
type Reader interface { Close() APIReaderDescribe() APIPathSourceOrReader }
Reader is an entity that can read a stream.
type Source ¶ added in v1.4.0
type Source interface { logger.Writer APISourceDescribe() APIPathSourceOrReader }
Source is an entity that can provide a stream. it can be: - publisher - staticSourceHandler - redirectSource
type StaticSource ¶
type StaticSource interface { logger.Writer Run(StaticSourceRunParams) error APISourceDescribe() APIPathSourceOrReader }
StaticSource is a static source.
type StaticSourceParent ¶
type StaticSourceParent interface { logger.Writer SetReady(req PathSourceStaticSetReadyReq) PathSourceStaticSetReadyRes SetNotReady(req PathSourceStaticSetNotReadyReq) }
StaticSourceParent is the parent of a static source.