os/mm/mmhais/videohai/devvideo/inc/devvideoplayratecustominterface.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmhais/videohai/devvideo/inc/devvideoplayratecustominterface.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,190 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef DEVVIDEOPLAYRATECUSTOMINTERFACE_H
    1.20 +#define DEVVIDEOPLAYRATECUSTOMINTERFACE_H
    1.21 +
    1.22 +#include <mmf/common/mmfvideo.h>
    1.23 +#ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    1.24 +#include <mmf/common/mmfvideoenums.h>
    1.25 +#endif
    1.26 +
    1.27 +/**
    1.28 +MMmfVideoPlayRateControl interface UID.
    1.29 +
    1.30 +@publishedPartner
    1.31 +@released
    1.32 +*/
    1.33 +const TUid KUidMmfVideoPlayRateControl = { 0x10285D3C };
    1.34 +
    1.35 +/**
    1.36 +Video play rate observer that is used with the MMmfVideoPlayRateControl 
    1.37 +custom interface. Controllers or other DevVideo clients using that custom
    1.38 +interface must implement this observer interface.
    1.39 +
    1.40 +@publishedPartner
    1.41 +@released
    1.42 +*/
    1.43 +class MMmfVideoPlayRateObserver
    1.44 +	{
    1.45 +public:
    1.46 +	/**
    1.47 +	Indicates that a step frame request has been completed. This callback is a 
    1.48 +	response to an MmvprcStepFrameL() call.
    1.49 +
    1.50 +	@param aTimestamp The timestamp for the frame that was actually rendered as
    1.51 +			a result of the frame step operation
    1.52 +	*/
    1.53 +	virtual void MmvproStepFrameComplete(TTimeIntervalMicroSeconds aTimestamp) = 0;
    1.54 +
    1.55 +	/**
    1.56 +	Requests that the controller should only pass key frames to DevVideo.
    1.57 +	The key frame mode will be in operation until normal playback is resumed.
    1.58 +	*/
    1.59 +	virtual void MmvproKeyFrameModeRequest() = 0;
    1.60 +};
    1.61 +
    1.62 +/**
    1.63 +Video play rate control custom interface. Controllers or other DevVideo clients
    1.64 +can use this interface for trick play control.
    1.65 +
    1.66 +Note that both decoders and post-processors can implement this interface. Clients 
    1.67 +must query both the decoder and the post-processor (if in use) for the custom 
    1.68 +interface, and call methods on both if they implement the interface. At least 
    1.69 +the rendering media device (typically the post-processor) must implement this 
    1.70 +interface for playback rate control to be available.
    1.71 +
    1.72 +Additionally, the timestamp returned from the clock source must reflect the 
    1.73 +playback speed. For example, for 200% fast forward, the timestamps returned must 
    1.74 +increase at two times the normal speed.
    1.75 +
    1.76 +@publishedPartner
    1.77 +@released
    1.78 +*/
    1.79 +class MMmfVideoPlayRateControl
    1.80 +	{
    1.81 +public:
    1.82 +	/**
    1.83 +	Queries the current video playback rate capabilities. The capabilities
    1.84 +	describe whether fast forward, reverse playback, slow motion, or
    1.85 +	step backward or forward is possible. The capabilities may depend on
    1.86 +	the video decoder / post processor implementation and the video stream. 
    1.87 +
    1.88 +	If an error occurs, this function leaves with any of the system wide error codes.
    1.89 +
    1.90 +	@param aCapabilities Playback rate capabilities
    1.91 +	*/
    1.92 +	virtual void MmvprcGetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities) = 0;
    1.93 +
    1.94 +	/**
    1.95 +	Set video playback rate relative to the normal video stream speed.
    1.96 +	This method can be used for fast forward, rewind, and slow-motion
    1.97 +	playback, depending on the capabilities of the underlying video 
    1.98 +	decoder / post processor implementation and the characteristics of 
    1.99 +	the video stream. Rate set in this call will take effect immediately. 
   1.100 +	Use	MmvprcGetPlayRateCapabilitiesL() to determine what playback modes 
   1.101 +	are	available.
   1.102 +
   1.103 +	Note that due to performance reasons, it may not be possible to perform
   1.104 +	fast forward or rewind at the requested speed. If that happens, the
   1.105 +	video decoder / post processor will use the nearest available rate. This is not
   1.106 +	considered an error and the method will not leave. DevVideo clients can query
   1.107 +	rate in effect by calling MmvprcPlayRateL().
   1.108 +
   1.109 +	The default playback rate is 100.
   1.110 +	Play rate is persistent across stop start calls on DevVideo. 
   1.111 +
   1.112 +	If an error occurs, this function leaves with any of the system wide error codes.
   1.113 +	Common error codes are listed below.
   1.114 +
   1.115 +	@param aRate Playback rate as a percentage relative to the
   1.116 +                 normal video stream speed. Use 100 for normal-speed
   1.117 +                 forward playback and negative value for reverse. Values above
   1.118 +                 100 and below 0 correspond to fast forward and
   1.119 +                 rewind respectively, while values 1 to 100 represent
   1.120 +                 slow-motioned playback.
   1.121 +
   1.122 +	@pre Playback has been started, but may be paused.
   1.123 +
   1.124 +	@see MMmfVideoPlayRateControl::MmvprcGetPlayRateCapabilitiesL()
   1.125 +
   1.126 +	@leave KErrNotSupported The requested playback rate is not supported.
   1.127 +	@leave KErrNotReady Playback has not yet been started
   1.128 +	*/
   1.129 +	virtual void MmvprcSetPlayRateL(const TInt aRate) = 0;
   1.130 +
   1.131 +	/**
   1.132 +	Returns the current playback rate. If setting play rate is
   1.133 +	not supported or rate is not set this will return default play rate
   1.134 +	100 corresponding to normal playback.
   1.135 +
   1.136 +	If implementation is not supporting the rate set with MmvprcSetPlayRateL
   1.137 +	it will default to the nearest rate. In this case this API will return
   1.138 +	the value it has defaulted to.
   1.139 +
   1.140 +	If an error occurs, this function leaves with any of the system
   1.141 +	wide error codes. Common error codes are listed below.
   1.142 +
   1.143 +	@return The current playback rate as a percentage relative to the
   1.144 +        	normal video stream speed.
   1.145 +
   1.146 +	@pre Playback has been started, but may be paused.
   1.147 +
   1.148 +	@see MMmfVideoPlayRateControl::MmvprcGetPlayRateCapabilitiesL()
   1.149 +	@see MMmfVideoPlayRateControl::MmvprcSetPlayRateL()
   1.150 +
   1.151 +	@leave KErrNotReady Playback has not yet been started
   1.152 +	*/
   1.153 +	virtual TInt MmvprcPlayRateL() = 0;
   1.154 +
   1.155 +	/**
   1.156 +	Steps the current video playback position forward or backward by a
   1.157 +	number of frames. Frame step is only available when playback is paused.
   1.158 +
   1.159 +	Support for frame stepping may depend on the underlying video decoder / 
   1.160 +	post processor implementation and the video stream open. Use 
   1.161 +	MmvprcGetPlayRateCapabilitiesL() to query if frame step is currently possible. 
   1.162 +
   1.163 +	Implementations may not be able to step exactly the number of frames
   1.164 +	requested, especially when stepping backwards. If this happens, the
   1.165 +	video decoder / post processor will step to a frame close to the one requested. 
   1.166 +	This is	not considered an error.
   1.167 +
   1.168 +	If an error occurs, this function leaves with any of the system wide error codes.
   1.169 +	Common error codes are listed below.
   1.170 +
   1.171 +	@param aStep The number of frames to step. Use positive values for
   1.172 +             stepping forward and negative values for stepping back.
   1.173 +
   1.174 +	@pre Playback has been started and is currently paused. That means this API 
   1.175 +			can be called only in paused state.
   1.176 +
   1.177 +	@see MMmfVideoPlayRateControl::MmvprcGetPlayRateCapabilitiesL()
   1.178 +
   1.179 +	@leave KErrNotSupported Frame step is not supported. Note that some
   1.180 +         	implementations may support step forward but not step backward.
   1.181 +	@leave KErrNotReady Playback has not yet been started or is not in paused state.
   1.182 +	*/
   1.183 +	virtual void MmvprcStepFrameL(const TInt aStep) = 0;
   1.184 +
   1.185 +	/**
   1.186 +	Sets a play rate observer
   1.187 +
   1.188 +	@param aObserver Play rate observer
   1.189 +	*/
   1.190 +	virtual void MmvprcSetObserver(MMmfVideoPlayRateObserver& aObserver) = 0;
   1.191 +	};
   1.192 +
   1.193 +#endif // DEVVIDEOPLAYRATECUSTOMINTERFACE_H