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

Method computeGOP

track/video.go:75–88  ·  view source on GitHub ↗

PlayFullAnnexB 订阅annex-b格式的流数据,每一个I帧增加sps、pps头 func (vt *Video) PlayFullAnnexB(ctx context.Context, onMedia func(net.Buffers) error) error { for vr := vt.ReadRing(); ctx.Err() == nil; vr.MoveNext() { vp := vr.Read(ctx) var data net.Buffers if vp.IFrame { data = vt.GetAnnexB() } data =

()

Source from the content-addressed store, hash-verified

73// return ctx.Err()
74// }
75func (vt *Video) computeGOP() {
76 if vt.IDRing != nil {
77 vt.GOP = int(vt.Value.Sequence - vt.IDRing.Value.Sequence)
78 if vt.HistoryRing == nil {
79 vt.narrow(vt.GOP)
80 }
81 }
82 vt.AddIDR()
83 // var n int
84 // for i := 0; i < len(vt.BytesPool); i++ {
85 // n += vt.BytesPool[i].Length
86 // }
87 // println(n)
88}
89
90func (vt *Video) writeAnnexBSlice(nalu []byte) {
91 common.SplitAnnexB(nalu, vt.WriteSliceBytes, codec.NALU_Delimiter1)

Callers 1

FlushMethod · 0.95

Calls 2

narrowMethod · 0.80
AddIDRMethod · 0.45

Tested by

no test coverage detected