Documentation
¶
Overview ¶
package streamsrv provides streaming of video frames to a connected host. The video frames are read from a []byte-channel. Additional format information like width and hight is passed when creating the server. Note that the server does not check if the frames are actually in the correct format. Note that the server expects 8-bit grayscale frames.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StreamServer ¶
type StreamServer struct {
// contains filtered or unexported fields
}
StreamServer is a server that streams video frames to a connected host. The video frames are read from a []byte-channel.
func NewStreamServer ¶
NewStreamServer creates a new StreamServer with the given channel for frames.
func (*StreamServer) Start ¶
func (strsrv *StreamServer) Start() error
Start function starts the stream server on the given port. It registers the handler function serve_stream for the path specified in the StreamServer. It spawns a closure that starts the server and listens for incoming requests. The closure returns if the server is stopped.
func (*StreamServer) Stop ¶
func (strsrv *StreamServer) Stop() error
Stop function stops the stream server. It closes the exit channel to signal the handler function to return. It then closes the http server and cancels the server context.