rtc

package
v1.4.4 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2023 License: Apache-2.0 Imports: 54 Imported by: 3

Documentation

Index

Constants

View Source
const (
	DefaultEmptyTimeout    = 5 * 60 // 5m
	AudioLevelQuantization = 8      // ideally power of 2 to minimize float decimal

)
View Source
const (
	LossyDataChannel    = "_lossy"
	ReliableDataChannel = "_reliable"
)

Variables

View Source
var (
	ErrRoomClosed              = errors.New("room has already closed")
	ErrPermissionDenied        = errors.New("no permissions to access the room")
	ErrMaxParticipantsExceeded = errors.New("room has exceeded its max participants")
	ErrLimitExceeded           = errors.New("node has exceeded its configured limit")
	ErrAlreadyJoined           = errors.New("a participant with the same identity is already in the room")
	ErrDataChannelUnavailable  = errors.New("data channel is not available")
	ErrEmptyIdentity           = errors.New("participant identity cannot be empty")
	ErrEmptyParticipantID      = errors.New("participant ID cannot be empty")
	ErrMissingGrants           = errors.New("VideoGrant is missing")

	// Track subscription related
	ErrNoTrackPermission         = errors.New("participant is not allowed to subscribe to this track")
	ErrNoSubscribePermission     = errors.New("participant is not given permission to subscribe to tracks")
	ErrTrackNotFound             = errors.New("track cannot be found")
	ErrTrackNotAttached          = errors.New("track is not yet attached")
	ErrTrackNotBound             = errors.New("track not bound")
	ErrSubscriptionLimitExceeded = errors.New("participant has exceeded its subscription limit")
)
View Source
var (
	ErrNotOpen    = errors.New("track is not open")
	ErrNoReceiver = errors.New("cannot subscribe without a receiver in place")
)
View Source
var (
	ErrIceRestartWithoutLocalSDP = errors.New("ICE restart without local SDP settled")
	ErrNoTransceiver             = errors.New("no transceiver")
	ErrNoSender                  = errors.New("no sender")
	ErrNoICECandidateHandler     = errors.New("no ICE candidate handler")
	ErrNoOfferHandler            = errors.New("no offer handler")
	ErrNoAnswerHandler           = errors.New("no answer handler")
	ErrMidNotFound               = errors.New("mid not found")
)
View Source
var (
	ErrSubscriptionPermissionNeedsId = errors.New("either participant identity or SID needed")
)
View Source
var (
	// var to allow unit test override
	RoomDepartureGrace uint32 = 20
)

Functions

func BroadcastDataPacketForRoom added in v1.3.5

func BroadcastDataPacketForRoom(r types.Room, source types.LocalParticipant, dp *livekit.DataPacket, logger logger.Logger)

func FromProtoSessionDescription

func FromProtoSessionDescription(sd *livekit.SessionDescription) webrtc.SessionDescription

func FromProtoTrickle

func FromProtoTrickle(trickle *livekit.TrickleRequest) (webrtc.ICECandidateInit, error)

func HandleParticipantSignal added in v0.15.0

func HandleParticipantSignal(room types.Room, participant types.LocalParticipant, req *livekit.SignalRequest, pLogger logger.Logger) error

func IsCodecEnabled added in v1.4.2

func IsCodecEnabled(codecs []*livekit.Codec, cap webrtc.RTPCodecCapability) bool

func IsEOF

func IsEOF(err error) bool

func LoggerWithCodecMime added in v1.0.0

func LoggerWithCodecMime(l logger.Logger, mime string) logger.Logger

func LoggerWithPCTarget added in v0.15.6

func LoggerWithPCTarget(l logger.Logger, target livekit.SignalTarget) logger.Logger

func LoggerWithParticipant added in v0.15.0

func LoggerWithParticipant(l logger.Logger, identity livekit.ParticipantIdentity, sid livekit.ParticipantID, isRemote bool) logger.Logger

logger helpers

func LoggerWithRoom added in v0.15.0

func LoggerWithRoom(l logger.Logger, name livekit.RoomName, roomID livekit.RoomID) logger.Logger

func LoggerWithTrack added in v0.15.3

func LoggerWithTrack(l logger.Logger, trackID livekit.TrackID, isRelayed bool) logger.Logger

func PackDataTrackLabel

func PackDataTrackLabel(participantID livekit.ParticipantID, trackID livekit.TrackID, label string) string

func PackStreamID

func PackStreamID(participantID livekit.ParticipantID, trackID livekit.TrackID) string

func Recover

func Recover(l logger.Logger) any

func StartTrackEgress added in v1.2.2

func StartTrackEgress(
	ctx context.Context,
	launcher EgressLauncher,
	ts telemetry.TelemetryService,
	opts *livekit.AutoTrackEgress,
	track types.MediaTrack,
	roomName livekit.RoomName,
	roomID livekit.RoomID,
) error

func ToProtoSessionDescription

func ToProtoSessionDescription(sd webrtc.SessionDescription) *livekit.SessionDescription

func ToProtoTrackKind

func ToProtoTrackKind(kind webrtc.RTPCodecType) livekit.TrackType

func ToProtoTrickle

func ToProtoTrickle(candidateInit webrtc.ICECandidateInit) *livekit.TrickleRequest

func UnpackDataTrackLabel

func UnpackDataTrackLabel(packed string) (participantID livekit.ParticipantID, trackID livekit.TrackID, label string)

func UnpackStreamID

func UnpackStreamID(packed string) (participantID livekit.ParticipantID, trackID livekit.TrackID)

Types

type ClientInfo added in v1.2.0

type ClientInfo struct {
	*livekit.ClientInfo
}

func (ClientInfo) CanHandleReconnectResponse added in v1.3.4

func (c ClientInfo) CanHandleReconnectResponse() bool

func (ClientInfo) FireTrackByRTPPacket added in v1.3.3

func (c ClientInfo) FireTrackByRTPPacket() bool

GoSDK(pion) relies on rtp packets to fire ontrack event, browsers and native (libwebrtc) rely on sdp

func (ClientInfo) SupportPrflxOverRelay added in v1.3.2

func (c ClientInfo) SupportPrflxOverRelay() bool

func (ClientInfo) SupportsAudioRED added in v1.2.0

func (c ClientInfo) SupportsAudioRED() bool

func (ClientInfo) SupportsChangeRTPSenderEncodingActive added in v1.3.4

func (c ClientInfo) SupportsChangeRTPSenderEncodingActive() bool

func (ClientInfo) SupportsICETCP added in v1.2.1

func (c ClientInfo) SupportsICETCP() bool

type DirectionConfig added in v0.15.2

type DirectionConfig struct {
	RTPHeaderExtension RTPHeaderExtensionConfig
	RTCPFeedback       RTCPFeedbackConfig
	StrictACKs         bool
}

type DummyReceiver added in v1.1.1

type DummyReceiver struct {
	// contains filtered or unexported fields
}

func NewDummyReceiver added in v1.1.1

func NewDummyReceiver(trackID livekit.TrackID, streamId string, codec webrtc.RTPCodecParameters, headerExtensions []webrtc.RTPHeaderExtensionParameter) *DummyReceiver

func (*DummyReceiver) AddDownTrack added in v1.1.1

func (d *DummyReceiver) AddDownTrack(track sfu.TrackSender) error

func (*DummyReceiver) Codec added in v1.1.1

func (d *DummyReceiver) Codec() webrtc.RTPCodecParameters

func (*DummyReceiver) DebugInfo added in v1.1.1

func (d *DummyReceiver) DebugInfo() map[string]interface{}

func (*DummyReceiver) DeleteDownTrack added in v1.1.1

func (d *DummyReceiver) DeleteDownTrack(participantID livekit.ParticipantID)

func (*DummyReceiver) GetAudioLevel added in v1.1.1

func (d *DummyReceiver) GetAudioLevel() (float64, bool)

func (*DummyReceiver) GetLayeredBitrate added in v1.2.4

func (d *DummyReceiver) GetLayeredBitrate() ([]int32, sfu.Bitrates)

func (*DummyReceiver) GetPrimaryReceiverForRed added in v1.2.0

func (d *DummyReceiver) GetPrimaryReceiverForRed() sfu.TrackReceiver

func (*DummyReceiver) GetRTCPSenderReportData added in v1.3.3

func (d *DummyReceiver) GetRTCPSenderReportData(layer int32) (*buffer.RTCPSenderReportData, *buffer.RTCPSenderReportData)

func (*DummyReceiver) GetRedReceiver added in v1.3.0

func (d *DummyReceiver) GetRedReceiver() sfu.TrackReceiver

func (*DummyReceiver) GetReferenceLayerRTPTimestamp added in v1.3.3

func (d *DummyReceiver) GetReferenceLayerRTPTimestamp(ts uint32, layer int32, referenceLayer int32) (uint32, error)

func (*DummyReceiver) GetTemporalLayerFpsForSpatial added in v1.3.0

func (d *DummyReceiver) GetTemporalLayerFpsForSpatial(spatial int32) []float32

func (*DummyReceiver) HeaderExtensions added in v1.1.1

func (d *DummyReceiver) HeaderExtensions() []webrtc.RTPHeaderExtensionParameter

func (*DummyReceiver) IsClosed added in v1.3.5

func (d *DummyReceiver) IsClosed() bool

func (*DummyReceiver) ReadRTP added in v1.1.1

func (d *DummyReceiver) ReadRTP(buf []byte, layer uint8, sn uint16) (int, error)

func (*DummyReceiver) Receiver added in v1.1.1

func (d *DummyReceiver) Receiver() sfu.TrackReceiver

func (*DummyReceiver) SendPLI added in v1.1.1

func (d *DummyReceiver) SendPLI(layer int32, force bool)

func (*DummyReceiver) SetMaxExpectedSpatialLayer added in v1.1.1

func (d *DummyReceiver) SetMaxExpectedSpatialLayer(layer int32)

func (*DummyReceiver) SetUpTrackPaused added in v1.1.1

