( rtpPacket *rtp.Packet, arrivalTime int64, isBuffered bool, flowState rtpstats.RTPFlowState, )
| 1010 | } |
| 1011 | |
| 1012 | func (b *BufferBase) getExtPacket( |
| 1013 | rtpPacket *rtp.Packet, |
| 1014 | arrivalTime int64, |
| 1015 | isBuffered bool, |
| 1016 | flowState rtpstats.RTPFlowState, |
| 1017 | ) *ExtPacket { |
| 1018 | ep := ExtPacketFactory.Get().(*ExtPacket) |
| 1019 | *ep = ExtPacket{ |
| 1020 | Arrival: arrivalTime, |
| 1021 | ExtSequenceNumber: flowState.ExtSequenceNumber, |
| 1022 | ExtTimestamp: flowState.ExtTimestamp, |
| 1023 | Packet: rtpPacket, |
| 1024 | VideoLayer: VideoLayer{ |
| 1025 | Spatial: InvalidLayerSpatial, |
| 1026 | Temporal: InvalidLayerTemporal, |
| 1027 | }, |
| 1028 | IsOutOfOrder: flowState.IsOutOfOrder, |
| 1029 | IsBuffered: isBuffered, |
| 1030 | } |
| 1031 | |
| 1032 | if len(ep.Packet.Payload) == 0 { |
| 1033 | // padding only packet, nothing else to do |
| 1034 | return ep |
| 1035 | } |
| 1036 | |
| 1037 | if err := b.processVideoPacket(ep); err != nil { |
| 1038 | ReleaseExtPacket(ep) |
| 1039 | return nil |
| 1040 | } |
| 1041 | |
| 1042 | if b.absCaptureTimeExtID != 0 { |
| 1043 | extData := rtpPacket.GetExtension(b.absCaptureTimeExtID) |
| 1044 | |
| 1045 | var actExt act.AbsCaptureTime |
| 1046 | if err := actExt.Unmarshal(extData); err == nil { |
| 1047 | ep.AbsCaptureTimeExt = &actExt |
| 1048 | } |
| 1049 | } |
| 1050 | |
| 1051 | return ep |
| 1052 | } |
| 1053 | |
| 1054 | func (b *BufferBase) processVideoPacket(ep *ExtPacket) error { |
| 1055 | if b.codecType != webrtc.RTPCodecTypeVideo { |
no test coverage detected