Exemplo n.º 1
0
 public TsProgram(ushort programNumber, TableStream programMapStream)
 {
     ProgramNumber = programNumber;
     ProgramMapStream = programMapStream;
     ProgramMapStream.UnitReceived += ProgramMapTableReceived;
     Streams = Portability.CreateList<TsStream>();
 }
Exemplo n.º 2
0
 public ReferenceImporter(TableStream tableStreamBuffer, SignatureComparer signatureComparer)
 {
     if (tableStreamBuffer == null)
         throw new ArgumentNullException("tableStreamBuffer");
     _tableStreamBuffer = tableStreamBuffer;
     _signatureComparer = signatureComparer;
     _typeSystem = tableStreamBuffer.StreamHeader.MetadataHeader.TypeSystem;
 }
Exemplo n.º 3
0
        public TsDemuxer()
        {
            Programs = Portability.CreateList<TsProgram>();

            var programAssociationStream = new TableStream()
                                               {PacketIdentifier = (ushort) PacketIdentifier.ProgramAssociationTable};
            programAssociationStream.UnitReceived += ProgramAssociationTableReceived;
            _streams.Add((ushort) PacketIdentifier.ProgramAssociationTable, programAssociationStream);

            var descriptionStream = new TableStream() {PacketIdentifier = (ushort) PacketIdentifier.TsDescriptionTable};
            descriptionStream.UnitReceived += DescriptionTableReceived;
            _streams.Add((ushort) PacketIdentifier.TsDescriptionTable, descriptionStream);
        }
Exemplo n.º 4
0
        public IndexEncoder(TableStream tableStream, params MetadataTokenType[] tables)
        {
            if (tableStream == null)
                throw new ArgumentNullException("tableStream");
            if (tables == null)
                throw new ArgumentNullException("tables");
            _tableStream = tableStream;
            _tables = tables;

            _tableIndexBitCount = (int)Math.Ceiling(Math.Log(tables.Length, 2));
            _tableIndexBitMask = (int)(Math.Pow(2, _tableIndexBitCount) - 1);
            _maxSmallTableMemberCount = ushort.MaxValue >> _tableIndexBitCount;
        }
Exemplo n.º 5
0
        private static void InitializeMetadata(MetadataHeader header)
        {
            header.Signature = 0x424A5342;
            header.MajorVersion = 1;
            header.MinorVersion = 1;
            header.VersionLength = 0xC;
            header.VersionString = "v4.0.30319";
            header.Flags = 0;

            var tableStream = new TableStream
            {
                SortedBitVector = 0x000016003325FA00,
                MajorVersion = 2,
                Reserved2 = 1
            };

            header.StreamHeaders.Add(new MetadataStreamHeader("#~", tableStream));
            header.StreamHeaders.Add(new MetadataStreamHeader("#Strings", new StringStream()));
            header.StreamHeaders.Add(new MetadataStreamHeader("#US", new UserStringStream()));
            header.StreamHeaders.Add(new MetadataStreamHeader("#GUID", new GuidStream()));
            header.StreamHeaders.Add(new MetadataStreamHeader("#Blob", new BlobStream()));
        }
Exemplo n.º 6
0
 public ReferenceImporter(TableStream tableStreamBuffer)
     : this(tableStreamBuffer, new SignatureComparer())
 {
 }