func (d *DummyReceiver) SetUpTrackPaused(paused bool)

func (*DummyReceiver) StreamID added in v1.1.1

func (d *DummyReceiver) StreamID() string

func (*DummyReceiver) TrackID added in v1.1.1

func (d *DummyReceiver) TrackID() livekit.TrackID

func (*DummyReceiver) TrackInfo added in v1.2.0

func (d *DummyReceiver) TrackInfo() *livekit.TrackInfo

func (*DummyReceiver) Upgrade added in v1.1.1

func (d *DummyReceiver) Upgrade(receiver sfu.TrackReceiver)

type DynacastManager added in v1.2.0

type DynacastManager struct {
	// contains filtered or unexported fields
}

func NewDynacastManager added in v1.2.0

func NewDynacastManager(params DynacastManagerParams) *DynacastManager

func (*DynacastManager) AddCodec added in v1.2.0

func (d *DynacastManager) AddCodec(mime string)

func (*DynacastManager) Close added in v1.2.0

func (d *DynacastManager) Close()

func (*DynacastManager) ForceQuality added in v1.2.0

func (d *DynacastManager) ForceQuality(quality livekit.VideoQuality)

It is possible for tracks to be in pending close state. When track is waiting to be closed, a node is not streaming a track. This can be used to force an update announcing that subscribed quality is OFF, i.e. indicating not pulling track any more.

func (*DynacastManager) ForceUpdate added in v1.2.0

func (d *DynacastManager) ForceUpdate()

THere are situations like track unmute or streaming from a different node where subscribed quality needs to sent to the provider immediately. This bypasses any debouncing and forces a subscribed quality update with immediate effect.

func (*DynacastManager) NotifySubscriberMaxQuality added in v1.2.0

func (d *DynacastManager) NotifySubscriberMaxQuality(subscriberID livekit.ParticipantID, mime string, quality livekit.VideoQuality)

func (*DynacastManager) NotifySubscriberNodeMaxQuality added in v1.2.0

func (d *DynacastManager) NotifySubscriberNodeMaxQuality(nodeID livekit.NodeID, qualities []types.SubscribedCodecQuality)

func (*DynacastManager) OnSubscribedMaxQualityChange added in v1.2.0

func (d *DynacastManager) OnSubscribedMaxQualityChange(f func(subscribedQualities []*livekit.SubscribedCodec, maxSubscribedQualities []types.SubscribedCodecQuality))

func (*DynacastManager) Restart added in v1.2.0

func (d *DynacastManager) Restart()

type DynacastManagerParams added in v1.2.0

type DynacastManagerParams struct {
	DynacastPauseDelay time.Duration
	Logger             logger.Logger
}

type DynacastQuality added in v1.2.0

type DynacastQuality struct {
	// contains filtered or unexported fields
}

DynacastQuality manages max subscribed quality of a single receiver of a media track

func NewDynacastQuality added in v1.2.0

func NewDynacastQuality(params DynacastQualityParams) *DynacastQuality

func (*DynacastQuality) NotifySubscriberMaxQuality added in v1.2.0

func (d *DynacastQuality) NotifySubscriberMaxQuality(subscriberID livekit.ParticipantID, quality livekit.VideoQuality)

func (*DynacastQuality) NotifySubscriberNodeMaxQuality added in v1.2.0

func (d *DynacastQuality) NotifySubscriberNodeMaxQuality(nodeID livekit.NodeID, quality livekit.VideoQuality)

func (*DynacastQuality) OnSubscribedMaxQualityChange added in v1.2.0

func (d *DynacastQuality) OnSubscribedMaxQualityChange(f func(maxSubscribedQuality livekit.VideoQuality))

func (*DynacastQuality) Restart added in v1.2.0

func (d *DynacastQuality) Restart()

func (*DynacastQuality) Start added in v1.2.0

func (d *DynacastQuality) Start()

func (*DynacastQuality) Stop added in v1.2.0

func (d *DynacastQuality) Stop()

type DynacastQualityParams added in v1.2.0

type DynacastQualityParams struct {
	MimeType string
	Logger   logger.Logger
}

type EgressLauncher added in v1.2.2

type EgressLauncher interface {
	StartEgress(context.Context, *rpc.StartEgressRequest) (*livekit.EgressInfo, error)
	StartEgressWithClusterId(ctx context.Context, clusterId string, req *rpc.StartEgressRequest) (*livekit.EgressInfo, error)
}

type MediaLossProxy added in v1.2.0

type MediaLossProxy struct {
	// contains filtered or unexported fields
}

func NewMediaLossProxy added in v1.2.0

func NewMediaLossProxy(params MediaLossProxyParams) *MediaLossProxy

func (*MediaLossProxy) HandleMaxLossFeedback added in v1.2.0

func (m *MediaLossProxy) HandleMaxLossFeedback(_ *sfu.DownTrack, report *rtcp.ReceiverReport)

func (*MediaLossProxy) NotifySubscriberNodeMediaLoss added in v1.2.0

func (m *MediaLossProxy) NotifySubscriberNodeMediaLoss(_nodeID livekit.NodeID, fractionalLoss uint8)

func (*MediaLossProxy) OnMediaLossUpdate added in v1.2.0

func (m *MediaLossProxy) OnMediaLossUpdate(f func(fractionalLoss uint8))

type MediaLossProxyParams added in v1.2.0

type MediaLossProxyParams struct {
	Logger logger.Logger
}

type MediaTrack

type MediaTrack struct {
	*MediaTrackReceiver
	*MediaLossProxy
	// contains filtered or unexported fields
}

MediaTrack represents a WebRTC track that needs to be forwarded Implements MediaTrack and PublishedTrack interface

func NewMediaTrack

func NewMediaTrack(params MediaTrackParams) *MediaTrack

func (*MediaTrack) AddReceiver

func (t *MediaTrack) AddReceiver(receiver *webrtc.RTPReceiver, track *webrtc.TrackRemote, twcc *twcc.Responder, mid string) bool

AddReceiver adds a new RTP receiver to the track, returns true when receiver represents a new codec

func (*MediaTrack) Close added in v1.2.0

func (t *MediaTrack) Close(willBeResumed bool)

func (*MediaTrack) GetConnectionScoreAndQuality added in v1.4.0

func (t *MediaTrack) GetConnectionScoreAndQuality() (float32, livekit.ConnectionQuality)

func (*MediaTrack) HasPendingCodec added in v1.1.0

func (t *MediaTrack) HasPendingCodec() bool

func (*MediaTrack) HasSdpCid added in v1.1.0

func (t *MediaTrack) HasSdpCid(cid string) bool

func (*MediaTrack) NotifySubscriberNodeMaxQuality added in v1.2.0

func (t *MediaTrack) NotifySubscriberNodeMaxQuality(nodeID livekit.NodeID, qualities []types.SubscribedCodecQuality)

func (*MediaTrack) OnSubscribedMaxQualityChange added in v0.15.0

func (t *MediaTrack) OnSubscribedMaxQualityChange(
	f func(
		trackID livekit.TrackID,
		subscribedQualities []*livekit.SubscribedCodec,
		maxSubscribedQualities []types.SubscribedCodecQuality,
	) error,
)

func (*MediaTrack) Restart added in v1.2.0

func (t *MediaTrack) Restart()

func (*MediaTrack) SetMuted

func (t *MediaTrack) SetMuted(muted bool)

func (*MediaTrack) SetPendingCodecSid added in v1.1.0

func (t *MediaTrack) SetPendingCodecSid(codecs []*livekit.SimulcastCodec)

func (*MediaTrack) SetRTT added in v0.15.4

func (t *MediaTrack) SetRTT(rtt uint32)

func (*MediaTrack) SignalCid added in v0.13.6

func (t *MediaTrack) SignalCid() string

func (*MediaTrack) ToProto added in v0.9.13

func (t *MediaTrack) ToProto() *livekit.TrackInfo

type MediaTrackParams

type MediaTrackParams struct {
	TrackInfo           *livekit.TrackInfo
	SignalCid           string
	SdpCid              string
	ParticipantID       livekit.ParticipantID
	ParticipantIdentity livekit.ParticipantIdentity
	ParticipantVersion  uint32
	// channel to send RTCP packets to the source
	RTCPChan          chan []rtcp.Packet
	BufferFactory     *buffer.Factory
	ReceiverConfig    ReceiverConfig
	SubscriberConfig  DirectionConfig
	PLIThrottleConfig config.PLIThrottleConfig
	AudioConfig       config.AudioConfig
	VideoConfig       config.VideoConfig
	Telemetry         telemetry.TelemetryService
	Logger            logger.Logger
	SimTracks         map[uint32]SimulcastTrackInfo
}

type MediaTrackReceiver added in v0.15.3

type MediaTrackReceiver struct {
	*MediaTrackSubscriptions
	// contains filtered or unexported fields
}

func NewMediaTrackReceiver added in v0.15.3

func NewMediaTrackReceiver(params MediaTrackReceiverParams) *MediaTrackReceiver

func (*MediaTrackReceiver) AddOnClose added in v0.15.3

func (t *MediaTrackReceiver) AddOnClose(f func())

func (*MediaTrackReceiver) AddSubscriber added in v0.15.3

AddSubscriber subscribes sub to current mediaTrack

func (*MediaTrackReceiver) ClearAllReceivers added in v1.1.0

func (t *MediaTrackReceiver) ClearAllReceivers(willBeResumed bool)

func (*MediaTrackReceiver) ClearReceiver added in v0.15.3

func (t *MediaTrackReceiver) ClearReceiver(mime string, willBeResumed bool)

func (*MediaTrackReceiver) Close added in v0.15.3

func (t *MediaTrackReceiver) Close()

func (*MediaTrackReceiver) DebugInfo added in v0.15.3

func (t *MediaTrackReceiver) DebugInfo() map[string]interface{}

func (*MediaTrackReceiver) GetAudioLevel added in v0.15.7

func (t *MediaTrackReceiver) GetAudioLevel() (float64, bool)

