protected override void LoadFromStream(System.IO.Stream stream) { base.LoadFromStream(stream); ConfigurationVersion = (byte)stream.ReadByte(); ProfileIndication = (byte)stream.ReadByte(); Compatibility = (byte)stream.ReadByte(); LevelIndication = (byte)stream.ReadByte(); stream.ReadByte(); // Reserved SequenceParameterSets = new byte[stream.ReadByte() & ~0xE0][]; for (int i = 0; i < SequenceParameterSets.Length; i++) { SequenceParameterSets[i] = stream.ReadBytes(stream.ReadBEUInt16()); } PictureParameterSets = new byte[stream.ReadByte()][]; for (int i = 0; i < PictureParameterSets.Length; i++) { PictureParameterSets[i] = stream.ReadBytes(stream.ReadBEUInt16()); } if (ProfileHasExtraData(ProfileIndication)) { ChromaFormatIdc = (byte)(stream.ReadByte() & ~0xfc); BitDepthLuma = (byte)(stream.ReadByte() & ~0xf8); BitDepthChroma = (byte)(stream.ReadByte() & ~0xf8); SequenceParameterSetsExt = new byte[stream.ReadByte()][]; for (int i = 0; i < SequenceParameterSetsExt.Length; i++) { SequenceParameterSetsExt[i] = stream.ReadBytes(stream.ReadBEUInt16()); } } }
protected override void LoadFromStream(System.IO.Stream stream) { base.LoadFromStream(stream); stream.ReadBEUInt32(); stream.ReadBEUInt16(); stream.ReadBEUInt16(); CodecStreamVersion = stream.ReadBEUInt16(); // 2 == uncompressed YCbCr CodecStreamRevision = stream.ReadBEUInt16(); stream.ReadBEUInt32(); // Reserved stream.ReadBEUInt32(); // Reserved stream.ReadBEUInt32(); // Reserved VideoWidth = stream.ReadBEUInt16(); VideoHeight = stream.ReadBEUInt16(); HorzDPI = stream.ReadBEUInt32(); VertDPI = stream.ReadBEUInt32(); DataSize = stream.ReadBEUInt32(); FrameCount = stream.ReadBEUInt16(); byte count = (byte)stream.ReadByte(); if (count > 31) { count = 0; } if (count == 0) { CompressorName = null; } else { byte[] data = stream.ReadBytes(count); CompressorName = Encoding.UTF8.GetString(data); } if (count != 31) { stream.ReadBytes(31 - count); } stream.ReadBEUInt16(); // Depth? stream.ReadBEUInt16(); // pre_defined? }