public void Parse(IMpeg2VideoReader reader, IResultNodeState resultState) { resultState.Name = Name; reader.State.Picture.Reset(); reader.State.SeenGop = false; if ((reader.State.LastHeaderName != null) && (reader.State.LastHeaderName != Slice.Name)) { resultState.Invalidate(); return; // Invalid header sequence } ISequenceState sequenceState = reader.State.Sequence; sequenceState.Reset(); sequenceState.Initialized = true; sequenceState.HorizontalSize = (ushort)reader.GetBits(12, Attribute.HorizontalSizeValue); sequenceState.VerticalSize = (ushort)reader.GetBits(12, Attribute.VerticalSizeValue); reader.GetBits(4, Attribute.AspectRatioInformation, AspectRatioResultFormatter); reader.GetBits(4, Attribute.FrameRateCode, FrameRateResultFormatter); reader.GetBits(18, Attribute.BitRateValue); reader.GetMarker(); reader.GetBits(10, Attribute.VbvBufferSizeValue); reader.GetFlag(Attribute.ConstrainedParametersFlag); if (reader.GetFlag(Attribute.LoadIntraQuantiserMatrix)) { reader.GetData(Attribute.IntraQuantiserMatrix, 64); } if (reader.GetFlag(Attribute.LoadNonIntraQuantiserMatrix)) { reader.GetData(Attribute.NonIntraQuantiserMatrix, 64); } }
public void CopyTo(ISequenceState sequence) { sequence.Reset(); sequence.Initialized = Initialized; sequence.HorizontalSize = HorizontalSize; sequence.VerticalSize = VerticalSize; sequence.ScalableMode = ScalableMode; sequence.ChromaFormat = ChromaFormat; sequence.Progressive = Progressive; foreach (ExtensionId extensionId in _extensions) { sequence.AddExtension(extensionId); } }