func (*MediaTrackReceiver) GetQualityForDimension added in v0.15.3

func (t *MediaTrackReceiver) GetQualityForDimension(width, height uint32) livekit.VideoQuality

GetQualityForDimension finds the closest quality to use for desired dimensions affords a 20% tolerance on dimension

func (*MediaTrackReceiver) GetTemporalLayerForSpatialFps added in v1.3.0

func (t *MediaTrackReceiver) GetTemporalLayerForSpatialFps(spatial int32, fps uint32, mime string) int32

func (*MediaTrackReceiver) GetVideoLayers added in v0.15.3

func (t *MediaTrackReceiver) GetVideoLayers() []*livekit.VideoLayer

func (*MediaTrackReceiver) ID added in v0.15.3

func (*MediaTrackReceiver) IsMuted added in v0.15.3

func (t *MediaTrackReceiver) IsMuted() bool

func (*MediaTrackReceiver) IsOpen added in v1.3.5

func (t *MediaTrackReceiver) IsOpen() bool

func (*MediaTrackReceiver) IsSimulcast added in v0.15.3

func (t *MediaTrackReceiver) IsSimulcast() bool

func (*MediaTrackReceiver) Kind added in v0.15.3

func (*MediaTrackReceiver) Name added in v0.15.3

func (t *MediaTrackReceiver) Name() string

func (*MediaTrackReceiver) OnMediaLossFeedback added in v1.2.0

func (t *MediaTrackReceiver) OnMediaLossFeedback(f func(dt *sfu.DownTrack, rr *rtcp.ReceiverReport))

func (*MediaTrackReceiver) OnSetupReceiver added in v1.2.0

func (t *MediaTrackReceiver) OnSetupReceiver(f func(mime string))

func (*MediaTrackReceiver) OnVideoLayerUpdate added in v0.15.3

func (t *MediaTrackReceiver) OnVideoLayerUpdate(f func(layers []*livekit.VideoLayer))

func (*MediaTrackReceiver) PrimaryReceiver added in v1.1.0

func (t *MediaTrackReceiver) PrimaryReceiver() sfu.TrackReceiver

func (*MediaTrackReceiver) PublisherID added in v0.15.3

func (t *MediaTrackReceiver) PublisherID() livekit.ParticipantID

func (*MediaTrackReceiver) PublisherIdentity added in v0.15.3

func (t *MediaTrackReceiver) PublisherIdentity() livekit.ParticipantIdentity

func (*MediaTrackReceiver) PublisherVersion added in v1.1.1

func (t *MediaTrackReceiver) PublisherVersion() uint32

func (*MediaTrackReceiver) Receiver added in v0.15.3

func (t *MediaTrackReceiver) Receiver(mime string) sfu.TrackReceiver

func (*MediaTrackReceiver) Receivers added in v1.1.0

func (t *MediaTrackReceiver) Receivers() []sfu.TrackReceiver

func (*MediaTrackReceiver) RemoveSubscriber added in v1.1.1

func (t *MediaTrackReceiver) RemoveSubscriber(subscriberID livekit.ParticipantID, willBeResumed bool)

RemoveSubscriber removes participant from subscription stop all forwarders to the client

func (*MediaTrackReceiver) Restart added in v0.15.7

func (t *MediaTrackReceiver) Restart()

func (*MediaTrackReceiver) RevokeDisallowedSubscribers added in v1.1.1

func (t *MediaTrackReceiver) RevokeDisallowedSubscribers(allowedSubscriberIdentities []livekit.ParticipantIdentity) []livekit.ParticipantIdentity

func (*MediaTrackReceiver) SetClosing added in v1.3.5

func (t *MediaTrackReceiver) SetClosing()

func (*MediaTrackReceiver) SetLayerSsrc added in v1.1.0

func (t *MediaTrackReceiver) SetLayerSsrc(mime string, rid string, ssrc uint32)

func (*MediaTrackReceiver) SetMuted added in v0.15.3

func (t *MediaTrackReceiver) SetMuted(muted bool)

func (*MediaTrackReceiver) SetPotentialCodecs added in v1.1.0

func (t *MediaTrackReceiver) SetPotentialCodecs(codecs []webrtc.RTPCodecParameters, headers []webrtc.RTPHeaderExtensionParameter)

func (*MediaTrackReceiver) SetRTT added in v1.1.0

func (t *MediaTrackReceiver) SetRTT(rtt uint32)

func (*MediaTrackReceiver) SetSimulcast added in v0.15.3

func (t *MediaTrackReceiver) SetSimulcast(simulcast bool)

func (*MediaTrackReceiver) SetupReceiver added in v0.15.3

func (t *MediaTrackReceiver) SetupReceiver(receiver sfu.TrackReceiver, priority int, mid string)

func (*MediaTrackReceiver) Source added in v0.15.3

func (*MediaTrackReceiver) TrackInfo added in v0.15.3

func (t *MediaTrackReceiver) TrackInfo(generateLayer bool) *livekit.TrackInfo

func (*MediaTrackReceiver) TryClose added in v1.1.0

func (t *MediaTrackReceiver) TryClose() bool

func (*MediaTrackReceiver) UpdateTrackInfo added in v0.15.3

func (t *MediaTrackReceiver) UpdateTrackInfo(ti *livekit.TrackInfo)

func (*MediaTrackReceiver) UpdateVideoLayers added in v0.15.3

func (t *MediaTrackReceiver) UpdateVideoLayers(layers []*livekit.VideoLayer)

type MediaTrackReceiverParams added in v0.15.3

type MediaTrackReceiverParams struct {
	TrackInfo           *livekit.TrackInfo
	MediaTrack          types.MediaTrack
	IsRelayed           bool
	ParticipantID       livekit.ParticipantID
	ParticipantIdentity livekit.ParticipantIdentity
	ParticipantVersion  uint32
	ReceiverConfig      ReceiverConfig
	SubscriberConfig    DirectionConfig
	AudioConfig         config.AudioConfig
	Telemetry           telemetry.TelemetryService
	Logger              logger.Logger
}

type MediaTrackSubscriptions added in v0.15.3

type MediaTrackSubscriptions struct {
	// contains filtered or unexported fields
}

MediaTrackSubscriptions manages subscriptions of a media track

func NewMediaTrackSubscriptions added in v0.15.3

func NewMediaTrackSubscriptions(params MediaTrackSubscriptionsParams) *MediaTrackSubscriptions

func (*MediaTrackSubscriptions) AddSubscriber added in v0.15.3

AddSubscriber subscribes sub to current mediaTrack

func (*MediaTrackSubscriptions) DebugInfo added in v0.15.3

func (t *MediaTrackSubscriptions) DebugInfo() []map[string]interface{}

func (*MediaTrackSubscriptions) GetAllSubscribers added in v0.15.6

func (t *MediaTrackSubscriptions) GetAllSubscribers() []livekit.ParticipantID

func (*MediaTrackSubscriptions) GetAllSubscribersForMime added in v1.2.0

func (t *MediaTrackSubscriptions) GetAllSubscribersForMime(mime string) []livekit.ParticipantID

func (*MediaTrackSubscriptions) GetNumSubscribers added in v1.1.1

func (t *MediaTrackSubscriptions) GetNumSubscribers() int

func (*MediaTrackSubscriptions) IsSubscriber added in v0.15.3

func (t *MediaTrackSubscriptions) IsSubscriber(subID livekit.ParticipantID) bool

func (*MediaTrackSubscriptions) OnDownTrackCreated added in v1.1.1

func (t *MediaTrackSubscriptions) OnDownTrackCreated(f func(downTrack *sfu.DownTrack))

func (*MediaTrackSubscriptions) OnSubscriberMaxQualityChange added in v1.2.0

func (t *MediaTrackSubscriptions) OnSubscriberMaxQualityChange(f func(subscriberID livekit.ParticipantID, codec webrtc.RTPCodecCapability, layer int32))

func (*MediaTrackSubscriptions) RemoveSubscriber added in v0.15.3

func (t *MediaTrackSubscriptions) RemoveSubscriber(subscriberID livekit.ParticipantID, willBeResumed bool) error

RemoveSubscriber removes participant from subscription stop all forwarders to the client

func (*MediaTrackSubscriptions) ResyncAllSubscribers added in v0.15.4

func (t *MediaTrackSubscriptions) ResyncAllSubscribers()

func (*MediaTrackSubscriptions) SetMuted added in v0.15.3

func (t *MediaTrackSubscriptions) SetMuted(muted bool)

func (*MediaTrackSubscriptions) UpdateVideoLayers added in v0.15.3

func (t *MediaTrackSubscriptions) UpdateVideoLayers()

type MediaTrackSubscriptionsParams added in v0.15.3

type MediaTrackSubscriptionsParams struct {
	MediaTrack types.MediaTrack
	IsRelayed  bool

	ReceiverConfig   ReceiverConfig
	SubscriberConfig DirectionConfig

	Telemetry telemetry.TelemetryService

	Logger logger.Logger
}

type NegotiationState added in v1.2.0

type NegotiationState int
const (
	NegotiationStateNone NegotiationState = iota
	// waiting for remote description
	NegotiationStateRemote
	// need to Negotiate again
	NegotiationStateRetry
)

func (NegotiationState) String added in v1.2.0

func (n NegotiationState) String() string

type PCTransport

type PCTransport struct {
	// contains filtered or unexported fields
}

PCTransport is a wrapper around PeerConnection, with some helper methods

func NewPCTransport

func NewPCTransport(params TransportParams) (*PCTransport, error)

func (*PCTransport) AddICECandidate

func (t *PCTransport) AddICECandidate(candidate webrtc.ICECandidateInit)

func (*PCTransport) AddTrack added in v0.15.0

func (t *PCTransport) AddTrack(trackLocal webrtc.TrackLocal, params types.AddTrackParams) (sender *webrtc.RTPSender, transceiver *webrtc.RTPTransceiver, err error)

func (*PCTransport) AddTrackToStreamAllocator added in v1.2.0

