DescriptionTable.cs 846 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using MatrixIO.IO.MpegTs.Descriptors;
  6. namespace MatrixIO.IO.MpegTs.Tables
  7. {
  8. public class DescriptionTable : TsTable<string>
  9. {
  10. public IList<TsDescriptor> Descriptors { get; private set; }
  11. public DescriptionTable() : base() {}
  12. public DescriptionTable(byte[] buffer, int offset, int length) : base(buffer, offset, length)
  13. {
  14. Descriptors = Portability.CreateList<TsDescriptor>();
  15. while (_position < _sectionLengthStartOffset + SectionLength - 4 && _position < offset + length - 4)
  16. {
  17. var descriptor = new UnknownDescriptor(buffer, _position);
  18. Descriptors.Add(descriptor);
  19. _position += descriptor.Length;
  20. }
  21. }
  22. }
  23. }