Added a method to detect on whether a ProgramMappingStream is an RCS2 stream.
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 2m6s
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 2m6s
This commit is contained in:
parent
1463844e46
commit
a97535e17c
@ -236,5 +236,49 @@ namespace skyscraper5.Mpeg2.Psi.Model
|
||||
return ((byte)StreamType) >= 0x80;
|
||||
}
|
||||
|
||||
public bool LooksLikeRcs2Stream()
|
||||
{
|
||||
if (NumDescriptors != 1)
|
||||
return false;
|
||||
if (UnknownUserDefines == null)
|
||||
return false;
|
||||
if (UnknownUserDefines.Count != 1)
|
||||
return false;
|
||||
|
||||
UserDefinedDescriptor descriptorCandidate = UnknownUserDefines[0];
|
||||
if (descriptorCandidate.DescriptorTag != 0xa7)
|
||||
return false;
|
||||
|
||||
foreach(byte b in descriptorCandidate.Data)
|
||||
{
|
||||
switch(b)
|
||||
{
|
||||
case 0x40:
|
||||
case 0x41:
|
||||
case 0x4d:
|
||||
case 0x70:
|
||||
case 0xa0:
|
||||
case 0xa1:
|
||||
case 0xa2:
|
||||
case 0xa3:
|
||||
case 0xa4:
|
||||
case 0xa5:
|
||||
case 0xa6:
|
||||
case 0xaa:
|
||||
case 0xab:
|
||||
case 0xac:
|
||||
case 0xad:
|
||||
case 0xae:
|
||||
case 0xaf:
|
||||
case 0xb0:
|
||||
case 0xb1:
|
||||
case 0xb2:
|
||||
continue;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user