This tutorial describes how to watch frames in a video clip.
The purpose of this tutorial is to show you how to step forward and backward through video frames.
Required Background
The Video Client Overview introduces the video client utilities.
Introduction
Frame step allows you to step the current video playback position forward or backward by a number of frames. This feature is provided by the CVideoPlayerUtility::StepFrameL()
method and is only available when playback is paused.
Note: This functionality is dependent on the capabilities of the underlying play-controller implementation and the characteristics of the video clip.
The following tasks are covered in this tutorial:
The high level steps to step frames forward and backward are shown here:
Create a new video player utility object.
Open a video clip to play.
Use CVideoPlayerUtility::GetPlayRateCapabilitiesL()
to check frame step is supported. This returns KErrNotSupported if frame step is not supported.
Call the CVideoPlayerUtility::Prepare()
method.
Call CVideoPlayerUtility::Play()
to start playback.
Pause playback using CVideoPlayerUtility::PauseL()
.
To step forward through the video frames use CVideoPlayerUtility::StepFrameL()
and set aStep to a positive TInt value.
To step backward through the video frames use CVideoPlayerUtility::StepFrameL()
and set aStep to a negative TInt value.
Call CVideoPlayerUtility::Stop()
to halt video playback.
Example
// Create new video player utility object (iVideoPlayer) // Open the video clip // Call Prepare() // Call Play() iVideoPlayer->GetPlayRateCapabilitiesL(iVideoPlayRateCapabilities); // Return the current playback rate capabilities // Check that engine has forward capability. if( iVideoPlayRateCapabilities.iStepForward) { iVideoPlayer->StepFrameL(10); // Steps to 10th frame from current. } else { // Forward is not supported. } // If user wants to rewind. Check that engine has rewind capability. if( iVideoPlayRateCapabilities.iStepBackward) { iVideoPlayer->StepFrameL(-5); // Steps to 5th frame backward. } else { // Rewind is not supported. } // Call Stop()