public void ToBuffer(ref TSMessagePackWriter writer) { writer.WriteArray(PESStartCode); writer.WriteByte(StreamId); writer.WriteUInt16(PESPacketLength); writer.WriteByte(Flag1); writer.WriteByte((byte)PTS_DTS_Flag); if (PTS_DTS_Flag == PTS_DTS_Flags.all) { writer.WriteByte(10); writer.WriteInt5(ToPTS()); writer.WriteInt5(ToDTS()); } else if (PTS_DTS_Flag == PTS_DTS_Flags.pts) { writer.WriteByte(5); writer.WriteInt5(ToPTS()); } else if (PTS_DTS_Flag == PTS_DTS_Flags.dts) { writer.WriteByte(5); writer.WriteInt5(ToDTS()); } Payload.ToBuffer(ref writer); }
public void ToBuffer(ref TSMessagePackWriter writer) { writer.WriteByte((byte)PCRIncluded); if (PCRIncluded == PCRInclude.包含) { writer.WriteInt5(PCR); } if (FillSize > 0) { writer.WriteArray(Enumerable.Range(0, FillSize).Select(s => (byte)0xFF).ToArray()); } }