コード例 #1
0
        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);
            }
        }
コード例 #2
0
ファイル: ByteStream.cs プロジェクト: mcguirepr/bmff
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: TsStream.cs プロジェクト: heksesang/bmff
 public TsStreamEventArgs(ushort packetIdentifier, TsUnit unit)
 {
     PacketIdentifier = packetIdentifier;
     Unit = unit;
 }