func (t *PCTransport) AddTrackToStreamAllocator(subTrack types.SubscribedTrack)

func (*PCTransport) AddTransceiverFromTrack added in v1.2.0

func (t *PCTransport) AddTransceiverFromTrack(trackLocal webrtc.TrackLocal, params types.AddTrackParams) (sender *webrtc.RTPSender, transceiver *webrtc.RTPTransceiver, err error)

func (*PCTransport) Close

func (t *PCTransport) Close()

func (*PCTransport) CreateDataChannel added in v1.2.0

func (t *PCTransport) CreateDataChannel(label string, dci *webrtc.DataChannelInit) error

func (*PCTransport) CreateDataChannelIfEmpty added in v1.2.0

func (t *PCTransport) CreateDataChannelIfEmpty(dcLabel string, dci *webrtc.DataChannelInit) (label string, id uint16, existing bool, err error)

func (*PCTransport) GetICEConnectionType added in v1.2.1

func (t *PCTransport) GetICEConnectionType() types.ICEConnectionType

func (*PCTransport) GetMid added in v1.2.0

func (t *PCTransport) GetMid(rtpReceiver *webrtc.RTPReceiver) string

func (*PCTransport) GetPacer added in v1.4.4

func (t *PCTransport) GetPacer() pacer.Pacer

func (*PCTransport) GetRTPReceiver added in v1.2.0

func (t *PCTransport) GetRTPReceiver(mid string) *webrtc.RTPReceiver

func (*PCTransport) HandleRemoteDescription added in v1.2.0

func (t *PCTransport) HandleRemoteDescription(sd webrtc.SessionDescription)

func (*PCTransport) HasEverConnected added in v1.2.0

func (t *PCTransport) HasEverConnected() bool

func (*PCTransport) ICERestart added in v1.2.0

func (t *PCTransport) ICERestart()

func (*PCTransport) IsEstablished added in v0.15.7

func (t *PCTransport) IsEstablished() bool

IsEstablished returns true if the PeerConnection has been established

func (*PCTransport) IsShortConnection added in v1.4.0

func (t *PCTransport) IsShortConnection(at time.Time) (bool, time.Duration)

func (*PCTransport) Negotiate

func (t *PCTransport) Negotiate(force bool)

func (*PCTransport) OnAnswer added in v1.2.0

func (t *PCTransport) OnAnswer(f func(sd webrtc.SessionDescription) error)

func (*PCTransport) OnDataPacket added in v1.2.0

func (t *PCTransport) OnDataPacket(f func(kind livekit.DataPacket_Kind, data []byte))

func (*PCTransport) OnFailed added in v1.2.0

func (t *PCTransport) OnFailed(f func(isShortLived bool))

func (*PCTransport) OnFullyEstablished added in v1.2.0

func (t *PCTransport) OnFullyEstablished(f func())

func (*PCTransport) OnICECandidate added in v1.2.0

func (t *PCTransport) OnICECandidate(f func(c *webrtc.ICECandidate) error)

func (*PCTransport) OnInitialConnected added in v1.2.0

func (t *PCTransport) OnInitialConnected(f func())

func (*PCTransport) OnNegotiationFailed added in v1.1.1

func (t *PCTransport) OnNegotiationFailed(f func())

func (*PCTransport) OnNegotiationStateChanged added in v1.2.0

func (t *PCTransport) OnNegotiationStateChanged(f func(state NegotiationState))

func (*PCTransport) OnOffer

func (t *PCTransport) OnOffer(f func(sd webrtc.SessionDescription) error)

OnOffer is called when the PeerConnection starts negotiation and prepares an offer

func (*PCTransport) OnStreamStateChange added in v0.15.0

func (t *PCTransport) OnStreamStateChange(f func(update *streamallocator.StreamStateUpdate) error)

func (*PCTransport) OnTrack added in v1.2.0

func (t *PCTransport) OnTrack(f func(track *webrtc.TrackRemote, rtpReceiver *webrtc.RTPReceiver))

func (*PCTransport) RemoveTrack added in v0.15.0

func (t *PCTransport) RemoveTrack(sender *webrtc.RTPSender) error

func (*PCTransport) RemoveTrackFromStreamAllocator added in v1.2.0

func (t *PCTransport) RemoveTrackFromStreamAllocator(subTrack types.SubscribedTrack)

func (*PCTransport) ResetShortConnOnICERestart added in v1.3.4

func (t *PCTransport) ResetShortConnOnICERestart()

func (*PCTransport) SendDataPacket added in v1.2.0

func (t *PCTransport) SendDataPacket(dp *livekit.DataPacket, data []byte) error

func (*PCTransport) SetAllowPauseOfStreamAllocator added in v1.4.2

func (t *PCTransport) SetAllowPauseOfStreamAllocator(allowPause bool)

func (*PCTransport) SetChannelCapacityOfStreamAllocator added in v1.4.2

func (t *PCTransport) SetChannelCapacityOfStreamAllocator(channelCapacity int64)

func (*PCTransport) SetPreferTCP added in v1.2.0

func (t *PCTransport) SetPreferTCP(preferTCP bool)

func (*PCTransport) SetPreviousSdp added in v1.2.1

func (t *PCTransport) SetPreviousSdp(offer, answer *webrtc.SessionDescription)

func (*PCTransport) SetSignalingRTT added in v1.3.5

func (t *PCTransport) SetSignalingRTT(rtt uint32)

func (*PCTransport) WriteRTCP added in v1.2.0

func (t *PCTransport) WriteRTCP(pkts []rtcp.Packet) error

type ParticipantImpl

type ParticipantImpl struct {
	*TransportManager
	*UpTrackManager
	*SubscriptionManager
	// contains filtered or unexported fields
}

func NewParticipant

func NewParticipant(params ParticipantParams) (*ParticipantImpl, error)

func (*ParticipantImpl) AddTrack

func (p *ParticipantImpl) AddTrack(req *livekit.AddTrackRequest)

AddTrack is called when client intends to publish track. records track details and lets client know it's ok to proceed

func (*ParticipantImpl) CacheDownTrack added in v1.1.1

func (p *ParticipantImpl) CacheDownTrack(trackID livekit.TrackID, rtpTransceiver *webrtc.RTPTransceiver, downTrack sfu.DownTrackState)

func (*ParticipantImpl) CanPublishData added in v0.12.2

func (p *ParticipantImpl) CanPublishData() bool

func (*ParticipantImpl) CanPublishSource added in v1.4.2

func (p *ParticipantImpl) CanPublishSource(source livekit.TrackSource) bool

func (*ParticipantImpl) CanSkipBroadcast added in v1.4.2

func (p *ParticipantImpl) CanSkipBroadcast() bool

func (*ParticipantImpl) CanSubscribe

func (p *ParticipantImpl) CanSubscribe() bool

func (*ParticipantImpl) ClaimGrants added in v0.15.3

func (p *ParticipantImpl) ClaimGrants() *auth.ClaimGrants

func (*ParticipantImpl) Close

func (p *ParticipantImpl) Close(sendLeave bool, reason types.ParticipantCloseReason, isExpectedToResume bool) error

func (*ParticipantImpl) CloseSignalConnection added in v1.2.0

func (p *ParticipantImpl) CloseSignalConnection(reason types.SignallingCloseReason)

closes signal connection to notify client to resume/reconnect

func (*ParticipantImpl) ConnectedAt

func (p *ParticipantImpl) ConnectedAt() time.Time

func (*ParticipantImpl) DebugInfo added in v0.10.6

func (p *ParticipantImpl) DebugInfo() map[string]interface{}

func (*ParticipantImpl) GetAdaptiveStream added in v0.15.7

func (p *ParticipantImpl) GetAdaptiveStream() bool

func (*ParticipantImpl) GetAudioLevel

func (p *ParticipantImpl) GetAudioLevel() (level float64, active bool)

func (*ParticipantImpl) GetBufferFactory added in v1.3.2

func (p *ParticipantImpl) GetBufferFactory() *buffer.Factory

func (*ParticipantImpl) GetCachedDownTrack added in v1.1.1

func (p *ParticipantImpl) GetCachedDownTrack(trackID livekit.TrackID) (*webrtc.RTPTransceiver, sfu.DownTrackState)

func (*ParticipantImpl) GetClientConfiguration added in v1.2.0

func (p *ParticipantImpl) GetClientConfiguration() *livekit.ClientConfiguration

func (*ParticipantImpl) GetClientInfo added in v1.4.4

func (p *ParticipantImpl) GetClientInfo() *livekit.ClientInfo

func (*ParticipantImpl) GetConnectionQuality added in v0.14.0

func (p *ParticipantImpl) GetConnectionQuality() *livekit.ConnectionQualityInfo

func (*ParticipantImpl) GetICEConnectionType added in v1.2.1

func (p *ParticipantImpl) GetICEConnectionType() types.ICEConnectionType

func (*ParticipantImpl) GetLogger added in v0.15.4

func (p *ParticipantImpl) GetLogger() logger.Logger

func (*ParticipantImpl) GetPacer added in v1.4.4

func (p *ParticipantImpl) GetPacer() pacer.Pacer

func (*ParticipantImpl) HandleAnswer

func (p *ParticipantImpl) HandleAnswer(answer webrtc.SessionDescription)

HandleAnswer handles a client answer response, with subscriber PC, server initiates the offer and client answers

func (*ParticipantImpl) HandleOffer

func (p *ParticipantImpl) HandleOffer(offer webrtc.SessionDescription)

HandleOffer an offer from remote participant, used when clients make the initial connection

func (*ParticipantImpl) HandleReconnectAndSendResponse added in v1.4.2

func (p *ParticipantImpl) HandleReconnectAndSendResponse(reconnectReason livekit.ReconnectReason, reconnectResponse *livekit.ReconnectResponse) error

func (*ParticipantImpl) Hidden added in v0.11.1

func (p *ParticipantImpl) Hidden() bool

func (*ParticipantImpl) ICERestart

func (p *ParticipantImpl) ICERestart(iceConfig *livekit.ICEConfig)

