track

package
v0.0.0-...-3f3c78e Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublishedTrack

type PublishedTrack[SubscriberID SubscriberIdentifier] struct {
	// contains filtered or unexported fields
}

Represents a track that a peer has published (has already started sending to the SFU).

func NewPublishedTrack

func NewPublishedTrack[SubscriberID SubscriberIdentifier](
	ownerID SubscriberID,
	requestKeyFrame func(track *webrtc.TrackRemote) error,
	track *webrtc.TrackRemote,
	metadata TrackMetadata,
	logger *logrus.Entry,
	telemetryBuilder *telemetry.ChildBuilder,
) (*PublishedTrack[SubscriberID], error)

func (*PublishedTrack[SubscriberID]) AddPublisher

func (p *PublishedTrack[SubscriberID]) AddPublisher(track *webrtc.TrackRemote) error

Adds a new publisher to the existing `PublishedTrack`, this happens if we have multiple qualities (layers) on a single track.

func (*PublishedTrack[SubscriberID]) Done

func (p *PublishedTrack[SubscriberID]) Done() <-chan struct{}

func (*PublishedTrack[SubscriberID]) Info

func (p *PublishedTrack[SubscriberID]) Info() webrtc_ext.TrackInfo

func (*PublishedTrack[SubscriberID]) Metadata

func (p *PublishedTrack[SubscriberID]) Metadata() TrackMetadata

func (*PublishedTrack[SubscriberID]) Owner

func (p *PublishedTrack[SubscriberID]) Owner() SubscriberID

func (*PublishedTrack[SubscriberID]) SetMetadata

func (p *PublishedTrack[SubscriberID]) SetMetadata(metadata TrackMetadata)

func (*PublishedTrack[SubscriberID]) Stop

func (p *PublishedTrack[SubscriberID]) Stop()

Stops the published track and all related publishers. You should not use the `PublishedTrack` after calling this method.

func (*PublishedTrack[SubscriberID]) Subscribe

func (p *PublishedTrack[SubscriberID]) Subscribe(
	subscriberID SubscriberID,
	controller subscription.SubscriptionController,
	desiredWidth int,
	desiredHeight int,
	logger *logrus.Entry,
) error

Create a new subscription for a given subscriber or update the existing one if necessary.

func (*PublishedTrack[SubscriberID]) Unsubscribe

func (p *PublishedTrack[SubscriberID]) Unsubscribe(subscriberID SubscriberID)

Remove subscriptions with a given subscriber id.

type SubscriberIdentifier

type SubscriberIdentifier interface {
	comparable
	fmt.Stringer
}

A subscruber identifier is something that is comparable and convertable to a String.

type TrackID

type TrackID = string

type TrackMetadata

type TrackMetadata struct {
	MaxWidth, MaxHeight int
	Muted               bool
}

Metadata that we have received about this track from a user. This metadata is only set for video tracks at the moment.

Jump to

Keyboard shortcuts

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