Пример #1
0
        private void btnFrameStep_Click(object sender, EventArgs e)
        {
            if (_mediaStep != null)
            {
                _mediaStep.Step(FRAME_STEP_INCREMENT, null);
                state = FilterState.Paused;
//            m_bFrameStepping = true;
            }
        }
Пример #2
0
 private void buttonFramestep_Click(object sender, System.EventArgs e)
 {
     if (frameStep != null)
     {
         mediaCtrl.Pause();
         graphState = State.Paused;
         frameStep.Step(1, null);
     }
 }
Пример #3
0
        public int StepOneFrame()
        {
            int hr = 0;

            // If the Frame Stepping interface exists, use it to step one frame
            if (frameStep != null)
            {
                // The graph must be paused for frame stepping to work
                if (currentState != PlayState.Paused)
                {
                    PauseClip();
                }

                // Step the requested number of frames, if supported
                hr = frameStep.Step(1, null);
            }

            return(hr);
        }
Пример #4
0
        /// <summary>
        /// step the frames
        /// </summary>
        public void StepFrame(int framecount)
        {
            int i = frameStep.CanStep(0, null);

            if (i == 0)
            {
                this.Play();
                frameStep.Step(framecount, null);
                this.PlayerState = PlayerState.SteppingFrames;
            }
        }
Пример #5
0
        /// <summary>
        /// Set to single frame step.
        /// </summary>
        public void SetSingleFrameStep()
        {
            int hr = 0;

            // Stop and reset postion to beginning
            if ((_currentState == PlayState.Running) || (_currentState == PlayState.Stopped))
            {
                // Pause the video.
                Pause();

                // Step the requested number of frames, if supported
                hr = _frameStep.Step(1, null);
                DsError.ThrowExceptionForHR(hr);
            }
        }
Пример #6
0
        public void Step(int dwFrames)
        {
            if (m_pGraph == null)
            {
                throw new COMException("Graph in wrong state", DsResults.E_WrongState);
            }

            IVideoFrameStep pStep = (IVideoFrameStep)m_pGraph;

            int hr = pStep.Step(dwFrames, null);

            DsError.ThrowExceptionForHR(hr);

            // To step, the Filter Graph Manager first runs the graph. When
            // the step is complete, it pauses the graph. For the application,
            // we can just report our new state as paused.
            m_state = PlaybackState.Paused;
        }
Пример #7
0
        public int StepOneFrame()
        {
            int hr = 0;

            // If the Frame Stepping interface exists, use it to step one frame
            if (_frameStep != null)
            {
                // The graph must be paused for frame stepping to work
                Pause();

                // Step the requested number of frames, if supported
                hr = _frameStep.Step(1, null);
            }

            // update the TimeSlider position
            timeSliderTimer_Tick(null, null);

            return(hr);
        }
Пример #8
0
 public virtual HRESULT StepForward()
 {
     if (m_FrameStep != null)
     {
         if (!IsPaused)
         {
             Pause();
         }
         int hr = m_FrameStep.Step(1, null);
         if (hr < 0)
         {
             hr = m_MediaSeeking.GetCurrentPosition(out long _time);
             DsLong _stop = (long)0;
             var    _ts   = new TimeSpan(0, 0, 1);
             _time += _ts.Ticks / 20;
             DsLong _current = _time;
             hr = m_MediaSeeking.SetPositions(_current, AMSeekingSeekingFlags.AbsolutePositioning, _stop, AMSeekingSeekingFlags.NoPositioning);
         }
         return((HRESULT)hr);
     }
     return((HRESULT)E_POINTER);
 }
Пример #9
0
        /// <summary>
        /// Step a specified number of frames in the feed (this function only applies to a videw file feed).
        /// </summary>
        /// <param name="nFrames">Specifies the number of frames to step.</param>
        /// <returns>After a successful step <i>true</i> is returned, otherwise when ignored or not running <i>false</i> is returned.</returns>
        public bool Step(int nFrames)
        {
            if (m_mediaSeek == null)
            {
                return(false);
            }

            if (m_bRunning)
            {
                return(false);
            }

            if (m_videoFrameStep != null)
            {
                int hr = m_videoFrameStep.Step(nFrames, null);
                if (hr < 0)
                {
                    Marshal.ThrowExceptionForHR(hr);
                }
            }
            else
            {
                long lPosition;
                int  hr = m_mediaSeek.GetCurrentPosition(out lPosition);

                long lStep        = m_videoInfoHeader.AvgTimePerFrame * nFrames;
                long lNewPosition = lPosition + lStep;

                if (lNewPosition > Duration)
                {
                    lNewPosition = Duration;
                }

                SetPosition(lNewPosition);
            }

            return(true);
        }