ICERestart restarts subscriber ICE connections

func (*ParticipantImpl) ID

func (*ParticipantImpl) Identity

func (*ParticipantImpl) IsClosed added in v1.3.4

func (p *ParticipantImpl) IsClosed() bool

func (*ParticipantImpl) IsDisconnected added in v1.3.3

func (p *ParticipantImpl) IsDisconnected() bool

func (*ParticipantImpl) IsIdle added in v1.3.4

func (p *ParticipantImpl) IsIdle() bool

func (*ParticipantImpl) IsPublisher added in v1.1.0

func (p *ParticipantImpl) IsPublisher() bool

func (*ParticipantImpl) IsReady

func (p *ParticipantImpl) IsReady() bool

func (*ParticipantImpl) IsRecorder added in v0.15.0

func (p *ParticipantImpl) IsRecorder() bool

func (*ParticipantImpl) IssueFullReconnect added in v1.3.4

func (p *ParticipantImpl) IssueFullReconnect(reason types.ParticipantCloseReason)

func (*ParticipantImpl) MaybeStartMigration added in v1.2.1

func (p *ParticipantImpl) MaybeStartMigration(force bool, onStart func()) bool

func (*ParticipantImpl) MigrateState added in v0.15.3

func (p *ParticipantImpl) MigrateState() types.MigrateState

func (*ParticipantImpl) Negotiate

func (p *ParticipantImpl) Negotiate(force bool)

Negotiate subscriber SDP with client, if force is true, will cancel pending negotiate task and negotiate immediately

func (*ParticipantImpl) OnClaimsChanged added in v0.15.3

func (p *ParticipantImpl) OnClaimsChanged(callback func(types.LocalParticipant))

func (*ParticipantImpl) OnClose

func (p *ParticipantImpl) OnClose(callback func(types.LocalParticipant))

func (*ParticipantImpl) OnDataPacket

func (p *ParticipantImpl) OnDataPacket(callback func(types.LocalParticipant, *livekit.DataPacket))

func (*ParticipantImpl) OnICEConfigChanged added in v1.2.0

func (p *ParticipantImpl) OnICEConfigChanged(f func(participant types.LocalParticipant, iceConfig *livekit.ICEConfig))

func (*ParticipantImpl) OnMigrateStateChange added in v1.3.5

func (p *ParticipantImpl) OnMigrateStateChange(callback func(p types.LocalParticipant, state types.MigrateState))

func (*ParticipantImpl) OnParticipantUpdate added in v0.15.6

func (p *ParticipantImpl) OnParticipantUpdate(callback func(types.LocalParticipant))

func (*ParticipantImpl) OnStateChange

func (p *ParticipantImpl) OnStateChange(callback func(p types.LocalParticipant, oldState livekit.ParticipantInfo_State))

func (*ParticipantImpl) OnTrackPublished

func (p *ParticipantImpl) OnTrackPublished(callback func(types.LocalParticipant, types.MediaTrack))

func (*ParticipantImpl) OnTrackUnpublished added in v1.3.4

func (p *ParticipantImpl) OnTrackUnpublished(callback func(types.LocalParticipant, types.MediaTrack))

func (*ParticipantImpl) OnTrackUpdated

func (p *ParticipantImpl) OnTrackUpdated(callback func(types.LocalParticipant, types.MediaTrack))

func (*ParticipantImpl) ProtocolVersion

func (p *ParticipantImpl) ProtocolVersion() types.ProtocolVersion

func (*ParticipantImpl) SendConnectionQualityUpdate added in v0.14.0

func (p *ParticipantImpl) SendConnectionQualityUpdate(update *livekit.ConnectionQualityUpdate) error

func (*ParticipantImpl) SendDataPacket

func (p *ParticipantImpl) SendDataPacket(dp *livekit.DataPacket, data []byte) error

func (*ParticipantImpl) SendJoinResponse

func (p *ParticipantImpl) SendJoinResponse(joinResponse *livekit.JoinResponse) error

func (*ParticipantImpl) SendParticipantUpdate

func (p *ParticipantImpl) SendParticipantUpdate(participantsToUpdate []*livekit.ParticipantInfo) error

func (*ParticipantImpl) SendRefreshToken added in v0.15.3

func (p *ParticipantImpl) SendRefreshToken(token string) error

func (*ParticipantImpl) SendRoomUpdate added in v0.13.1

func (p *ParticipantImpl) SendRoomUpdate(room *livekit.Room) error

func (*ParticipantImpl) SendSpeakerUpdate added in v0.13.0

func (p *ParticipantImpl) SendSpeakerUpdate(speakers []*livekit.SpeakerInfo, force bool) error

SendSpeakerUpdate notifies participant changes to speakers. only send members that have changed since last update

func (*ParticipantImpl) SetMetadata

func (p *ParticipantImpl) SetMetadata(metadata string)

SetMetadata attaches metadata to the participant

func (*ParticipantImpl) SetMigrateInfo added in v0.15.5

func (p *ParticipantImpl) SetMigrateInfo(
	previousOffer, previousAnswer *webrtc.SessionDescription,
	mediaTracks []*livekit.TrackPublishedResponse,
	dataChannels []*livekit.DataChannelInfo,
)

func (*ParticipantImpl) SetMigrateState added in v0.15.3

func (p *ParticipantImpl) SetMigrateState(s types.MigrateState)

func (*ParticipantImpl) SetName added in v1.3.2

func (p *ParticipantImpl) SetName(name string)

SetName attaches name to the participant

func (*ParticipantImpl) SetPermission

func (p *ParticipantImpl) SetPermission(permission *livekit.ParticipantPermission) bool

func (*ParticipantImpl) SetResponseSink

func (p *ParticipantImpl) SetResponseSink(sink routing.MessageSink)

func (*ParticipantImpl) SetTrackMuted

func (p *ParticipantImpl) SetTrackMuted(trackID livekit.TrackID, muted bool, fromAdmin bool)

func (*ParticipantImpl) Start

func (p *ParticipantImpl) Start()

func (*ParticipantImpl) State

func (*ParticipantImpl) SubscriptionPermissionUpdate added in v0.15.2

func (p *ParticipantImpl) SubscriptionPermissionUpdate(publisherID livekit.ParticipantID, trackID livekit.TrackID, allowed bool)

func (*ParticipantImpl) ToProto

func (p *ParticipantImpl) ToProto() *livekit.ParticipantInfo

func (*ParticipantImpl) ToProtoWithVersion added in v1.4.2

func (p *ParticipantImpl) ToProtoWithVersion() (*livekit.ParticipantInfo, utils.TimedVersion)

func (*ParticipantImpl) UncacheDownTrack added in v1.1.1

func (p *ParticipantImpl) UncacheDownTrack(rtpTransceiver *webrtc.RTPTransceiver)

func (*ParticipantImpl) UpdateMediaLoss added in v1.2.0

func (p *ParticipantImpl) UpdateMediaLoss(nodeID livekit.NodeID, trackID livekit.TrackID, fractionalLoss uint32) error

func (*ParticipantImpl) UpdateMediaRTT added in v1.3.4

func (p *ParticipantImpl) UpdateMediaRTT(rtt uint32)

func (*ParticipantImpl) UpdateSubscribedQuality added in v1.2.0

func (p *ParticipantImpl) UpdateSubscribedQuality(nodeID livekit.NodeID, trackID livekit.TrackID, maxQualities []types.SubscribedCodecQuality) error

func (*ParticipantImpl) VerifySubscribeParticipantInfo added in v1.3.0

func (p *ParticipantImpl) VerifySubscribeParticipantInfo(pID livekit.ParticipantID, version uint32)

type ParticipantOptions added in v0.9.4

type ParticipantOptions struct {
	AutoSubscribe bool
}

type ParticipantParams

type ParticipantParams struct {
	Identity                     livekit.ParticipantIdentity
	Name                         livekit.ParticipantName
	SID                          livekit.ParticipantID
	Config                       *WebRTCConfig
	Sink                         routing.MessageSink
	AudioConfig                  config.AudioConfig
	VideoConfig                  config.VideoConfig
	ProtocolVersion              types.ProtocolVersion
	Telemetry                    telemetry.TelemetryService
	PLIThrottleConfig            config.PLIThrottleConfig
	CongestionControlConfig      config.CongestionControlConfig
	EnabledCodecs                []*livekit.Codec
	Logger                       logger.Logger
	SimTracks                    map[uint32]SimulcastTrackInfo
	Grants                       *auth.ClaimGrants
	InitialVersion               uint32
	ClientConf                   *livekit.ClientConfiguration
	ClientInfo                   ClientInfo
	Region                       string
	Migration                    bool
	AdaptiveStream               bool
	AllowTCPFallback             bool
	TCPFallbackRTTThreshold      int
	AllowUDPUnstableFallback     bool
	TURNSEnabled                 bool
	GetParticipantInfo           func(pID livekit.ParticipantID) *livekit.ParticipantInfo
	ReconnectOnPublicationError  bool
	ReconnectOnSubscriptionError bool
	VersionGenerator             utils.TimedVersionGenerator
	TrackResolver                types.MediaTrackResolver
	DisableDynacast              bool
	SubscriberAllowPause         bool
	SubscriptionLimitAudio       int32
	SubscriptionLimitVideo       int32
}

type RTCPFeedbackConfig added in v0.15.2

type RTCPFeedbackConfig struct {
	Audio []webrtc.RTCPFeedback
	Video []webrtc.RTCPFeedback
}

type RTPHeaderExtensionConfig added in v0.15.2

type RTPHeaderExtensionConfig struct {
	Audio []string
	Video []string
}

type ReceiverConfig

type ReceiverConfig struct {
	PacketBufferSize int
}

type Room

type Room struct {
	Logger logger.Logger
	// contains filtered or unexported fields
}

func NewRoom

