Documentation ¶
Index ¶
- Variables
- func DisableCamera(app *Application) func(ctx *gin.Context)
- func EnableCamera(app *Application) func(ctx *gin.Context)
- func HLSWrapper(app *Application) func(ctx *gin.Context)
- func ListWrapper(app *Application) func(ctx *gin.Context)
- func StatusWrapper(app *Application) func(ctx *gin.Context)
- func WebSocketWrapper(app *Application, wsUpgrader *websocket.Upgrader) func(ctx *gin.Context)
- type APIConfiguration
- type Application
- type EnablePostData
- type HLSInfo
- type ServerInfo
- type StreamConfiguration
- type StreamInfoShorten
- type StreamsInfoShortenList
- type StreamsStorage
- type VideoConfiguration
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func DisableCamera ¶ added in v0.3.2
func DisableCamera(app *Application) func(ctx *gin.Context)
DisableCamera turns off stream for specific stream ID
func EnableCamera ¶ added in v0.3.2
func EnableCamera(app *Application) func(ctx *gin.Context)
EnableCamera adds new stream if does not exist
func HLSWrapper ¶ added in v0.2.0
func HLSWrapper(app *Application) func(ctx *gin.Context)
HLSWrapper returns HLS handler (static files)
func ListWrapper ¶ added in v0.2.0
func ListWrapper(app *Application) func(ctx *gin.Context)
ListWrapper returns list of streams
func StatusWrapper ¶ added in v0.2.0
func StatusWrapper(app *Application) func(ctx *gin.Context)
StatusWrapper returns statuses for list of streams
func WebSocketWrapper ¶ added in v0.2.0
func WebSocketWrapper(app *Application, wsUpgrader *websocket.Upgrader) func(ctx *gin.Context)
WebSocketWrapper returns WS handler
Types ¶
type APIConfiguration ¶ added in v0.4.0
type APIConfiguration struct { Enabled bool `json:"-"` Host string `json:"host"` Port int32 `json:"port"` Mode string `json:"-"` }
APIConfiguration is just copy of configuration.APIConfiguration but with some not exported fields
type Application ¶ added in v0.2.0
type Application struct { APICfg APIConfiguration `json:"api"` VideoServerCfg VideoConfiguration `json:"video"` Streams StreamsStorage `json:"streams"` HLS HLSInfo `json:"hls"` CorsConfig *cors.Config `json:"-"` }
Application is a configuration parameters for application
func NewApplication ¶ added in v0.2.0
func NewApplication(cfg *configuration.Configuration) (*Application, error)
NewApplication Prepare configuration for application
func (*Application) StartAPIServer ¶ added in v0.3.2
func (app *Application) StartAPIServer()
StartAPIServer starts server with API functionality
func (*Application) StartStream ¶ added in v0.3.2
func (app *Application) StartStream(k uuid.UUID)
StartStream starts single video stream
func (*Application) StartStreams ¶ added in v0.2.0
func (app *Application) StartStreams()
StartStreams starts all video streams
func (*Application) StartVideoServer ¶ added in v0.3.2
func (app *Application) StartVideoServer()
StartVideoServer initializes "video" server and run it (MSE-websockets and HLS-static files)
type EnablePostData ¶ added in v0.3.2
type EnablePostData struct { GUID uuid.UUID `json:"guid"` URL string `json:"url"` StreamTypes []string `json:"stream_types"` }
EnablePostData is a POST-body for API which enables to turn on/off specific streams
type HLSInfo ¶ added in v0.4.0
type HLSInfo struct { MsPerSegment int64 `json:"hls_ms_per_segment"` Directory string `json:"-"` WindowSize uint `json:"hls_window_size"` Capacity uint `json:"hls_window_capacity"` }
HLSInfo is an information about HLS parameters for server
type ServerInfo ¶ added in v0.2.0
type ServerInfo struct { HTTPAddr string `json:"http_addr"` VideoHTTPPort int32 `json:"http_port"` APIHTTPPort int32 `json:"-"` }
ServerInfo is an information about server
type StreamConfiguration ¶
type StreamConfiguration struct { URL string `json:"url"` Status bool `json:"status"` SupportedStreamTypes []string `json:"supported_stream_types"` Codecs []av.CodecData `json:"codecs"` Clients map[uuid.UUID]viewer `json:"-"` // contains filtered or unexported fields }
StreamConfiguration is a configuration parameters for specific stream
func NewStreamConfiguration ¶ added in v0.4.0
func NewStreamConfiguration(streamURL string, supportedTypes []string) *StreamConfiguration
NewStreamConfiguration returns default configuration
type StreamInfoShorten ¶ added in v0.4.0
type StreamInfoShorten struct {
StreamID string `json:"stream_id"`
}
type StreamsInfoShortenList ¶ added in v0.4.0
type StreamsInfoShortenList struct {
Data []StreamInfoShorten `json:"data"`
}
type StreamsStorage ¶ added in v0.4.0
type StreamsStorage struct { sync.Mutex Streams map[uuid.UUID]*StreamConfiguration `json:"rtsp_streams"` }
StreamsStorage Map wrapper for map[uuid.UUID]*StreamConfiguration with mutex for concurrent usage
func NewStreamsStorageDefault ¶ added in v0.4.0
func NewStreamsStorageDefault() StreamsStorage
NewStreamsStorageDefault prepares new allocated storage
type VideoConfiguration ¶ added in v0.4.0
type VideoConfiguration struct { Host string `json:"host"` Port int32 `json:"port"` Mode string `json:"-"` }
VideoConfiguration is just copy of configuration.VideoConfiguration but with some not exported fields