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

Method WriteRTP

track/rtp.go:31–44  ·  view source on GitHub ↗

WriteRTPFrame 写入未反序列化的RTP包, 未排序的

(raw *LIRTP)

Source from the content-addressed store, hash-verified

29
30// WriteRTPFrame 写入未反序列化的RTP包, 未排序的
31func (av *Media) WriteRTP(raw *LIRTP) {
32 for frame := av.recorderRTP(raw); frame != nil; frame = av.nextRTPFrame() {
33 frame.Value.SSRC = av.SSRC
34 av.Value.BytesIn += len(frame.Value.Payload) + 12
35 av.DropCount += int(av.lastSeq - av.lastSeq2 - 1)
36 if len(frame.Value.Payload) > 0 {
37 av.WriteRTPFrame(frame)
38 // av.Info("rtp", zap.Uint32("ts", (frame.Value.Timestamp)), zap.Int("len", len(frame.Value.Payload)), zap.Bool("marker", frame.Value.Marker), zap.Uint16("seq", frame.Value.SequenceNumber))
39 } else {
40 av.Debug("rtp payload is empty", zap.Uint32("ts", (frame.Value.Timestamp)), zap.Any("ext", frame.Value.GetExtensionIDs()), zap.Uint16("seq", frame.Value.SequenceNumber))
41 frame.Recycle()
42 }
43 }
44}
45
46// https://www.cnblogs.com/moonwalk/p/15903760.html
47// Packetize packetizes the payload of an RTP packet and returns one or more RTP packets

Callers

nothing calls this directly

Calls 7

recorderRTPMethod · 0.80
nextRTPFrameMethod · 0.80
WriteRTPFrameMethod · 0.65
DebugMethod · 0.65
RecycleMethod · 0.65
Uint32Method · 0.45
Uint16Method · 0.45

Tested by

no test coverage detected