(stuff ...any)
| 151 | } |
| 152 | |
| 153 | func (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 | |
| 180 | func (av *Media) LastWriteTime() time.Time { |
| 181 | return av.LastValue.WriteTime |
nothing calls this directly
no test coverage detected