os/mm/mmhais/videohai/devvideo/inc/devvideoplayratecustominterface.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef DEVVIDEOPLAYRATECUSTOMINTERFACE_H
    17 #define DEVVIDEOPLAYRATECUSTOMINTERFACE_H
    18 
    19 #include <mmf/common/mmfvideo.h>
    20 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    21 #include <mmf/common/mmfvideoenums.h>
    22 #endif
    23 
    24 /**
    25 MMmfVideoPlayRateControl interface UID.
    26 
    27 @publishedPartner
    28 @released
    29 */
    30 const TUid KUidMmfVideoPlayRateControl = { 0x10285D3C };
    31 
    32 /**
    33 Video play rate observer that is used with the MMmfVideoPlayRateControl 
    34 custom interface. Controllers or other DevVideo clients using that custom
    35 interface must implement this observer interface.
    36 
    37 @publishedPartner
    38 @released
    39 */
    40 class MMmfVideoPlayRateObserver
    41 	{
    42 public:
    43 	/**
    44 	Indicates that a step frame request has been completed. This callback is a 
    45 	response to an MmvprcStepFrameL() call.
    46 
    47 	@param aTimestamp The timestamp for the frame that was actually rendered as
    48 			a result of the frame step operation
    49 	*/
    50 	virtual void MmvproStepFrameComplete(TTimeIntervalMicroSeconds aTimestamp) = 0;
    51 
    52 	/**
    53 	Requests that the controller should only pass key frames to DevVideo.
    54 	The key frame mode will be in operation until normal playback is resumed.
    55 	*/
    56 	virtual void MmvproKeyFrameModeRequest() = 0;
    57 };
    58 
    59 /**
    60 Video play rate control custom interface. Controllers or other DevVideo clients
    61 can use this interface for trick play control.
    62 
    63 Note that both decoders and post-processors can implement this interface. Clients 
    64 must query both the decoder and the post-processor (if in use) for the custom 
    65 interface, and call methods on both if they implement the interface. At least 
    66 the rendering media device (typically the post-processor) must implement this 
    67 interface for playback rate control to be available.
    68 
    69 Additionally, the timestamp returned from the clock source must reflect the 
    70 playback speed. For example, for 200% fast forward, the timestamps returned must 
    71 increase at two times the normal speed.
    72 
    73 @publishedPartner
    74 @released
    75 */
    76 class MMmfVideoPlayRateControl
    77 	{
    78 public:
    79 	/**
    80 	Queries the current video playback rate capabilities. The capabilities
    81 	describe whether fast forward, reverse playback, slow motion, or
    82 	step backward or forward is possible. The capabilities may depend on
    83 	the video decoder / post processor implementation and the video stream. 
    84 
    85 	If an error occurs, this function leaves with any of the system wide error codes.
    86 
    87 	@param aCapabilities Playback rate capabilities
    88 	*/
    89 	virtual void MmvprcGetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities) = 0;
    90 
    91 	/**
    92 	Set video playback rate relative to the normal video stream speed.
    93 	This method can be used for fast forward, rewind, and slow-motion
    94 	playback, depending on the capabilities of the underlying video 
    95 	decoder / post processor implementation and the characteristics of 
    96 	the video stream. Rate set in this call will take effect immediately. 
    97 	Use	MmvprcGetPlayRateCapabilitiesL() to determine what playback modes 
    98 	are	available.
    99 
   100 	Note that due to performance reasons, it may not be possible to perform
   101 	fast forward or rewind at the requested speed. If that happens, the
   102 	video decoder / post processor will use the nearest available rate. This is not
   103 	considered an error and the method will not leave. DevVideo clients can query
   104 	rate in effect by calling MmvprcPlayRateL().
   105 
   106 	The default playback rate is 100.
   107 	Play rate is persistent across stop start calls on DevVideo. 
   108 
   109 	If an error occurs, this function leaves with any of the system wide error codes.
   110 	Common error codes are listed below.
   111 
   112 	@param aRate Playback rate as a percentage relative to the
   113                  normal video stream speed. Use 100 for normal-speed
   114                  forward playback and negative value for reverse. Values above
   115                  100 and below 0 correspond to fast forward and
   116                  rewind respectively, while values 1 to 100 represent
   117                  slow-motioned playback.
   118 
   119 	@pre Playback has been started, but may be paused.
   120 
   121 	@see MMmfVideoPlayRateControl::MmvprcGetPlayRateCapabilitiesL()
   122 
   123 	@leave KErrNotSupported The requested playback rate is not supported.
   124 	@leave KErrNotReady Playback has not yet been started
   125 	*/
   126 	virtual void MmvprcSetPlayRateL(const TInt aRate) = 0;
   127 
   128 	/**
   129 	Returns the current playback rate. If setting play rate is
   130 	not supported or rate is not set this will return default play rate
   131 	100 corresponding to normal playback.
   132 
   133 	If implementation is not supporting the rate set with MmvprcSetPlayRateL
   134 	it will default to the nearest rate. In this case this API will return
   135 	the value it has defaulted to.
   136 
   137 	If an error occurs, this function leaves with any of the system
   138 	wide error codes. Common error codes are listed below.
   139 
   140 	@return The current playback rate as a percentage relative to the
   141         	normal video stream speed.
   142 
   143 	@pre Playback has been started, but may be paused.
   144 
   145 	@see MMmfVideoPlayRateControl::MmvprcGetPlayRateCapabilitiesL()
   146 	@see MMmfVideoPlayRateControl::MmvprcSetPlayRateL()
   147 
   148 	@leave KErrNotReady Playback has not yet been started
   149 	*/
   150 	virtual TInt MmvprcPlayRateL() = 0;
   151 
   152 	/**
   153 	Steps the current video playback position forward or backward by a
   154 	number of frames. Frame step is only available when playback is paused.
   155 
   156 	Support for frame stepping may depend on the underlying video decoder / 
   157 	post processor implementation and the video stream open. Use 
   158 	MmvprcGetPlayRateCapabilitiesL() to query if frame step is currently possible. 
   159 
   160 	Implementations may not be able to step exactly the number of frames
   161 	requested, especially when stepping backwards. If this happens, the
   162 	video decoder / post processor will step to a frame close to the one requested. 
   163 	This is	not considered an error.
   164 
   165 	If an error occurs, this function leaves with any of the system wide error codes.
   166 	Common error codes are listed below.
   167 
   168 	@param aStep The number of frames to step. Use positive values for
   169              stepping forward and negative values for stepping back.
   170 
   171 	@pre Playback has been started and is currently paused. That means this API 
   172 			can be called only in paused state.
   173 
   174 	@see MMmfVideoPlayRateControl::MmvprcGetPlayRateCapabilitiesL()
   175 
   176 	@leave KErrNotSupported Frame step is not supported. Note that some
   177          	implementations may support step forward but not step backward.
   178 	@leave KErrNotReady Playback has not yet been started or is not in paused state.
   179 	*/
   180 	virtual void MmvprcStepFrameL(const TInt aStep) = 0;
   181 
   182 	/**
   183 	Sets a play rate observer
   184 
   185 	@param aObserver Play rate observer
   186 	*/
   187 	virtual void MmvprcSetObserver(MMmfVideoPlayRateObserver& aObserver) = 0;
   188 	};
   189 
   190 #endif // DEVVIDEOPLAYRATECUSTOMINTERFACE_H