protected override TsTable ProcessUnit(TsUnit unit) { // TODO: We should think about passing the unit payload in as an IList for speed. It complicates copying chunks of data, however. var unitPayload = new byte[unit.Payload.Count]; unit.Payload.CopyTo(unitPayload, 0); var pointer = (int)unitPayload[0] + 1; var tid = (TableIdentifier)unitPayload[pointer]; Debug.WriteLine("Received " + tid + " Table"); switch (tid) { case TableIdentifier.ProgramAssociation: return(new ProgramAssociationTable(unitPayload, pointer, unitPayload.Length - pointer)); case TableIdentifier.ProgramMap: return(new ProgramMapTable(unitPayload, pointer, unitPayload.Length - pointer)); case TableIdentifier.Description: return(new DescriptionTable(unitPayload, pointer, unitPayload.Length - pointer)); default: Debug.WriteLine("Unsupported Table: " + tid); return(null); } }
protected override byte[] ProcessUnit(TsUnit unit) { // TODO: We should think about passing the unit payload in as an IList for speed. It complicates copying chunks of data, however. var unitPayload = new byte[unit.Payload.Count]; unit.Payload.CopyTo(unitPayload, 0); return(unitPayload); }
protected override PesPacket ProcessUnit(TsUnit unit) { // TODO: We should think about passing the unit payload in as an IList for speed. It complicates copying chunks of data, however. var unitPayload = new byte[unit.Payload.Count]; unit.Payload.CopyTo(unitPayload, 0); var pesPacket = new PesPacket(unitPayload); Debug.WriteLine("PES Identifier is " + pesPacket.StreamIdentifier); return(pesPacket); }
public TsStreamEventArgs(ushort packetIdentifier, TsUnit unit) { PacketIdentifier = packetIdentifier; Unit = unit; }