Documentation
¶
Index ¶
Constants ¶
View Source
const ( // DefaultPacketsPerSample is the default number of packets between stats // samples; plugins may override it for their stream characteristics DefaultPacketsPerSample = 1000 // DefaultTrackBufferSize is the byte buffer length for reading RTP packets // from a track. Shared across all plugins. DefaultTrackBufferSize = 1500 // DefaultPLIMinIntervalNS is the minimum nanoseconds between PLI sends // (100 ms). Shared across all plugins. DefaultPLIMinIntervalNS = 100_000_000 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
PacketsPerSample int `json:"packets_per_sample"`
VP9RTPPayloadType int `json:"vp9_rtp_payload_type"`
TrackBufferSize int `json:"track_buffer_size"`
StatsBufferSize int `json:"stats_buffer_size"`
PacketCaptureDir string `json:"packet_capture_dir"` // if non-empty, write pcap file here
}
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(input chan<- vp9_stats.VideoQualitySample, log *log.Logger) *Manager
func (*Manager) HandleTrack ¶
func (m *Manager) HandleTrack( track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver, pub *vp9_stats.Publisher, opts TrackHandlerOpts, ) (*Viewer, error)
HandleTrack is the shared OnTrack handler. It sets up RTCP PLI throttling, builds a viewer Config, optionally creates an IvfSegmenter for recording, and spawns a Viewer. This replaces ~35 near-identical lines in each plugin.
func (*Manager) SpawnViewer ¶
func (m *Manager) SpawnViewer( track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver, nickname string, config *Config, ivf *vp9.IvfSegmenter, pub *vp9_stats.Publisher, rtcpTracker *vp9_stats.RTCPTracker, onFrameLost func(nowNano int64), ) (*Viewer, error)
type TrackHandlerOpts ¶
type TrackHandlerOpts struct {
StatsBufferSize int
PacketCaptureDir string
EnableRecording bool
RecordingDirectory string
PacketsPerSample int // 0 defaults to DefaultPacketsPerSample
RoomID string
UserID string
Logger *log.Logger
SendPLI func() // plugin-specific PLI sender
}
TrackHandlerOpts configures HandleTrack. Each plugin provides these values from its own config and transport layer.
Click to show internal directories.
Click to hide internal directories.