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

Method WriteAnnexB

track/video.go:106–118  ·  view source on GitHub ↗
(pts uint32, dts uint32, frame []byte)

Source from the content-addressed store, hash-verified

104}
105
106func (vt *Video) WriteAnnexB(pts uint32, dts uint32, frame []byte) {
107 if dts == 0 {
108 vt.generateTimestamp(pts)
109 } else {
110 vt.Value.PTS = time.Duration(pts)
111 vt.Value.DTS = time.Duration(dts)
112 }
113 vt.Value.BytesIn += len(frame)
114 common.SplitAnnexB(frame, vt.writeAnnexBSlice, codec.NALU_Delimiter2)
115 if vt.Value.AUList.ByteLength > 0 {
116 vt.Flush()
117 }
118}
119
120func (vt *Video) writeAVCCFrame(ts uint32, r *util.BLLReader, frame *util.BLL) (err error) {
121 var cts uint32

Callers

nothing calls this directly

Calls 3

generateTimestampMethod · 0.95
FlushMethod · 0.95
SplitAnnexBFunction · 0.92

Tested by

no test coverage detected