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

Method insertDCRtp

track/video.go:186–198  ·  view source on GitHub ↗

在I帧前面插入sps pps webrtc需要

()

Source from the content-addressed store, hash-verified

184
185// 在I帧前面插入sps pps webrtc需要
186func (vt *Video) insertDCRtp() {
187 head := vt.Value.RTP.Next
188 for _, nalu := range vt.ParamaterSets {
189 var packet rtp.Packet
190 packet.Version = 2
191 packet.PayloadType = vt.PayloadType
192 packet.Payload = nalu
193 packet.SSRC = vt.SSRC
194 packet.Timestamp = uint32(vt.Value.PTS)
195 packet.Marker = false
196 head.InsertBeforeValue(RTPFrame{Packet: &packet})
197 }
198}
199
200func (vt *Video) generateTimestamp(ts uint32) {
201 if vt.State == TrackStateOffline {

Callers 2

WriteRTPFrameMethod · 0.80
WriteRTPFrameMethod · 0.80

Calls 1

InsertBeforeValueMethod · 0.80

Tested by

no test coverage detected