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 ¶
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 ¶
New returns a new *StreamState. rtpPassthroughSource is allowed to be nil if the camere does not implement rtppassthrough.Source.
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.
func (*StreamState) Reset ¶ added in v0.53.0
func (state *StreamState) Reset() error
Reset notifies that the gostream source has been reset to the original resolution. This will restart the passthrough stream if it is supported.
func (*StreamState) Resize ¶ added in v0.53.0
func (state *StreamState) Resize() error
Resize notifies that the gostream source has been resized. This will stop and prevent the use of the passthrough stream if it is supported.