func NewRoom(
	room *livekit.Room,
	internal *livekit.RoomInternal,
	config WebRTCConfig,
	audioConfig *config.AudioConfig,
	serverInfo *livekit.ServerInfo,
	telemetry telemetry.TelemetryService,
	egressLauncher EgressLauncher,
) *Room

func (*Room) Close

func (r *Room) Close()

func (*Room) CloseIfEmpty

func (r *Room) CloseIfEmpty()

CloseIfEmpty closes the room if all participants had left, or it's still empty past timeout

func (*Room) DebugInfo added in v0.10.6

func (r *Room) DebugInfo() map[string]interface{}

func (*Room) FirstJoinedAt

func (r *Room) FirstJoinedAt() int64

func (*Room) GetActiveSpeakers

func (r *Room) GetActiveSpeakers() []*livekit.SpeakerInfo

func (*Room) GetBufferFactory added in v0.15.2

func (r *Room) GetBufferFactory() *buffer.Factory

func (*Room) GetLocalParticipants added in v1.3.5

func (r *Room) GetLocalParticipants() []types.LocalParticipant

func (*Room) GetParticipant

func (r *Room) GetParticipant(identity livekit.ParticipantIdentity) types.LocalParticipant

func (*Room) GetParticipantByID added in v1.3.4

func (r *Room) GetParticipantByID(participantID livekit.ParticipantID) types.LocalParticipant

func (*Room) GetParticipantRequestSource added in v1.4.0

func (r *Room) GetParticipantRequestSource(identity livekit.ParticipantIdentity) routing.MessageSource

func (*Room) GetParticipants

func (r *Room) GetParticipants() []types.LocalParticipant

func (*Room) Hold added in v0.15.3

func (r *Room) Hold() bool

func (*Room) ID added in v0.15.3

func (r *Room) ID() livekit.RoomID

func (*Room) Internal added in v1.2.2

func (r *Room) Internal() *livekit.RoomInternal

func (*Room) IsClosed added in v0.13.7

func (r *Room) IsClosed() bool

func (*Room) Join

func (r *Room) Join(participant types.LocalParticipant, requestSource routing.MessageSource, opts *ParticipantOptions, iceServers []*livekit.ICEServer) error

func (*Room) LastLeftAt

func (r *Room) LastLeftAt() int64

func (*Room) Name added in v0.15.0

func (r *Room) Name() livekit.RoomName

func (*Room) OnClose

func (r *Room) OnClose(f func())

func (*Room) OnParticipantChanged

func (r *Room) OnParticipantChanged(f func(participant types.LocalParticipant))

func (*Room) OnRoomUpdated added in v1.4.2

func (r *Room) OnRoomUpdated(f func())

func (*Room) Release added in v0.15.3

func (r *Room) Release()

func (*Room) RemoveParticipant

func (r *Room) RemoveParticipant(identity livekit.ParticipantIdentity, pID livekit.ParticipantID, reason types.ParticipantCloseReason)

func (*Room) ReplaceParticipantRequestSource added in v1.4.0

func (r *Room) ReplaceParticipantRequestSource(identity livekit.ParticipantIdentity, reqSource routing.MessageSource)

func (*Room) ResolveMediaTrackForSubscriber added in v1.3.4

func (r *Room) ResolveMediaTrackForSubscriber(subIdentity livekit.ParticipantIdentity, trackID livekit.TrackID) types.MediaResolverResult

func (*Room) ResumeParticipant added in v0.13.7

func (r *Room) ResumeParticipant(p types.LocalParticipant, requestSource routing.MessageSource, responseSink routing.MessageSink, iceServers []*livekit.ICEServer, reason livekit.ReconnectReason) error

func (*Room) SendDataPacket added in v0.12.2

func (r *Room) SendDataPacket(up *livekit.UserPacket, kind livekit.DataPacket_Kind)

func (*Room) SetMetadata added in v0.13.1

func (r *Room) SetMetadata(metadata string)

func (*Room) SimulateScenario added in v0.15.3

func (r *Room) SimulateScenario(participant types.LocalParticipant, simulateScenario *livekit.SimulateScenario) error

func (*Room) SyncState added in v0.15.3

func (r *Room) SyncState(participant types.LocalParticipant, state *livekit.SyncState) error

func (*Room) ToProto added in v1.0.2

func (r *Room) ToProto() *livekit.Room

func (*Room) UpdateParticipantMetadata added in v1.4.2

func (r *Room) UpdateParticipantMetadata(participant types.LocalParticipant, name string, metadata string)

func (*Room) UpdateSubscriptionPermission added in v0.15.3

func (r *Room) UpdateSubscriptionPermission(participant types.LocalParticipant, subscriptionPermission *livekit.SubscriptionPermission) error

func (*Room) UpdateSubscriptions

func (r *Room) UpdateSubscriptions(
	participant types.LocalParticipant,
	trackIDs []livekit.TrackID,
	participantTracks []*livekit.ParticipantTracks,
	subscribe bool,
)

func (*Room) UpdateVideoLayers added in v0.15.3

func (r *Room) UpdateVideoLayers(participant types.Participant, updateVideoLayers *livekit.UpdateVideoLayers) error

type RoomTrackManager added in v1.3.4

type RoomTrackManager struct {
	// contains filtered or unexported fields
}

RoomTrackManager holds tracks that are published to the room

func NewRoomTrackManager added in v1.3.4

func NewRoomTrackManager() *RoomTrackManager

func (*RoomTrackManager) AddTrack added in v1.3.4

func (r *RoomTrackManager) AddTrack(track types.MediaTrack, publisherIdentity livekit.ParticipantIdentity, publisherID livekit.ParticipantID)

func (*RoomTrackManager) GetOrCreateTrackChangeNotifier added in v1.3.4

func (r *RoomTrackManager) GetOrCreateTrackChangeNotifier(trackID livekit.TrackID) *utils.ChangeNotifier

func (*RoomTrackManager) GetOrCreateTrackRemoveNotifier added in v1.3.4

func (r *RoomTrackManager) GetOrCreateTrackRemoveNotifier(trackID livekit.TrackID) *utils.ChangeNotifier

func (*RoomTrackManager) GetTrackInfo added in v1.3.4

func (r *RoomTrackManager) GetTrackInfo(trackID livekit.TrackID) *TrackInfo

func (*RoomTrackManager) HasObservers added in v1.3.4

func (r *RoomTrackManager) HasObservers(track types.MediaTrack) bool

HasObservers lets caller know if the current media track has any observers this is used to signal interest in the track. when another MediaTrack with the same trackID is being used, track is not considered to be observed.

func (*RoomTrackManager) NotifyTrackChanged added in v1.3.4

func (r *RoomTrackManager) NotifyTrackChanged(trackID livekit.TrackID)

func (*RoomTrackManager) RemoveTrack added in v1.3.4

func (r *RoomTrackManager) RemoveTrack(track types.MediaTrack)

type SimulcastTrackInfo added in v0.15.3

type SimulcastTrackInfo struct {
	Mid string
	Rid string
}

type SubscribedTrack

type SubscribedTrack struct {
	// contains filtered or unexported fields
}

func NewSubscribedTrack

func NewSubscribedTrack(params SubscribedTrackParams) *SubscribedTrack

func (*SubscribedTrack) AddOnBind added in v1.3.4

func (t *SubscribedTrack) AddOnBind(f func(error))

func (*SubscribedTrack) Bound added in v0.15.0

func (t *SubscribedTrack) Bound(err error)

for DownTrack callback to notify us that it's bound

func (*SubscribedTrack) Close added in v1.3.4

func (t *SubscribedTrack) Close(willBeResumed bool)

for DownTrack callback to notify us that it's closed

func (*SubscribedTrack) DownTrack

func (t *SubscribedTrack) DownTrack() *sfu.DownTrack

func (*SubscribedTrack) ID

func (*SubscribedTrack) IsBound added in v1.3.4

func (t *SubscribedTrack) IsBound() bool

func (*SubscribedTrack) IsMuted

func (t *SubscribedTrack) IsMuted() bool

has subscriber indicated it wants to mute this track

func (*SubscribedTrack) MediaTrack added in v0.15.0

func (t *SubscribedTrack) MediaTrack() types.MediaTrack

func (*SubscribedTrack) NeedsNegotiation added in v1.3.4

func (t *SubscribedTrack) NeedsNegotiation() bool

func (*SubscribedTrack) OnClose added in v1.3.4

func (t *SubscribedTrack) OnClose(f func(bool))

func (*SubscribedTrack) PublisherID added in v0.15.2

func (t *SubscribedTrack) PublisherID() livekit.ParticipantID

func (*SubscribedTrack) PublisherIdentity added in v0.13.7

func (t *SubscribedTrack) PublisherIdentity() livekit.ParticipantIdentity

func (*SubscribedTrack) PublisherVersion added in v1.1.1

func (t *SubscribedTrack) PublisherVersion() uint32

func (*SubscribedTrack) RTPSender added in v1.3.4

func (t *SubscribedTrack) RTPSender() *webrtc.RTPSender

func (*SubscribedTrack) SetNeedsNegotiation added in v1.3.4

func (t *SubscribedTrack) SetNeedsNegotiation(needs bool)

func (*SubscribedTrack) SetPublisherMuted

func (t *SubscribedTrack) SetPublisherMuted(muted bool)

func (*SubscribedTrack) SetRTPSender added in v1.3.4

func (t *SubscribedTrack) SetRTPSender(sender *webrtc.RTPSender)

func (*SubscribedTrack) Subscriber added in v1.1.1

func (t *SubscribedTrack) Subscriber() types.LocalParticipant

func (*SubscribedTrack) SubscriberID added in v0.15.4

func (t *SubscribedTrack) SubscriberID() livekit.ParticipantID

func (*SubscribedTrack) SubscriberIdentity added in v1.0.0

func (t *SubscribedTrack) SubscriberIdentity() livekit.ParticipantIdentity

func (*SubscribedTrack) UpdateSubscriberSettings added in v0.9.14

func (t *SubscribedTrack) UpdateSubscriberSettings(settings *livekit.UpdateTrackSettings)

