MCPcopy Create free account
hub / github.com/Monibuca/engine / SetStuff

Method SetStuff

track/media.go:153–178  ·  view source on GitHub ↗
(stuff ...any)

Source from the content-addressed store, hash-verified

151}
152
153func (av *Media) SetStuff(stuff ...any) {
154 // 代表发布者已经离线,该Track成为遗留Track,等待下一任发布者接续发布
155 for _, s := range stuff {
156 switch v := s.(type) {
157 case IPuber:
158 pubConf := v.GetConfig()
159 av.BufferTime = pubConf.BufferTime
160 av.Base.SetStuff(v)
161 av.Init(pubConf.InitialRingSize(), NewAVFrame)
162 av.SSRC = uint32(uintptr(unsafe.Pointer(av)))
163 av.等待上限 = pubConf.SpeedLimit
164 case uint32:
165 av.SampleRate = v
166 case byte:
167 av.PayloadType = v
168 case util.BytesPool:
169 av.BytesPool = v
170 case SpesificTrack:
171 av.SpesificTrack = v
172 case []any:
173 av.SetStuff(v...)
174 default:
175 av.Base.SetStuff(v)
176 }
177 }
178}
179
180func (av *Media) LastWriteTime() time.Time {
181 return av.LastValue.WriteTime

Callers

nothing calls this directly

Calls 4

InitialRingSizeMethod · 0.80
GetConfigMethod · 0.65
SetStuffMethod · 0.65
InitMethod · 0.45

Tested by

no test coverage detected