state

package
v0.52.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package state controls the source of the RTP packets being written to the stream's subscribers and ensures there is only one active at a time while there are peer connections to receive RTP packets.

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("StreamState already closed")

ErrClosed indicates that the StreamState is already closed.

Functions

This section is empty.

Types

type StreamState

type StreamState struct {
	// Stream is the StreamState's stream
	Stream gostream.Stream
	// contains filtered or unexported fields
}

StreamState controls the source of the RTP packets being written to the stream's subscribers and ensures there is only one active at a time while there are subsribers.

func New

func New(
	stream gostream.Stream,
	r robot.Robot,
	logger logging.Logger,
) *StreamState

New returns a new *StreamState. rtpPassthroughSource is allowed to be nil if the camere does not implement rtppassthrough.Source.

func (*StreamState) Close

func (state *StreamState) Close() error

Close closes the StreamState.

func (*StreamState) Decrement

func (state *StreamState) Decrement() error

Decrement decrements the peer connections subscribed to the stream.

func (*StreamState) Increment

func (state *StreamState) Increment() error

Increment increments the peer connections subscribed to the stream.

Jump to

Keyboard shortcuts

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