Documentation
¶
Index ¶
- type Config
- type MJPEGOutput
- func (m *MJPEGOutput) GetClientCount() int
- func (m *MJPEGOutput) GetControlHandler() http.HandlerFunc
- func (m *MJPEGOutput) GetDroppedFrames() uint64
- func (m *MJPEGOutput) GetFrameCount() uint64
- func (m *MJPEGOutput) GetHTTPHandler() http.HandlerFunc
- func (m *MJPEGOutput) GetStatsHandler() http.HandlerFunc
- func (m *MJPEGOutput) GetViewerHandler() http.HandlerFunc
- func (m *MJPEGOutput) IsRunning() bool
- func (m *MJPEGOutput) Name() string
- func (m *MJPEGOutput) Start() error
- func (m *MJPEGOutput) Stop() error
- func (m *MJPEGOutput) WriteFrame(frame *image.RGBA) error
- type Output
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MJPEGOutput ¶
type MJPEGOutput struct {
// contains filtered or unexported fields
}
MJPEGOutput streams frames as Motion JPEG over HTTP This allows users to open the stream in a browser tab and share that tab in Discord
func NewMJPEGOutput ¶
func NewMJPEGOutput(config Config) *MJPEGOutput
NewMJPEGOutput creates a new MJPEG stream output
func (*MJPEGOutput) GetClientCount ¶
func (m *MJPEGOutput) GetClientCount() int
GetClientCount returns the number of connected clients
func (*MJPEGOutput) GetControlHandler ¶
func (m *MJPEGOutput) GetControlHandler() http.HandlerFunc
GetControlHandler returns an HTTP handler that displays the stream with control UI
func (*MJPEGOutput) GetDroppedFrames ¶
func (m *MJPEGOutput) GetDroppedFrames() uint64
GetDroppedFrames returns the total number of dropped frames
func (*MJPEGOutput) GetFrameCount ¶
func (m *MJPEGOutput) GetFrameCount() uint64
GetFrameCount returns the total number of frames sent
func (*MJPEGOutput) GetHTTPHandler ¶
func (m *MJPEGOutput) GetHTTPHandler() http.HandlerFunc
GetHTTPHandler returns an http.Handler for the MJPEG stream Mount this at /stream or similar endpoint
func (*MJPEGOutput) GetStatsHandler ¶
func (m *MJPEGOutput) GetStatsHandler() http.HandlerFunc
GetStatsHandler returns an HTTP handler that shows stream statistics
func (*MJPEGOutput) GetViewerHandler ¶
func (m *MJPEGOutput) GetViewerHandler() http.HandlerFunc
GetViewerHandler returns an HTTP handler that displays a clean stream viewer with subtle hover nav
func (*MJPEGOutput) IsRunning ¶
func (m *MJPEGOutput) IsRunning() bool
IsRunning returns true if the output is active
func (*MJPEGOutput) Start ¶
func (m *MJPEGOutput) Start() error
Start initializes the MJPEG output Note: The HTTP handler is registered separately via GetHTTPHandler()
func (*MJPEGOutput) WriteFrame ¶
func (m *MJPEGOutput) WriteFrame(frame *image.RGBA) error
WriteFrame sends a frame to all connected clients
type Output ¶
type Output interface {
// Start initializes the output mechanism
Start() error
// Stop cleanly shuts down the output
Stop() error
// WriteFrame sends a frame to the output
// The image is expected to be in RGBA format
WriteFrame(frame *image.RGBA) error
// Name returns a human-readable name for this output type
Name() string
// IsRunning returns true if the output is currently active
IsRunning() bool
}
Output defines the interface for frame output mechanisms. This allows us to swap between different output methods: - MJPEG HTTP stream - X11 window display - V4L2 virtual camera - etc.