Documentation
¶
Index ¶
- func RenditionDefaultIndex(renditions []*Rendition) int
- func SortResponses(items []*StreamResponse)
- func UpstreamEnabled(upstream *Upstream) bool
- func UpstreamName(index int, upstream *Upstream) string
- func UpstreamServeStream(upstream *Upstream) bool
- func UpstreamSourceType(upstream *Upstream) string
- func ValidateUpstream(upstream *Upstream) error
- func VariantName(groupName, renditionName string) string
- type CapabilitiesResponse
- type Config
- type Group
- type Manager
- func (m *Manager) CalibrationTargets(name, quality string) []*Stream
- func (m *Manager) Capabilities(name string) (*CapabilitiesResponse, bool, error)
- func (m *Manager) Close()
- func (m *Manager) Create(req *StreamRequest) (*StreamResponse, error)
- func (m *Manager) Delete(name string) error
- func (m *Manager) Get(name string) (*StreamResponse, bool)
- func (m *Manager) List() []*Stream
- func (m *Manager) ListExpanded() []*Stream
- func (m *Manager) ListExpandedActive() []*Stream
- func (m *Manager) ListResponses() []*StreamResponse
- func (m *Manager) Save() error
- func (m *Manager) SetEnabled(name string, enabled bool) (*StreamResponse, error)
- func (m *Manager) Start(name, quality string) (*StreamResponse, error)
- func (m *Manager) Stop(name, quality string) (*StreamResponse, error)
- func (m *Manager) StreamByIndex(index int) (*Stream, bool)
- func (m *Manager) StreamByName(name string) (*Stream, bool)
- func (m *Manager) StreamByNameAny(name string) (*Stream, bool)
- func (m *Manager) StreamByNameQuality(name, quality string) (*Stream, bool)
- func (m *Manager) StreamByNameQualityAny(name, quality string) (*Stream, bool)
- func (m *Manager) Update(name string, req *StreamRequest) (*StreamResponse, error)
- func (m *Manager) UpdateMode(name string, req *ModeRequest) (*StreamResponse, error)
- type ManagerOption
- type ModeRequest
- type Rendition
- type RenditionResponse
- type Stream
- func (s *Stream) ActiveClientCount() int32
- func (s *Stream) EnsureStarted()
- func (s *Stream) FiberHandler() fiber.Handler
- func (s *Stream) HandleWebsocket(conn *websocket.Conn)
- func (s *Stream) HasActiveRecording() bool
- func (s *Stream) MaybeScheduleStop(idle time.Duration)
- func (s *Stream) StopNow() error
- type StreamRequest
- type StreamResponse
- type Upstream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenditionDefaultIndex ¶
func SortResponses ¶
func SortResponses(items []*StreamResponse)
func UpstreamEnabled ¶
func UpstreamName ¶
func UpstreamServeStream ¶
func UpstreamSourceType ¶
func ValidateUpstream ¶
func VariantName ¶
Types ¶
type CapabilitiesResponse ¶
type CapabilitiesResponse struct {
Name string `json:"name"`
SourceType string `json:"sourceType"`
Device string `json:"device,omitempty"`
Capabilities *gwebrtp.UsbDeviceCapabilities `json:"capabilities,omitempty"`
}
type Config ¶
type Config struct {
TelemetryServiceName *string `yaml:"telemetryServiceName"`
TelemetryEndpoint *string `yaml:"telemetryEndpoint"`
Upstreams []*Upstream `yaml:"upstreams"`
}
func LoadConfig ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(options ...ManagerOption) (*Manager, error)
func (*Manager) CalibrationTargets ¶
func (*Manager) Capabilities ¶
func (m *Manager) Capabilities(name string) (*CapabilitiesResponse, bool, error)
func (*Manager) Create ¶
func (m *Manager) Create(req *StreamRequest) (*StreamResponse, error)
func (*Manager) ListExpanded ¶
func (*Manager) ListExpandedActive ¶
func (*Manager) ListResponses ¶
func (m *Manager) ListResponses() []*StreamResponse
func (*Manager) SetEnabled ¶
func (m *Manager) SetEnabled(name string, enabled bool) (*StreamResponse, error)
func (*Manager) StreamByNameQuality ¶
func (*Manager) StreamByNameQualityAny ¶
func (*Manager) Update ¶
func (m *Manager) Update(name string, req *StreamRequest) (*StreamResponse, error)
func (*Manager) UpdateMode ¶
func (m *Manager) UpdateMode(name string, req *ModeRequest) (*StreamResponse, error)
type ManagerOption ¶
type ManagerOption func(*managerOptions) error
func WithConfig ¶
func WithConfig(cfg *Config) ManagerOption
func WithConfigFile ¶
func WithConfigFile(path string) ManagerOption
type ModeRequest ¶
type Rendition ¶
type Rendition struct {
Name string `yaml:"name" json:"name"`
Width *int `yaml:"width,omitempty" json:"width,omitempty"`
Height *int `yaml:"height,omitempty" json:"height,omitempty"`
FrameRate *float64 `yaml:"frameRate,omitempty" json:"frameRate,omitempty"`
BitrateKbps *int `yaml:"bitrateKbps,omitempty" json:"bitrateKbps,omitempty"`
OnDemand *bool `yaml:"onDemand,omitempty" json:"onDemand,omitempty"`
}
type RenditionResponse ¶
type RenditionResponse struct {
Name string `json:"name"`
Width *int `json:"width,omitempty"`
Height *int `json:"height,omitempty"`
FrameRate *float64 `json:"frameRate,omitempty"`
BitrateKbps *int `json:"bitrateKbps,omitempty"`
OnDemand bool `json:"onDemand"`
WsPath string `json:"wsPath"`
Stats *gwebrtp.StreamStats `json:"stats,omitempty"`
}
type Stream ¶
type Stream struct {
Name string
GroupName string
RenditionName string
URL string
Inst *gwebrtp.Instance
Hub *gwebrtp.Hub
Stop func() error
OnDemand bool
// contains filtered or unexported fields
}
func (*Stream) ActiveClientCount ¶
func (*Stream) EnsureStarted ¶
func (s *Stream) EnsureStarted()
func (*Stream) FiberHandler ¶
func (*Stream) HandleWebsocket ¶
func (*Stream) HasActiveRecording ¶
func (*Stream) MaybeScheduleStop ¶
type StreamRequest ¶
type StreamRequest struct {
Name *string `json:"name"`
SourceType *string `json:"sourceType"`
RtspUrl string `json:"rtspUrl"`
Device string `json:"device"`
Path string `json:"path"`
Codec string `json:"codec"`
Width *int `json:"width"`
Height *int `json:"height"`
FrameRate *float64 `json:"frameRate"`
BitrateKbps *int `json:"bitrateKbps"`
ServeStream *bool `json:"serveStream,omitempty"`
CalibrationFrom string `json:"calibrationFrom,omitempty"`
KeyframeSink string `json:"keyframeSink,omitempty"`
KeyframeOutput string `json:"keyframeOutput,omitempty"`
KeyframeFormat string `json:"keyframeFormat,omitempty"`
KeyframeMqttURL string `json:"keyframeMqttUrl,omitempty"`
KeyframeMqttTopic string `json:"keyframeMqttTopic,omitempty"`
Keyframer gwebrtp.Keyframer `json:"-"`
Enabled *bool `json:"enabled"`
OnDemand bool `json:"onDemand"`
Renditions []*Rendition `json:"renditions"`
}
type StreamResponse ¶
type StreamResponse struct {
Index int `json:"index"`
Name string `json:"name"`
SourceType string `json:"sourceType"`
RtspUrl string `json:"rtspUrl,omitempty"`
Device string `json:"device,omitempty"`
Path string `json:"path,omitempty"`
Codec string `json:"codec,omitempty"`
Width *int `json:"width,omitempty"`
Height *int `json:"height,omitempty"`
FrameRate *float64 `json:"frameRate,omitempty"`
BitrateKbps *int `json:"bitrateKbps,omitempty"`
ServeStream bool `json:"serveStream"`
CalibrationFrom string `json:"calibrationFrom,omitempty"`
KeyframeSink string `json:"keyframeSink,omitempty"`
KeyframeOutput string `json:"keyframeOutput,omitempty"`
KeyframeFormat string `json:"keyframeFormat,omitempty"`
KeyframeMqttURL string `json:"keyframeMqttUrl,omitempty"`
KeyframeMqttTopic string `json:"keyframeMqttTopic,omitempty"`
Enabled bool `json:"enabled"`
OnDemand bool `json:"onDemand,omitempty"`
URL string `json:"url"`
WsPath string `json:"wsPath"`
Stats *gwebrtp.StreamStats `json:"stats"`
Renditions []*RenditionResponse `json:"renditions,omitempty"`
ActiveRendition string `json:"activeRendition,omitempty"`
}
type Upstream ¶
type Upstream struct {
Name *string `yaml:"name" json:"name,omitempty"`
SourceType *string `yaml:"sourceType" json:"sourceType,omitempty"`
RtspUrl string `yaml:"rtspUrl" json:"rtspUrl,omitempty"`
Device string `yaml:"device" json:"device,omitempty"`
Path string `yaml:"path" json:"path,omitempty"`
Codec string `yaml:"codec" json:"codec,omitempty"`
H264Profile *string `yaml:"h264Profile" json:"h264Profile,omitempty"`
Width *int `yaml:"width" json:"width,omitempty"`
Height *int `yaml:"height" json:"height,omitempty"`
FrameRate *float64 `yaml:"frameRate" json:"frameRate,omitempty"`
BitrateKbps *int `yaml:"bitrateKbps" json:"bitrateKbps,omitempty"`
ServeStream *bool `yaml:"serveStream,omitempty" json:"serveStream,omitempty"`
CalibrationFrom string `yaml:"calibrationFrom,omitempty" json:"calibrationFrom,omitempty"`
KeyframeSink string `yaml:"keyframeSink" json:"keyframeSink,omitempty"`
KeyframeOutput string `yaml:"keyframeOutput" json:"keyframeOutput,omitempty"`
KeyframeFormat string `yaml:"keyframeFormat" json:"keyframeFormat,omitempty"`
KeyframeMqttURL string `yaml:"keyframeMqttUrl,omitempty" json:"keyframeMqttUrl,omitempty"`
KeyframeMqttTopic string `yaml:"keyframeMqttTopic,omitempty" json:"keyframeMqttTopic,omitempty"`
Keyframer gwebrtp.Keyframer `yaml:"-" json:"-"`
Enabled *bool `yaml:"enabled" json:"enabled,omitempty"`
OnDemand bool `yaml:"onDemand" json:"onDemand,omitempty"`
Renditions []*Rendition `yaml:"renditions" json:"renditions,omitempty"`
}
func RequestUpstream ¶
func RequestUpstream(req *StreamRequest) (*Upstream, error)
func UpstreamWithRendition ¶
Click to show internal directories.
Click to hide internal directories.