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