private void OnContent(RTMPMessage msg) { if (ptsBase < 0 && msg.Timestamp > 0) { ptsBase = msg.Timestamp; } switch (msg.GetPacketType()) { case FLVPacketType.AACSequenceHeader: OnAACHeader(msg); break; case FLVPacketType.AACRawData: OnAACBody(msg); break; case FLVPacketType.AVCSequenceHeader: OnAVCHeader(msg); break; case FLVPacketType.AVCNALUnitKeyFrame: OnAVCBody(msg, true); break; case FLVPacketType.AVCNALUnitInterFrame: OnAVCBody(msg, false); break; default: break; } }
private PCPChanPacketContinuation GetContentFlags(RTMPMessage content) { var pkttype = content.GetPacketType(); switch (pkttype) { case FLVPacketType.AudioData: case FLVPacketType.AACRawData: return(PCPChanPacketContinuation.AudioFrame); case FLVPacketType.AACSequenceHeader: return(PCPChanPacketContinuation.None); case FLVPacketType.AVCNALUnitInterFrame: return(PCPChanPacketContinuation.IntraFrame); case FLVPacketType.AVCEOS: case FLVPacketType.AVCNALUnitKeyFrame: case FLVPacketType.AVCSequenceHeader: case FLVPacketType.VideoData: default: return(PCPChanPacketContinuation.None); } }
public static bool IsKeyFrame(this RTMPMessage msg) { return(msg.GetPacketType() != FLVPacketType.AVCNALUnitInterFrame); }