Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License
"Eclipse Public License v1.0" which accompanies this distribution,
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
Nokia Corporation - initial contribution.
Contributors:
-->
<!DOCTYPE concept
PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-469377FB-AAE8-5245-A8E1-469C65AFE5C5"><title>Stepping Frames</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This tutorial describes how to watch frames in a video clip. </p> <section><title>Purpose</title> <p>The purpose of this tutorial is to show you how to step forward and backward through video frames. </p> <p><b>Required Background</b> </p> <p>The <xref href="GUID-2DC80BA9-7AA2-5CD3-9105-1DE28CE196C1.dita">Video Client Overview</xref> introduces the video client utilities. </p> <p><b>Introduction</b> </p> <p>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 <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-6AA8FCCE-63B1-3EF9-8A41-7A3F1DE28E76"><apiname>CVideoPlayerUtility::StepFrameL()</apiname></xref> method and is only available when playback is paused. </p> <p> <b>Note:</b> This functionality is dependent on the capabilities of the underlying play-controller implementation and the characteristics of the video clip. </p> </section> <section><title>Using Frame Step </title> <p>The following tasks are covered in this tutorial: </p> <ul><li id="GUID-BE65641A-E30E-5C22-8C20-4642A385992E"><p><xref href="GUID-469377FB-AAE8-5245-A8E1-469C65AFE5C5.dita#GUID-469377FB-AAE8-5245-A8E1-469C65AFE5C5/GUID-F212F1A1-0ABA-599D-AC32-89D396BB6AD0">Step Frames Forward and Backward </xref> </p> </li> </ul> <p id="GUID-F212F1A1-0ABA-599D-AC32-89D396BB6AD0"><b>Basic Procedure</b> </p> <p>The high level steps to step frames forward and backward are shown here: </p> <ol id="GUID-910FA4E1-4DE2-5D17-BDC3-F6FD2CBE0707"><li id="GUID-D1A02942-66BB-5EB5-A6F6-29B75CC81C06"><p>Create a new video player utility object. </p> </li> <li id="GUID-0ED6D9F6-A985-5968-82F8-F7E551531201"><p>Open a video clip to play. </p> </li> <li id="GUID-6D417E89-E0EE-575B-A36D-B1A838283558"><p>Use <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-45F4B0E5-2EF4-3391-A925-DD31C9E997F6"><apiname>CVideoPlayerUtility::GetPlayRateCapabilitiesL()</apiname></xref> to check frame step is supported. This returns <xref href="GUID-F89DA3F0-2A48-3F9B-8F08-29350E92D0E4.dita"><apiname>KErrNotSupported</apiname></xref> if frame step is not supported. </p> </li> <li id="GUID-42F37141-25D8-5D62-80BE-0D5D4DD61834"><p>Call the <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-B4FB00AA-A85B-3A3F-91BE-C5347462BA95"><apiname>CVideoPlayerUtility::Prepare()</apiname></xref> method. </p> </li> <li id="GUID-1A6B9052-812F-528E-8D76-16049EBD0591"><p>Call <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-A9DCC4EB-B4B3-3AF4-B78C-DC3531A32DCC"><apiname>CVideoPlayerUtility::Play()</apiname></xref> to start playback. </p> </li> <li id="GUID-4D3D4426-EDB4-5F1F-A6C3-1657E1F7562E"><p>Pause playback using <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-CCF5BF0E-BD93-34AC-812E-443ECD07FE26"><apiname>CVideoPlayerUtility::PauseL()</apiname></xref>. </p> </li> <li id="GUID-6C90DF54-997B-5D82-BD9C-94546975883A"><p>To step forward through the video frames use <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-6AA8FCCE-63B1-3EF9-8A41-7A3F1DE28E76"><apiname>CVideoPlayerUtility::StepFrameL()</apiname></xref> and set <xref href="GUID-D39C892F-581C-3A1F-9686-4B48512C6882.dita"><apiname>aStep</apiname></xref> to a positive <xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> value. </p> </li> <li id="GUID-F2AA5F17-0657-5C9C-B7E7-C1A6CEC8156E"><p>To step backward through the video frames use <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-6AA8FCCE-63B1-3EF9-8A41-7A3F1DE28E76"><apiname>CVideoPlayerUtility::StepFrameL()</apiname></xref> and set <xref href="GUID-D39C892F-581C-3A1F-9686-4B48512C6882.dita"><apiname>aStep</apiname></xref> to a negative <xref href="GUID-7A2A43EC-6125-3BFE-834B-23C37F7B40D5.dita"><apiname>TInt</apiname></xref> value. </p> </li> <li id="GUID-36FD8645-3000-5E92-B316-B8462FD0B53D"><p>Call <xref href="GUID-0F1F8AC6-B99F-3274-A785-9977197AF762.dita#GUID-0F1F8AC6-B99F-3274-A785-9977197AF762/GUID-C103A911-AF93-3350-B731-C186A279F1DC"><apiname>CVideoPlayerUtility::Stop()</apiname></xref> to halt video playback. </p> </li> </ol> <p><b>Example</b> </p> <codeblock id="GUID-6EA0ADC4-A004-58BF-A9F6-2906E7663307" xml:space="preserve">// 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() </codeblock> </section> <section><title>See Also</title> <p><xref href="GUID-172F46C1-6066-57FA-A815-5AC23ACE159D.dita">Creating and Preparing a Video Player</xref> </p> <p><xref href="GUID-F9896E96-1076-552D-AE54-8F9DABED867F.dita">Configuring the Video Player</xref> </p> <p><xref href="GUID-733B9695-0C7C-5637-9025-6CE3BAA1A23E.dita"> Enabling/Disabling Audio or Video Playback Separately</xref> </p> <p><xref href="GUID-FE7DE542-3FD4-56D2-B281-C670EF1C4FEB.dita">Scaling Automatically</xref> </p> <p><xref href="GUID-5F4510C9-5B16-593A-A225-37606800915B.dita">Controlling Video Playback</xref> </p> <p><xref href="GUID-70B3881F-9532-5F1D-B210-99A15DB93FC2.dita">Fast Forwarding and Rewinding</xref> </p> <p><xref href="GUID-F13C7D36-E4AB-57F1-87A1-EB83AA2258DF.dita">Controlling the Video Controller Plugin</xref> </p> </section> </conbody></concept>