func (*SubscribedTrack) UpdateVideoLayer added in v0.15.0

func (t *SubscribedTrack) UpdateVideoLayer()

type SubscribedTrackParams added in v0.15.0

type SubscribedTrackParams struct {
	PublisherID       livekit.ParticipantID
	PublisherIdentity livekit.ParticipantIdentity
	PublisherVersion  uint32
	Subscriber        types.LocalParticipant
	MediaTrack        types.MediaTrack
	DownTrack         *sfu.DownTrack
	AdaptiveStream    bool
}

type SubscriptionManager added in v1.3.4

type SubscriptionManager struct {
	// contains filtered or unexported fields
}

SubscriptionManager manages a participant's subscriptions

func NewSubscriptionManager added in v1.3.4

func NewSubscriptionManager(params SubscriptionManagerParams) *SubscriptionManager

func (*SubscriptionManager) Close added in v1.3.4

func (m *SubscriptionManager) Close(willBeResumed bool)

func (*SubscriptionManager) GetSubscribedParticipants added in v1.3.4

func (m *SubscriptionManager) GetSubscribedParticipants() []livekit.ParticipantID

func (*SubscriptionManager) GetSubscribedTracks added in v1.3.4

func (m *SubscriptionManager) GetSubscribedTracks() []types.SubscribedTrack

func (*SubscriptionManager) HasSubscriptions added in v1.3.4

func (m *SubscriptionManager) HasSubscriptions() bool

func (*SubscriptionManager) IsSubscribedTo added in v1.3.4

func (m *SubscriptionManager) IsSubscribedTo(participantID livekit.ParticipantID) bool

func (*SubscriptionManager) OnSubscribeStatusChanged added in v1.3.4

func (m *SubscriptionManager) OnSubscribeStatusChanged(fn func(publisherID livekit.ParticipantID, subscribed bool))

OnSubscribeStatusChanged callback will be notified when a participant subscribes or unsubscribes to another participant it will only fire once per publisher. If current participant is subscribed to multiple tracks from another, this callback will only fire once.

func (*SubscriptionManager) SubscribeToTrack added in v1.3.4

func (m *SubscriptionManager) SubscribeToTrack(trackID livekit.TrackID)

func (*SubscriptionManager) UnsubscribeFromTrack added in v1.3.4

func (m *SubscriptionManager) UnsubscribeFromTrack(trackID livekit.TrackID)

func (*SubscriptionManager) UpdateSubscribedTrackSettings added in v1.3.4

func (m *SubscriptionManager) UpdateSubscribedTrackSettings(trackID livekit.TrackID, settings *livekit.UpdateTrackSettings)

func (*SubscriptionManager) WaitUntilSubscribed added in v1.3.4

func (m *SubscriptionManager) WaitUntilSubscribed(timeout time.Duration) error

type SubscriptionManagerParams added in v1.3.4

type SubscriptionManagerParams struct {
	Logger              logger.Logger
	Participant         types.LocalParticipant
	TrackResolver       types.MediaTrackResolver
	OnTrackSubscribed   func(subTrack types.SubscribedTrack)
	OnTrackUnsubscribed func(subTrack types.SubscribedTrack)
	OnSubscriptionError func(trackID livekit.TrackID, fatal bool, err error)
	Telemetry           telemetry.TelemetryService

	SubscriptionLimitVideo, SubscriptionLimitAudio int32
}

type TrackInfo added in v1.3.4

type TrackInfo struct {
	Track             types.MediaTrack
	PublisherIdentity livekit.ParticipantIdentity
	PublisherID       livekit.ParticipantID
}

type TransportManager added in v1.2.0

type TransportManager struct {
	// contains filtered or unexported fields
}

func NewTransportManager added in v1.2.0

func NewTransportManager(params TransportManagerParams) (*TransportManager, error)

func (*TransportManager) AddICECandidate added in v1.2.0

func (t *TransportManager) AddICECandidate(candidate webrtc.ICECandidateInit, target livekit.SignalTarget)

AddICECandidate adds candidates for remote peer

func (*TransportManager) AddSubscribedTrack added in v1.2.0

func (t *TransportManager) AddSubscribedTrack(subTrack types.SubscribedTrack)

func (*TransportManager) AddTrackToSubscriber added in v1.2.0

func (t *TransportManager) AddTrackToSubscriber(trackLocal webrtc.TrackLocal, params types.AddTrackParams) (*webrtc.RTPSender, *webrtc.RTPTransceiver, error)

func (*TransportManager) AddTransceiverFromTrackToSubscriber added in v1.2.0

func (t *TransportManager) AddTransceiverFromTrackToSubscriber(trackLocal webrtc.TrackLocal, params types.AddTrackParams) (*webrtc.RTPSender, *webrtc.RTPTransceiver, error)

func (*TransportManager) Close added in v1.2.0

func (t *TransportManager) Close()

func (*TransportManager) GetICEConnectionType added in v1.2.1

func (t *TransportManager) GetICEConnectionType() types.ICEConnectionType

func (*TransportManager) GetPublisherMid added in v1.2.0

func (t *TransportManager) GetPublisherMid(rtpReceiver *webrtc.RTPReceiver) string

func (*TransportManager) GetPublisherRTPReceiver added in v1.2.0

func (t *TransportManager) GetPublisherRTPReceiver(mid string) *webrtc.RTPReceiver

func (*TransportManager) GetSubscriberPacer added in v1.4.4

func (t *TransportManager) GetSubscriberPacer() pacer.Pacer

func (*TransportManager) GetUnmatchMediaForOffer added in v1.3.0

func (t *TransportManager) GetUnmatchMediaForOffer(offer webrtc.SessionDescription, mediaType string) (parsed *sdp.SessionDescription, unmatched []*sdp.MediaDescription, err error)

func (*TransportManager) HandleAnswer added in v1.2.0

func (t *TransportManager) HandleAnswer(answer webrtc.SessionDescription)

func (*TransportManager) HandleClientReconnect added in v1.4.2

func (t *TransportManager) HandleClientReconnect(reason livekit.ReconnectReason)

func (*TransportManager) HandleOffer added in v1.2.0

func (t *TransportManager) HandleOffer(offer webrtc.SessionDescription, shouldPend bool)

func (*TransportManager) HasPublisherEverConnected added in v1.4.2

func (t *TransportManager) HasPublisherEverConnected() bool

func (*TransportManager) HasSubscriberEverConnected added in v1.2.0

func (t *TransportManager) HasSubscriberEverConnected() bool

func (*TransportManager) ICERestart added in v1.2.0

func (t *TransportManager) ICERestart(iceConfig *livekit.ICEConfig)

func (*TransportManager) IsPublisherEstablished added in v1.2.0

func (t *TransportManager) IsPublisherEstablished() bool

func (*TransportManager) LastPublisherOffer added in v1.2.5

func (t *TransportManager) LastPublisherOffer() webrtc.SessionDescription

func (*TransportManager) LastSeenSignalAt added in v1.4.0

func (t *TransportManager) LastSeenSignalAt() time.Time

func (*TransportManager) NegotiateSubscriber added in v1.2.0

func (t *TransportManager) NegotiateSubscriber(force bool)

func (*TransportManager) OnAnyTransportFailed added in v1.2.0

func (t *TransportManager) OnAnyTransportFailed(f func())

func (*TransportManager) OnAnyTransportNegotiationFailed added in v1.2.0

func (t *TransportManager) OnAnyTransportNegotiationFailed(f func())

func (*TransportManager) OnDataMessage added in v1.2.0

func (t *TransportManager) OnDataMessage(f func(kind livekit.DataPacket_Kind, data []byte))

func (*TransportManager) OnICEConfigChanged added in v1.2.0

func (t *TransportManager) OnICEConfigChanged(f func(iceConfig *livekit.ICEConfig))

func (*TransportManager) OnPrimaryTransportFullyEstablished added in v1.2.0

func (t *TransportManager) OnPrimaryTransportFullyEstablished(f func())

func (*TransportManager) OnPrimaryTransportInitialConnected added in v1.2.0

func (t *TransportManager) OnPrimaryTransportInitialConnected(f func())

func (*TransportManager) OnPublisherAnswer added in v1.2.0

func (t *TransportManager) OnPublisherAnswer(f func(answer webrtc.SessionDescription) error)

func (*TransportManager) OnPublisherICECandidate added in v1.2.0

func (t *TransportManager) OnPublisherICECandidate(f func(c *webrtc.ICECandidate) error)

func (*TransportManager) OnPublisherInitialConnected added in v1.2.0

func (t *TransportManager) OnPublisherInitialConnected(f func())

func (*TransportManager) OnPublisherTrack added in v1.2.0

func (t *TransportManager) OnPublisherTrack(f func(track *webrtc.TrackRemote, rtpReceiver *webrtc.RTPReceiver))

func (*TransportManager) OnReceiverReport added in v1.3.0

func (t *TransportManager) OnReceiverReport(dt *sfu.DownTrack, report *rtcp.ReceiverReport)

func (*TransportManager) OnSubscriberICECandidate added in v1.2.0

func (t *TransportManager) OnSubscriberICECandidate(f func(c *webrtc.ICECandidate) error)

func (*TransportManager) OnSubscriberInitialConnected added in v1.2.0

func (t *TransportManager) OnSubscriberInitialConnected(f func())

func (*TransportManager) OnSubscriberOffer added in v1.2.0

func (t *TransportManager) OnSubscriberOffer(f func(offer webrtc.SessionDescription) error)

func (*TransportManager) OnSubscriberStreamStateChange added in v1.2.0

func (t *TransportManager) OnSubscriberStreamStateChange(f func(update *streamallocator.StreamStateUpdate) error)

func (*TransportManager) ProcessPendingPublisherDataChannels added in v1.2.0

func (t *TransportManager) ProcessPendingPublisherDataChannels()

func (*TransportManager) ProcessPendingPublisherOffer added in v1.2.0

func (t *TransportManager) ProcessPendingPublisherOffer()

