synchronizer

package
v2.9.1 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2025 License: Apache-2.0 Imports: 8 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Synchronizer

type Synchronizer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

a single Synchronizer is shared between all audio and video writers

func NewSynchronizer

func NewSynchronizer(onStarted func()) *Synchronizer

func (*Synchronizer) AddTrack

func (s *Synchronizer) AddTrack(track TrackRemote, identity string) *TrackSynchronizer

func (*Synchronizer) End

func (s *Synchronizer) End()

func (*Synchronizer) GetEndedAt

func (s *Synchronizer) GetEndedAt() int64

func (*Synchronizer) GetStartedAt

func (s *Synchronizer) GetStartedAt() int64

func (*Synchronizer) OnRTCP

func (s *Synchronizer) OnRTCP(packet rtcp.Packet)

OnRTCP syncs a/v using sender reports

func (*Synchronizer) RemoveTrack

func (s *Synchronizer) RemoveTrack(trackID string)

type TrackRemote

type TrackRemote interface {
	ID() string
	Codec() webrtc.RTPCodecParameters
	Kind() webrtc.RTPCodecType
	SSRC() webrtc.SSRC
}

type TrackSynchronizer

type TrackSynchronizer struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*TrackSynchronizer) GetPTS

func (t *TrackSynchronizer) GetPTS(pkt *rtp.Packet) (time.Duration, error)

GetPTS will reset sequence numbers and/or offsets if necessary Packets are expected to be in order

func (*TrackSynchronizer) Initialize

func (t *TrackSynchronizer) Initialize(pkt *rtp.Packet)

Initialize should be called as soon as the first packet is received

func (*TrackSynchronizer) OnSenderReport added in v2.8.2

func (t *TrackSynchronizer) OnSenderReport(f func(drift time.Duration))

Jump to

Keyboard shortcuts

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