skyscraper8/skyscraper8/Mpeg2/TsDescriptorAttribute.cs
feyris-tan ef86554f9a Import
2025-05-12 22:09:16 +02:00

29 lines
755 B
C#

using System;
namespace skyscraper5.Mpeg2
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
sealed class TsDescriptorAttribute : Attribute
{
public byte DescriptorId { get; }
public string[] CompatibleTables { get; }
public TsDescriptorAttribute(byte descriptorId, params string[] compatibleTables)
{
DescriptorId = descriptorId;
CompatibleTables = compatibleTables;
}
public bool Matches(string table)
{
foreach (string compatibleTable in CompatibleTables)
{
if (compatibleTable == table)
return true;
}
return false;
}
}
}