func (*TransportManager) RemoveSubscribedTrack added in v1.2.0

func (t *TransportManager) RemoveSubscribedTrack(subTrack types.SubscribedTrack)

func (*TransportManager) RemoveTrackFromSubscriber added in v1.2.0

func (t *TransportManager) RemoveTrackFromSubscriber(sender *webrtc.RTPSender) error

func (*TransportManager) SendDataPacket added in v1.2.0

func (t *TransportManager) SendDataPacket(dp *livekit.DataPacket, data []byte) error

func (*TransportManager) SetICEConfig added in v1.2.0

func (t *TransportManager) SetICEConfig(iceConfig *livekit.ICEConfig)

func (*TransportManager) SetMigrateInfo added in v1.2.0

func (t *TransportManager) SetMigrateInfo(previousOffer, previousAnswer *webrtc.SessionDescription, dataChannels []*livekit.DataChannelInfo)

func (*TransportManager) SetSignalSourceValid added in v1.4.0

func (t *TransportManager) SetSignalSourceValid(valid bool)

func (*TransportManager) SetSubscriberAllowPause added in v1.4.2

func (t *TransportManager) SetSubscriberAllowPause(allowPause bool)

func (*TransportManager) SetSubscriberChannelCapacity added in v1.4.2

func (t *TransportManager) SetSubscriberChannelCapacity(channelCapacity int64)

func (*TransportManager) SinceLastSignal added in v1.3.5

func (t *TransportManager) SinceLastSignal() time.Duration

func (*TransportManager) SubscriberAsPrimary added in v1.2.0

func (t *TransportManager) SubscriberAsPrimary() bool

func (*TransportManager) SubscriberClose added in v1.2.1

func (t *TransportManager) SubscriberClose()

func (*TransportManager) UpdateLastSeenSignal added in v1.3.4

func (t *TransportManager) UpdateLastSeenSignal()

func (*TransportManager) UpdateMediaRTT added in v1.3.4

func (t *TransportManager) UpdateMediaRTT(rtt uint32)

func (*TransportManager) UpdateSignalingRTT added in v1.3.4

func (t *TransportManager) UpdateSignalingRTT(rtt uint32)

func (*TransportManager) WritePublisherRTCP added in v1.2.0

func (t *TransportManager) WritePublisherRTCP(pkts []rtcp.Packet) error

func (*TransportManager) WriteSubscriberRTCP added in v1.2.0

func (t *TransportManager) WriteSubscriberRTCP(pkts []rtcp.Packet) error

type TransportManagerParams added in v1.2.0

type TransportManagerParams struct {
	Identity                 livekit.ParticipantIdentity
	SID                      livekit.ParticipantID
	SubscriberAsPrimary      bool
	Config                   *WebRTCConfig
	ProtocolVersion          types.ProtocolVersion
	Telemetry                telemetry.TelemetryService
	CongestionControlConfig  config.CongestionControlConfig
	EnabledCodecs            []*livekit.Codec
	SimTracks                map[uint32]SimulcastTrackInfo
	ClientConf               *livekit.ClientConfiguration
	ClientInfo               ClientInfo
	Migration                bool
	AllowTCPFallback         bool
	TCPFallbackRTTThreshold  int
	AllowUDPUnstableFallback bool
	TURNSEnabled             bool
	Logger                   logger.Logger
}

type TransportParams

type TransportParams struct {
	ParticipantID           livekit.ParticipantID
	ParticipantIdentity     livekit.ParticipantIdentity
	ProtocolVersion         types.ProtocolVersion
	Config                  *WebRTCConfig
	DirectionConfig         DirectionConfig
	CongestionControlConfig config.CongestionControlConfig
	Telemetry               telemetry.TelemetryService
	EnabledCodecs           []*livekit.Codec
	Logger                  logger.Logger
	SimTracks               map[uint32]SimulcastTrackInfo
	ClientInfo              ClientInfo
	IsOfferer               bool
	IsSendSide              bool
}

type UnhandleSimulcastInterceptor added in v0.15.3

type UnhandleSimulcastInterceptor struct {
	interceptor.NoOp
	// contains filtered or unexported fields
}

func (*UnhandleSimulcastInterceptor) BindRemoteStream added in v0.15.3

type UnhandleSimulcastInterceptorFactory added in v0.15.3

type UnhandleSimulcastInterceptorFactory struct {
	// contains filtered or unexported fields
}

func NewUnhandleSimulcastInterceptorFactory added in v0.15.3

func NewUnhandleSimulcastInterceptorFactory(opts ...UnhandleSimulcastOption) (*UnhandleSimulcastInterceptorFactory, error)

func (*UnhandleSimulcastInterceptorFactory) NewInterceptor added in v0.15.3

type UnhandleSimulcastOption added in v0.15.3

type UnhandleSimulcastOption func(r *UnhandleSimulcastInterceptor) error

func UnhandleSimulcastTracks added in v0.15.3

func UnhandleSimulcastTracks(tracks map[uint32]SimulcastTrackInfo) UnhandleSimulcastOption

type UpTrackManager added in v0.15.3

type UpTrackManager struct {
	// contains filtered or unexported fields
}

UpTrackManager manages all uptracks from a participant

func NewUpTrackManager added in v0.15.3

func NewUpTrackManager(params UpTrackManagerParams) *UpTrackManager

func (*UpTrackManager) AddPublishedTrack added in v0.15.3

func (u *UpTrackManager) AddPublishedTrack(track types.MediaTrack)

func (*UpTrackManager) Close added in v0.15.3

func (u *UpTrackManager) Close(willBeResumed bool)

func (*UpTrackManager) DebugInfo added in v0.15.3

func (u *UpTrackManager) DebugInfo() map[string]interface{}

func (*UpTrackManager) GetPublishedTrack added in v0.15.3

func (u *UpTrackManager) GetPublishedTrack(trackID livekit.TrackID) types.MediaTrack

func (*UpTrackManager) GetPublishedTracks added in v0.15.3

func (u *UpTrackManager) GetPublishedTracks() []types.MediaTrack

func (*UpTrackManager) HasPermission added in v1.3.4

func (u *UpTrackManager) HasPermission(trackID livekit.TrackID, subIdentity livekit.ParticipantIdentity) bool

func (*UpTrackManager) OnPublishedTrackUpdated added in v0.15.3

func (u *UpTrackManager) OnPublishedTrackUpdated(f func(track types.MediaTrack))

func (*UpTrackManager) OnUpTrackManagerClose added in v0.15.3

func (u *UpTrackManager) OnUpTrackManagerClose(f func())

func (*UpTrackManager) RemovePublishedTrack added in v0.15.3

func (u *UpTrackManager) RemovePublishedTrack(track types.MediaTrack, willBeResumed bool, shouldClose bool)

func (*UpTrackManager) SetPublishedTrackMuted added in v0.15.3

func (u *UpTrackManager) SetPublishedTrackMuted(trackID livekit.TrackID, muted bool) types.MediaTrack

func (*UpTrackManager) Start added in v0.15.3

func (u *UpTrackManager) Start()

func (*UpTrackManager) SubscriptionPermission added in v0.15.3

func (u *UpTrackManager) SubscriptionPermission() (*livekit.SubscriptionPermission, utils.TimedVersion)

func (*UpTrackManager) ToProto added in v0.15.3

func (u *UpTrackManager) ToProto() []*livekit.TrackInfo

func (*UpTrackManager) UpdateSubscriptionPermission added in v0.15.3

func (u *UpTrackManager) UpdateSubscriptionPermission(
	subscriptionPermission *livekit.SubscriptionPermission,
	timedVersion utils.TimedVersion,
	resolverByIdentity func(participantIdentity livekit.ParticipantIdentity) types.LocalParticipant,
	resolverBySid func(participantID livekit.ParticipantID) types.LocalParticipant,
) error

func (*UpTrackManager) UpdateVideoLayers added in v0.15.3

func (u *UpTrackManager) UpdateVideoLayers(updateVideoLayers *livekit.UpdateVideoLayers) error

type UpTrackManagerParams added in v0.15.3

type UpTrackManagerParams struct {
	SID              livekit.ParticipantID
	Logger           logger.Logger
	VersionGenerator utils.TimedVersionGenerator
}

type WebRTCConfig

type WebRTCConfig struct {
	rtcconfig.WebRTCConfig

	BufferFactory *buffer.Factory
	Receiver      ReceiverConfig
	Publisher     DirectionConfig
	Subscriber    DirectionConfig
}

func NewWebRTCConfig

func NewWebRTCConfig(conf *config.Config) (*WebRTCConfig, error)

func (*WebRTCConfig) SetBufferFactory added in v0.9.11

func (c *WebRTCConfig) SetBufferFactory(factory *buffer.Factory)

type WrappedReceiver

type WrappedReceiver struct {
	sfu.TrackReceiver
	// contains filtered or unexported fields
}

func NewWrappedReceiver

func NewWrappedReceiver(params WrappedReceiverParams) *WrappedReceiver

func (*WrappedReceiver) Codecs added in v1.1.0

func (r *WrappedReceiver) Codecs() []webrtc.RTPCodecParameters

func (*WrappedReceiver) DeleteDownTrack added in v1.4.4

func (r *WrappedReceiver) DeleteDownTrack(participantID livekit.ParticipantID)

func (*WrappedReceiver) DetermineReceiver added in v1.1.0

func (r *WrappedReceiver) DetermineReceiver(codec webrtc.RTPCodecCapability)

func (*WrappedReceiver) StreamID

func (r *WrappedReceiver) StreamID() string

func (*WrappedReceiver) TrackID

func (r *WrappedReceiver) TrackID() livekit.TrackID

type WrappedReceiverParams added in v1.3.0

type WrappedReceiverParams struct {
	Receivers      []*simulcastReceiver
	TrackID        livekit.TrackID
	StreamId       string
	UpstreamCodecs []webrtc.RTPCodecParameters
	Logger         logger.Logger
	DisableRed     bool
}

Directories

Path Synopsis
typesfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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