Beispiel #1
0
 public void Parse(IMpeg2VideoReader reader, IResultNodeState resultState)
 {
     resultState.Name = Name;
     reader.GetFlag(Attribute.CopyrightFlag);
     reader.GetBits(8, Attribute.CopyrightIdentifier);
     reader.GetFlag(Attribute.OriginalOrCopy);                   // TODO: true = original, false = copy
     reader.GetReservedBits(7);
     reader.GetMarker();
     reader.GetAttribute(_copyrightNumberAttribute);
 }
        public void Parse(IMpeg2VideoReader reader, IResultNodeState resultState)
        {
            resultState.Name = Name;

            // Note: Last header must be a sequence, group of pictures or picture header, or an extension.
            // Note: Sequence end code always ends parsing of a block, so it cannot occur at this point!
            string lastHeader = reader.State.LastHeaderName;

            if ((lastHeader == Slice.Name) || (lastHeader == UserData.Name))
            {
                // User data cannot occur immediately after a slice or (another) user data
                resultState.Invalidate();
                return;
            }

            reader.GetAttribute(_userDataAttribute);
        }
        public void Parse(IMpeg2VideoReader reader, IResultNodeState resultState)
        {
            resultState.Name = Name;

            IMpeg2VideoState state = reader.State;

            // It can occur after the last slice of a picture or after a sequence header, possible followed by user data and/or extensions
            if ((state.LastHeaderName != Slice.Name) && (state.LastHeaderName != null) && (!state.Sequence.Initialized || state.SeenGop || state.Picture.Initialized))
            {
                resultState.Invalidate();
                return;
            }
            if (!reader.State.Sequence.Initialized)
            {
                reader.InsertReferenceHeaderBeforeStartCode();
            }

            state.SeenGop = true;
            state.Picture.Reset();

            reader.GetAttribute(_timeCodeAttribute);
            reader.GetFlag(Attribute.ClosedGop);
            reader.GetFlag(Attribute.BrokenLink);
        }