Documentation ¶
Index ¶
- Variables
- type Publisher
- func (p *Publisher) AddSubscription(subscription Subscription)
- func (p *Publisher) GetTrack() Track
- func (p *Publisher) IsStalled() bool
- func (p *Publisher) RemoveSubscription(subscription Subscription)
- func (p *Publisher) RemoveSubscriptions() []Subscription
- func (p *Publisher) ReplaceTrack(track Track)
- type RemoteTrack
- type Status
- type Subscription
- type Track
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrSubscriptionExists = errors.New("subscription already exists")
Functions ¶
This section is empty.
Types ¶
type Publisher ¶
type Publisher struct {
// contains filtered or unexported fields
}
An abstract publisher that reads the packets from the track and forwards them to all subscribers.
func NewPublisher ¶
func NewPublisher( track Track, stop <-chan struct{}, considerStalledAfter time.Duration, log *logrus.Entry, ) (*Publisher, <-chan Status)
Starts a new publisher, returns a publisher along with the channel that informs the caller about the status update of the publisher (i.e. stalled, or active). Once the channel is closed, the publisher can be considered stopped.
func (*Publisher) AddSubscription ¶
func (p *Publisher) AddSubscription(subscription Subscription)
func (*Publisher) RemoveSubscription ¶
func (p *Publisher) RemoveSubscription(subscription Subscription)
func (*Publisher) RemoveSubscriptions ¶
func (p *Publisher) RemoveSubscriptions() []Subscription
func (*Publisher) ReplaceTrack ¶
type RemoteTrack ¶
type RemoteTrack struct {
// The underlying `webrtc.TrackRemote`.
Track *webrtc.TrackRemote
}
Wrapper for the `webrtc.TrackRemote`.
func (*RemoteTrack) ReadPacket ¶
func (t *RemoteTrack) ReadPacket() (*rtp.Packet, error)
Implement the `Track` interface for the `webrtc.TrackRemote`.
type Subscription ¶
Click to show internal directories.
Click to hide internal directories.