/// <summary> /// Parse the entry. /// </summary> /// <param name="byteData">The MPEG2 section containing the entry.</param> /// <param name="index">Index of the first byte of the entry in the MPEG2 section.</param> public void Process(byte[] byteData, int index) { lastIndex = index; try { descriptorType = (int)byteData[lastIndex]; lastIndex++; descriptorLength = (int)byteData[lastIndex]; lastIndex++; specifierType = (int)byteData[lastIndex]; lastIndex++; specifierData = Utils.GetBytes(byteData, lastIndex, 3); lastIndex += 3; model = Utils.Convert2BytesToInt(byteData, lastIndex); lastIndex += 2; version = Utils.Convert2BytesToInt(byteData, lastIndex); lastIndex += 2; subDescriptorCount = (int)byteData[lastIndex]; lastIndex++; if (subDescriptorCount != 0) { subDescriptors = new Collection <DSMCCCompatibilityDescriptorSubDescriptor>(); while (subDescriptors.Count != subDescriptorCount) { DSMCCCompatibilityDescriptorSubDescriptor subDescriptor = new DSMCCCompatibilityDescriptorSubDescriptor(); subDescriptor.Process(byteData, lastIndex); subDescriptors.Add(subDescriptor); lastIndex = subDescriptor.Index; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The DSMCC Compatability Descriptor Entry message is short")); } }
/// <summary> /// Parse the entry. /// </summary> /// <param name="byteData">The MPEG2 section containing the entry.</param> /// <param name="index">Index of the first byte of the entry in the MPEG2 section.</param> public void Process(byte[] byteData, int index) { lastIndex = index; try { descriptorType = (int)byteData[lastIndex]; lastIndex++; descriptorLength = (int)byteData[lastIndex]; lastIndex++; specifierType = (int)byteData[lastIndex]; lastIndex++; specifierData = Utils.GetBytes(byteData, lastIndex, 3); lastIndex += 3; model = Utils.Convert2BytesToInt(byteData, lastIndex); lastIndex += 2; version = Utils.Convert2BytesToInt(byteData, lastIndex); lastIndex += 2; subDescriptorCount = (int)byteData[lastIndex]; lastIndex++; if (subDescriptorCount != 0) { subDescriptors = new Collection<DSMCCCompatibilityDescriptorSubDescriptor>(); while (subDescriptors.Count != subDescriptorCount) { DSMCCCompatibilityDescriptorSubDescriptor subDescriptor = new DSMCCCompatibilityDescriptorSubDescriptor(); subDescriptor.Process(byteData, lastIndex); subDescriptors.Add(subDescriptor); lastIndex = subDescriptor.Index; } } Validate(); } catch (IndexOutOfRangeException) { throw (new ArgumentOutOfRangeException("The DSMCC Compatability Descriptor Entry message is short")); } }