MCPcopy Index your code
hub / github.com/Monibuca/engine / Accept

Method Accept

wait-tracks.go:72–93  ·  view source on GitHub ↗

Accept 有新的Track来到,检查是否可以不再需要等待了

(t Track)

Source from the content-addressed store, hash-verified

70
71// Accept 有新的Track来到,检查是否可以不再需要等待了
72func (w *waitTracks) Accept(t Track) bool {
73 suber := w.Promise.Value
74 switch t.(type) {
75 case *track.Audio:
76 if w.audio.Accept(t.GetName()) {
77 suber.OnEvent(t)
78 }
79 case *track.Video:
80 if w.video.Accept(t.GetName()) {
81 suber.OnEvent(t)
82 }
83 case common.Track:
84 w.data.Accept(t.GetName())
85 suber.OnEvent(t)
86 }
87 if w.NeedWait() {
88 return false
89 } else {
90 w.Resolve()
91 return true
92 }
93}

Callers 4

runMethod · 0.95
OnTrackMethod · 0.45
ListenQuicMethod · 0.45
listenMethod · 0.45

Calls 4

NeedWaitMethod · 0.95
ResolveMethod · 0.80
GetNameMethod · 0.65
OnEventMethod · 0.65

Tested by

no test coverage detected