streamsrv

package
v0.0.0-...-d4ca6eb Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

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

func NewStreamServer(frames_channel <-chan []byte, w int, h int, po int, pa string) *StreamServer

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.

Jump to

Keyboard shortcuts

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