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

Method readFrame

track/reader-av.go:55–66  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53}
54
55func (r *AVRingReader) readFrame() (err error) {
56 err = r.ReadNext()
57 if err != nil {
58 return err
59 }
60 // 超过一半的缓冲区大小,说明Reader太慢,需要丢帧
61 if r.mode != SUBMODE_BUFFER && r.State == READSTATE_NORMAL && r.Track.LastValue.Sequence-r.Value.Sequence > uint32(r.Track.Size/2) && r.Track.IDRing != nil && r.Track.IDRing.Value.Sequence > r.Value.Sequence {
62 r.Warn("reader too slow", zap.Uint32("lastSeq", r.Track.LastValue.Sequence), zap.Uint32("seq", r.Value.Sequence))
63 return r.Read(r.Track.IDRing)
64 }
65 return
66}
67
68func (r *AVRingReader) ReadFrame(mode int) (err error) {
69 r.mode = mode

Callers 1

ReadFrameMethod · 0.95

Calls 4

ReadNextMethod · 0.80
WarnMethod · 0.65
ReadMethod · 0.65
Uint32Method · 0.45

Tested by

no test coverage detected