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

Method WriteRTPFrame

track/aac.go:69–84  ·  view source on GitHub ↗

https://datatracker.ietf.org/doc/html/rfc3640#section-3.2.1

(rtpItem *LIRTP)

Source from the content-addressed store, hash-verified

67
68// https://datatracker.ietf.org/doc/html/rfc3640#section-3.2.1
69func (aac *AAC) WriteRTPFrame(rtpItem *LIRTP) {
70 aac.Value.RTP.Push(rtpItem)
71 frame := &rtpItem.Value
72 au, err := aac.AACDecoder.Decode(frame.Packet)
73 if err != nil {
74 aac.Error("decode error", zap.Error(err))
75 return
76 }
77 if len(au) > 0 {
78 if aac.SampleRate != 90000 {
79 aac.generateTimestamp(uint32(uint64(frame.Timestamp) * 90000 / uint64(aac.SampleRate)))
80 }
81 aac.AppendAuBytes(au...)
82 aac.Flush()
83 }
84}
85
86func (aac *AAC) WriteSequenceHead(sh []byte) error {
87 aac.Media.WriteSequenceHead(sh)

Callers

nothing calls this directly

Calls 5

AppendAuBytesMethod · 0.80
PushMethod · 0.65
ErrorMethod · 0.65
generateTimestampMethod · 0.65
FlushMethod · 0.65

Tested by

no test coverage detected