output

package
v0.0.0-...-75edfd4 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Width  int
	Height int
	FPS    int
}

Config holds common configuration for all output 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) Name

func (m *MJPEGOutput) Name() string

Name returns the output type name

func (*MJPEGOutput) Start

func (m *MJPEGOutput) Start() error

Start initializes the MJPEG output Note: The HTTP handler is registered separately via GetHTTPHandler()

func (*MJPEGOutput) Stop

func (m *MJPEGOutput) Stop() error

Stop cleanly shuts down the output

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.

Jump to

Keyboard shortcuts

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