public static TsStreamType FindStreamType(byte streamType) { TsStreamType tsStreamType; if (TsStreamType.Types.TryGetValue(streamType, out tsStreamType)) { return(tsStreamType); } bool lockTaken = false; Dictionary <byte, TsStreamType> dictionary = null; try { Monitor.Enter((object)(dictionary = TsStreamType.UnknownTypes), ref lockTaken); if (!TsStreamType.UnknownTypes.TryGetValue(streamType, out tsStreamType)) { TsStreamType.StreamContents contents = TsStreamType.StreamContents.Unknown; if ((int)streamType >= 128) { contents = TsStreamType.StreamContents.Private; } else if ((int)streamType >= 32 && (int)streamType <= 126) { contents = TsStreamType.StreamContents.Reserved; } tsStreamType = new TsStreamType(streamType, contents, string.Format("Stream type {0:X2} ({1})", new object[2] { (object)streamType, (object)contents })); TsStreamType.UnknownTypes[streamType] = tsStreamType; } } finally { if (lockTaken) { Monitor.Exit((object)dictionary); } } return(tsStreamType); }
public TsStreamType(byte streamType, TsStreamType.StreamContents contents, string description) { this.StreamType = streamType; this.Contents = contents; this.Description = description; }
public TsStreamType(byte streamType, TsStreamType.StreamContents contents, string description);