mmlibs/mmfw/src/Client/Video/mmfclientvideoplayer.cpp
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 // Copyright (c) 2002-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 
       
    17 #include <mmf/common/mmfstandardcustomcommands.h>  
       
    18 #include <mmf/common/mmfvideo.h>
       
    19 #include <mmf/common/mmfpaniccodes.h>
       
    20 #include <mmf/server/mmfdes.h>
       
    21 #include <mmf/server/mmffile.h>
       
    22 #include <videoplayer.h>
       
    23 #include "mmfvideocallback.h"
       
    24 #include "VideoPlayerBody.h"
       
    25 #include "mmfvideopaniccodes.h"
       
    26 #include "mmfclientvideocommon.h"
       
    27 
       
    28 
       
    29 void Panic(TInt aPanicCode)
       
    30 	{
       
    31 	_LIT(KMMFMediaClientVideoPanicCategory, "MMFVideoClient");
       
    32 	User::Panic(KMMFMediaClientVideoPanicCategory, aPanicCode);
       
    33 	}
       
    34 
       
    35 /**
       
    36 Constructs and initialises a new instance of the video player utility.
       
    37 
       
    38 This function leaves if the video player utility object cannot be created.
       
    39 
       
    40 @param  aObserver
       
    41         A client class to receive notifications from the video player.
       
    42 @param  aPriority
       
    43         The Priority Value - this client's relative priority. This is a value between EMdaPriorityMin and 
       
    44         EMdaPriorityMax and represents a relative priority. A higher value indicates a more important request.
       
    45 @param  aPref
       
    46         The Priority Preference - an additional audio policy parameter. The suggested default is 
       
    47         EMdaPriorityPreferenceNone. Further values are given by TMdaPriorityPreference, and additional 
       
    48         values may be supported by given phones and/or platforms, but should not be depended upon by 
       
    49         portable code.
       
    50 @param  aWs
       
    51         The window server session id.
       
    52 @param  aScreenDevice
       
    53         The software device screen.
       
    54 @param  aWindow
       
    55         The display window.
       
    56 @param  aScreenRect
       
    57         The dimensions of the display window.
       
    58 @param  aClipRect
       
    59         The area of the video clip to display in the window.
       
    60 
       
    61 @return A pointer to the new video player utility object.
       
    62 
       
    63 @since 7.0s
       
    64 
       
    65 Note: The Priority Value and Priority Preference are used primarily when deciding what to do when
       
    66 several audio clients attempt to play or record simultaneously. In addition to the Priority Value and Preference, 
       
    67 the adaptation may consider other parameters such as the SecureId and Capabilities of the client process. 
       
    68 Whatever, the decision  as to what to do in such situations is up to the audio adaptation, and may
       
    69 vary between different phones. Portable applications are advised not to assume any specific behaviour. 
       
    70 */
       
    71 EXPORT_C CVideoPlayerUtility* CVideoPlayerUtility::NewL(MVideoPlayerUtilityObserver& aObserver,
       
    72 														TInt aPriority,
       
    73 														TInt aPref,
       
    74 														RWsSession& aWs,
       
    75 														CWsScreenDevice& aScreenDevice,
       
    76 														RWindowBase& aWindow,
       
    77 														const TRect& aScreenRect,
       
    78 														const TRect& aClipRect)
       
    79 	{
       
    80 	CVideoPlayerUtility* s = new(ELeave) CVideoPlayerUtility();
       
    81 	CleanupStack::PushL(s);
       
    82 	s->iBody = CBody::NewL(s, aObserver, aPriority, aPref, aWs, aScreenDevice,
       
    83 												aWindow, aScreenRect, aClipRect);
       
    84 	CleanupStack::Pop();
       
    85 	return s;
       
    86 	}
       
    87 
       
    88 /**
       
    89 Destructor. Closes any open video clips and frees any resources held by the Video Player.
       
    90 
       
    91 @since  7.0s
       
    92 */
       
    93 CVideoPlayerUtility::~CVideoPlayerUtility()
       
    94 	{
       
    95 	delete iBody;
       
    96 	}
       
    97 
       
    98 /**
       
    99 Opens a video clip from a file.
       
   100 
       
   101 This function opens a video clip from a file using an optionally specified plugin. If no controller
       
   102 plugin is specified, this function searches through a list of all available plugins and attempts to 
       
   103 use each one until successful or the end of the list is reached.
       
   104 
       
   105 Once the opening of the video clip is complete, successfully or otherwise, the callback function 
       
   106 MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
       
   107 
       
   108 This function leaves if errors are encountered opening the specified video clip file, or in initialising a 
       
   109 specified/unspecified controller plugin.
       
   110 
       
   111 This function can leave with one of the specified error codes. Most open failures
       
   112 will however be reported through the MVideoPlayerUtilityObserver interface.
       
   113 
       
   114 From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
       
   115 If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
       
   116 it fails with KErrNotSupported.
       
   117 
       
   118 @param  aFileName
       
   119         The full path name of the file containing the video data.
       
   120 @param  aControllerUid
       
   121         If specified, it will force the video player to use the
       
   122 		controller with the given UID.
       
   123 
       
   124 @since  7.0s
       
   125 */
       
   126 EXPORT_C void CVideoPlayerUtility::OpenFileL(const TDesC& aFileName, TUid aControllerUid)
       
   127 	{
       
   128 	iBody->OpenFileL(aFileName, aControllerUid);
       
   129 	}
       
   130 
       
   131 /**
       
   132 Opens a video clip from a file.
       
   133 
       
   134 This function opens a video clip from a file using an optionally specified plugin. If no controller
       
   135 plugin is specified, this function searches through a list of all available plugins and attempts to 
       
   136 use each one until successful or the end of the list is reached.
       
   137 
       
   138 Once the opening of the video clip is complete, successfully or otherwise, the callback function 
       
   139 MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
       
   140 
       
   141 This function leaves if errors are encountered opening the specified video clip file, or in initialising a 
       
   142 specified/unspecified controller plugin.
       
   143 
       
   144 This function can leave with one of the specified error codes. Most open failures
       
   145 will however be reported through the MVideoPlayerUtilityObserver interface.
       
   146 
       
   147 From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
       
   148 If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
       
   149 it fails with KErrNotSupported.
       
   150 
       
   151 @param  aFile
       
   152         An open handle to a file containing the video clip
       
   153 @param  aControllerUid
       
   154         If specified, it will force the video player to use the
       
   155 		controller with the given UID.
       
   156 
       
   157 @since  7.0s
       
   158 */
       
   159 EXPORT_C void CVideoPlayerUtility::OpenFileL(const RFile& aFile, TUid aControllerUid)
       
   160 	{
       
   161 	iBody->OpenFileL(aFile, aControllerUid);
       
   162 	}
       
   163 
       
   164 
       
   165 /**
       
   166 Opens a video clip from a file.
       
   167 
       
   168 This function opens a video clip from a file using an optionally specified plugin. If no controller
       
   169 plugin is specified, this function searches through a list of all available plugins and attempts to 
       
   170 use each one until successful or the end of the list is reached.
       
   171 
       
   172 Once the opening of the video clip is complete, successfully or otherwise, the callback function 
       
   173 MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
       
   174 
       
   175 This function leaves if errors are encountered opening the specified video clip file, or in initialising a 
       
   176 specified/unspecified controller plugin.
       
   177 
       
   178 This function can leave with one of the specified error codes. Most open failures
       
   179 will however be reported through the MVideoPlayerUtilityObserver interface.
       
   180 
       
   181 From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
       
   182 If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
       
   183 it fails with KErrNotSupported.
       
   184 
       
   185 @param  aSource
       
   186         A filename or an open handle to a file containing the video clip
       
   187 @param  aControllerUid
       
   188         If specified, it will force the video player to use the
       
   189 		controller with the given UID.
       
   190 */
       
   191 EXPORT_C void CVideoPlayerUtility::OpenFileL(const TMMSource& aSource, TUid aControllerUid)
       
   192 	{
       
   193 	iBody->OpenFileL(aSource, aControllerUid);
       
   194 	}
       
   195 
       
   196 /**
       
   197 Opens a video clip contained in a descriptor.
       
   198 
       
   199 This function opens a video clip contained as binary data in a descriptor using an optionally specified 
       
   200 plugin. If no controller plugin is specified, this function searches through a list of all available 
       
   201 plugins and attempts to use each one until successful or the end of the list is reached.
       
   202 
       
   203 Once the opening of the video clip is complete, successfully or otherwise, the callback function 
       
   204 MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
       
   205 
       
   206 This function can leave with one of the specified error codes. Most open failures will however be
       
   207 reported through the interface.
       
   208 
       
   209 From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
       
   210 If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
       
   211 it fails with KErrNotSupported.
       
   212 
       
   213 @param  aDescriptor
       
   214         The descriptor containing the video clip
       
   215 @param  aControllerUid
       
   216         If specified, it will force the video player to use the
       
   217         controller with the given UID.
       
   218 
       
   219 @since  7.0s
       
   220 */
       
   221 EXPORT_C void CVideoPlayerUtility::OpenDesL(const TDesC8& aDescriptor, TUid aControllerUid)
       
   222 	{
       
   223 	iBody->OpenDesL(aDescriptor, aControllerUid);
       
   224 	}
       
   225 
       
   226 /**
       
   227 Opens a video clip from a URL.
       
   228 
       
   229 This function opens a video clip stored at a specified URL and identified by a MIME type. In addition
       
   230 a plugin can be specified if necessary. If no controller plugin is specified, this function searches 
       
   231 through a list of all available plugins and attempts to use each one until successful or the end 
       
   232 of the list is reached.
       
   233 
       
   234 Once the opening of the video clip is complete, successfully or otherwise, the callback function 
       
   235 MVideoPlayerUtilityObserver::MvpuoOpenComplete() is called.
       
   236 
       
   237 This function can leave with one of the specified error codes. Most open failures
       
   238 will however be reported through the MVideoPlayerUtilityObserver interface.
       
   239 
       
   240 From Symbian release v9.5 onwards, this function will enable graphics surface use if the controller supports it. 
       
   241 If this function is called through an instance of the derived class CVideoPlayerUtility2 and the controller doesn't support graphics surfaces, 
       
   242 it fails with KErrNotSupported.
       
   243 
       
   244 @param  aUrl
       
   245         The URL of the video clip to open.
       
   246 @param  aIapId
       
   247         The Id of the internet access point to use
       
   248 @param  aMimeType
       
   249         The MIME type associated with this video clip. This is
       
   250         used to determine the format of the video clip.
       
   251 @param  aControllerUid
       
   252         If specified, it will force the video player to use the controller with the given Uid.
       
   253 
       
   254 @since  7.0s
       
   255 */
       
   256 EXPORT_C void CVideoPlayerUtility::OpenUrlL(const TDesC& aUrl, TInt aIapId, const TDesC8& aMimeType, TUid aControllerUid)
       
   257 	{
       
   258 	iBody->OpenUrlL(aUrl, aIapId, aMimeType, aControllerUid);
       
   259 	}
       
   260 
       
   261 /**
       
   262 Closes the video clip.
       
   263 
       
   264 @since 7.0s
       
   265 */
       
   266 EXPORT_C void CVideoPlayerUtility::Close()
       
   267 	{
       
   268 	iBody->Close();
       
   269 	}
       
   270 
       
   271 /**
       
   272 Begins playback of the initialised video sample at the current volume and priority levels.
       
   273 
       
   274 When playing of the video sample is complete, successfully or otherwise, the callback function
       
   275 MVideoPlayerUtilityObserver::MvpuoPlayComplete() is called.
       
   276 
       
   277 @since 7.0s
       
   278 */
       
   279 EXPORT_C void CVideoPlayerUtility::Play()
       
   280 	{
       
   281 	iBody->Play();
       
   282 	}
       
   283 
       
   284 /**
       
   285 Begins playback of the initialised video sample at the specified start and end points.
       
   286 
       
   287 When playing of the video sample is complete, successfully or otherwise, the callback function
       
   288 MVideoPlayerUtilityObserver::MvpuoPlayComplete() is called.
       
   289 
       
   290 @param  aStartTime
       
   291         The point at which to start playback.
       
   292 @param  aEndTime
       
   293         The point at which to terminate playback.
       
   294 
       
   295 @since 7.0s
       
   296 */
       
   297 EXPORT_C void CVideoPlayerUtility::Play(const TTimeIntervalMicroSeconds& aStartTime, const TTimeIntervalMicroSeconds& aEndTime)
       
   298 	{
       
   299 	iBody->Play(aStartTime, aEndTime);
       
   300 	}
       
   301 
       
   302 /**
       
   303 Stops playback of the video sample as soon as is possible. 
       
   304 
       
   305 If the video sample is playing, playback is stopped as soon as possible.
       
   306 
       
   307 If playback is already complete, this function has no effect.
       
   308 
       
   309 The position is reset to the beginning of the file.
       
   310 
       
   311 @return An error code indicating if the function call was successful. KErrNone on success, otherwise
       
   312         another of the system-wide error codes.
       
   313 
       
   314 @since  7.0s
       
   315 */
       
   316 EXPORT_C TInt CVideoPlayerUtility::Stop()
       
   317 	{
       
   318 	return iBody->Stop();
       
   319 	}
       
   320 
       
   321 /**
       
   322 Video playback is paused. The current position is maintained and playback can be
       
   323 resumed by calling Play.
       
   324 
       
   325 @since 7.0s
       
   326 */
       
   327 EXPORT_C void CVideoPlayerUtility::PauseL()
       
   328 	{
       
   329 	iBody->PauseL();
       
   330 	}
       
   331 
       
   332 /**
       
   333 Sets the playback volume for the audio track of the video clip.
       
   334 
       
   335 The volume can be changed before or during playback and is effective immediately. The volume can
       
   336 be set to any value between zero (mute) and the maximum permissible volume
       
   337 (determined using MaxVolume()).
       
   338 
       
   339 To determine if the current video clip contains an audio track, use AudioEnabledL().
       
   340 
       
   341 
       
   342 @param  aVolume
       
   343         The volume, between 0 and MaxVolume().
       
   344 
       
   345 @since 7.0s
       
   346 */
       
   347 EXPORT_C void CVideoPlayerUtility::SetVolumeL(TInt aVolume)
       
   348 	{
       
   349 	iBody->SetVolumeL(aVolume);
       
   350 	}
       
   351 
       
   352 
       
   353 //
       
   354 // Sends custom command to the plugin controller.
       
   355 // Passes handle and size of the drawable window.
       
   356 //
       
   357 /**
       
   358 Sets the display window. This is used to provide the video controller with an area of
       
   359 the display to render the current video frame.
       
   360 
       
   361 From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
       
   362 leave with KErrNotSupported.
       
   363 
       
   364 
       
   365 @param  aWs
       
   366         The window server session ID.
       
   367 @param  aScreenDevice
       
   368         The software device screen.
       
   369 @param  aWindow
       
   370         The window to display.
       
   371 @param  aScreenRect
       
   372         The dimensions of the display window.
       
   373 @param  aClipRect
       
   374         The area of the video clip to display in the window.
       
   375 
       
   376 @since 7.0s
       
   377 */
       
   378 EXPORT_C void CVideoPlayerUtility::SetDisplayWindowL(RWsSession& aWs, CWsScreenDevice& aScreenDevice,
       
   379 													 RWindowBase& aWindow, const TRect& aScreenRect,
       
   380 													 const TRect& aClipRect)
       
   381 	{
       
   382 	iBody->SetDisplayWindowL(aWs, aScreenDevice, aWindow, aScreenRect, aClipRect);
       
   383 	}
       
   384 
       
   385 /**
       
   386 Returns the video frame rate in frames/second.
       
   387 
       
   388 @return The video frame rate (frames/second).
       
   389 
       
   390 @since  7.0s
       
   391 */
       
   392 EXPORT_C TReal32 CVideoPlayerUtility::VideoFrameRateL() const
       
   393 	{
       
   394 	return iBody->VideoFrameRateL();
       
   395 	}
       
   396 
       
   397 /**
       
   398 Gets the video frame size.
       
   399 
       
   400 @param  aSize
       
   401         The video frame size
       
   402 
       
   403 @since 7.0s
       
   404 */
       
   405 EXPORT_C void CVideoPlayerUtility::VideoFrameSizeL(TSize& aSize) const
       
   406 	{
       
   407 	iBody->VideoFrameSizeL(aSize);
       
   408 	}
       
   409 
       
   410 /**
       
   411 Returns the current playback volume for the audio track of the video clip.
       
   412 
       
   413 @return A value between 0 (mute) and the maximum volume returned by MaxVolume().
       
   414 
       
   415 @since  7.0s
       
   416 */
       
   417 EXPORT_C TInt CVideoPlayerUtility::Volume() const
       
   418 	{
       
   419 	return iBody->Volume();
       
   420 	}
       
   421 
       
   422 /**
       
   423 Sets the current playback balance for the audio track of the video clip.
       
   424 
       
   425 The balance can be any value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight,
       
   426 the default value being KMMFBalanceCenter.
       
   427 
       
   428 @param  aBalance
       
   429         The balance value to set.
       
   430 
       
   431 @since 7.0s
       
   432 */
       
   433 EXPORT_C void CVideoPlayerUtility::SetBalanceL(TInt aBalance)
       
   434 	{
       
   435 	iBody->SetBalanceL(aBalance);
       
   436 	}
       
   437 
       
   438 /**
       
   439 Returns the current balance setting for the audio track of the video clip.
       
   440 
       
   441 @return A balance value between KMMFBalanceMaxLeft and KMMFBalanceMaxRight.
       
   442 
       
   443 @since  7.0s
       
   444 */
       
   445 EXPORT_C TInt CVideoPlayerUtility::Balance() const
       
   446 	{
       
   447 	return iBody->Balance();
       
   448 	}
       
   449 
       
   450 /**
       
   451 Returns the video format's MIME type.
       
   452 
       
   453 @return The video clip's MIME type.
       
   454 
       
   455 @since  7.0s
       
   456 @see    NumberOfMetaDataEntriesL
       
   457 */
       
   458 EXPORT_C const TDesC8& CVideoPlayerUtility::VideoFormatMimeType() const
       
   459 	{
       
   460 	return iBody->VideoFormatMimeType();
       
   461 	}
       
   462 
       
   463 /**
       
   464 Returns the number of meta data entries associated with this clip.
       
   465 
       
   466 @return The number of meta data entries.
       
   467 
       
   468 @since 7.0s
       
   469 */
       
   470 EXPORT_C TInt CVideoPlayerUtility::NumberOfMetaDataEntriesL() const
       
   471 	{
       
   472 	return iBody->NumberOfMetaDataEntriesL();
       
   473 	}
       
   474 
       
   475 /**
       
   476 Returns a meta data entry from the clip.
       
   477 
       
   478 @param  aMetaDataIndex
       
   479         The index of the meta data entry to retrieve.
       
   480 
       
   481 @return The metadata entry requested.
       
   482 
       
   483 @since  7.0s
       
   484 @see    NumberOfMetaDataEntriesL
       
   485 */
       
   486 EXPORT_C CMMFMetaDataEntry* CVideoPlayerUtility::MetaDataEntryL(TInt aMetaDataIndex) const
       
   487 	{
       
   488 	return iBody->MetaDataEntryL(aMetaDataIndex);
       
   489 	}
       
   490 
       
   491 /**
       
   492 Sets the playback priority. 
       
   493 
       
   494 This is used to arbitrate between multiple objects simultaneously trying to accesses
       
   495 the sound hardware.
       
   496 
       
   497 @param  aPriority
       
   498         The Priority Value.
       
   499 @param  aPref
       
   500         The Priority Preference.
       
   501 
       
   502 @see CVideoPlayerUtility::NewL()
       
   503 
       
   504 @since 7.0s
       
   505 
       
   506 */
       
   507 EXPORT_C void CVideoPlayerUtility::SetPriorityL(TInt aPriority, TInt aPref)
       
   508 	{
       
   509 	iBody->SetPriorityL(aPriority, aPref);
       
   510 	}
       
   511 
       
   512 /**
       
   513 Get the current playback priority. This is used to arbitrate between simultaneous accesses of
       
   514 the sound hardware.
       
   515 
       
   516 @param  aPriority
       
   517         On return, contains the priority level, EMdaPriorityMin client can be interrupted by any
       
   518         other client, EMdaPriorityNormal client can only be interrupted by a client with a higher 
       
   519         priority or EMdaPriorityMax client cannot be interrupted by other clients.
       
   520 @param  aPref
       
   521         On return, contains the time and quality preferences, enumerated in TMdaPriorityPreference.
       
   522 
       
   523 @since 7.0s
       
   524 */
       
   525 EXPORT_C void CVideoPlayerUtility::PriorityL(TInt& aPriority, TMdaPriorityPreference& aPref) const 
       
   526 	{
       
   527 	iBody->PriorityL(aPriority, aPref);
       
   528 	}
       
   529 
       
   530 /**
       
   531 Sets the position within the video clip from where to start playback.
       
   532 
       
   533 @param  aPosition
       
   534         Position from start of clip in microseconds.
       
   535 
       
   536 @since 7.0s
       
   537 */
       
   538 EXPORT_C void CVideoPlayerUtility::SetPositionL(const TTimeIntervalMicroSeconds& aPosition)
       
   539 	{
       
   540 	iBody->SetPositionL(aPosition);
       
   541 	}
       
   542 
       
   543 /**
       
   544 Returns the duration of video clip in mircoseconds.
       
   545 
       
   546 @return The duration of clip in microseconds.
       
   547 
       
   548 @since  7.0s
       
   549 */
       
   550 EXPORT_C TTimeIntervalMicroSeconds CVideoPlayerUtility::DurationL() const
       
   551 	{
       
   552 	return iBody->DurationL();
       
   553 	}
       
   554 
       
   555 /**
       
   556 Returns the current playback position.
       
   557 
       
   558 @return The current position from the start of the clip in microseconds.
       
   559 
       
   560 @since  7.0s
       
   561 */
       
   562 EXPORT_C TTimeIntervalMicroSeconds CVideoPlayerUtility::PositionL() const
       
   563 	{
       
   564 	return iBody->PositionL();
       
   565 	}
       
   566 
       
   567 /**
       
   568 Returns an integer representing the maximum volume that the audio track can support.
       
   569 
       
   570 This is the maximum value that can be passed to SetVolumeL(). This value is platform 
       
   571 independent, but is always greater than or equal to one.
       
   572 
       
   573 @return The naximum playback volume.
       
   574 
       
   575 @since  7.0s
       
   576 */
       
   577 EXPORT_C TInt CVideoPlayerUtility::MaxVolume() const
       
   578 	{
       
   579 	return iBody->MaxVolume();
       
   580 	}
       
   581 
       
   582 /**
       
   583 Gets the current frame. The current frame is requested, and will be sent to
       
   584 the client asynchrynously via the MvpuoFrameReady callback.
       
   585 
       
   586 @param  aDisplayMode
       
   587         The display mode for the retrieved frame.
       
   588 
       
   589 @since  7.0s
       
   590 */
       
   591 EXPORT_C void CVideoPlayerUtility::GetFrameL(TDisplayMode aDisplayMode)
       
   592 	{
       
   593 	iBody->GetFrameL(aDisplayMode);
       
   594 	}
       
   595 
       
   596 /**
       
   597 Gets the current frame. The current frame is requested, and will be sent to
       
   598 the client asynchrynously via the MvpuoFrameReady callback.
       
   599 
       
   600 @param  aDisplayMode
       
   601         The display mode for the retrieved frame.
       
   602 @param  aIntent
       
   603         The DRM Intent to pass to the controller.
       
   604 */
       
   605 EXPORT_C void CVideoPlayerUtility::GetFrameL(TDisplayMode aDisplayMode, ContentAccess::TIntent aIntent)
       
   606 	{
       
   607 	iBody->GetFrameL(aDisplayMode, ETrue, aIntent);
       
   608 	}
       
   609 
       
   610 /**
       
   611 Returns the video bit rate.
       
   612 
       
   613 @return The video bit rate in bits/second.
       
   614 
       
   615 @since  7.0s
       
   616 */
       
   617 EXPORT_C TInt CVideoPlayerUtility::VideoBitRateL() const
       
   618 	{
       
   619 	return iBody->VideoBitRateL();
       
   620 	}
       
   621 
       
   622 /**
       
   623 Returns the audio bit rate in bits/second.
       
   624 
       
   625 @return The audio bit rate (bits/second).
       
   626 
       
   627 @since  7.0s
       
   628 */
       
   629 EXPORT_C TInt CVideoPlayerUtility::AudioBitRateL() const
       
   630 	{
       
   631 	return iBody->AudioBitRateL();
       
   632 	}
       
   633 
       
   634 /**
       
   635 Returns whether the current clip has an audio stream and audio playback
       
   636 is enabled. This method will return EFalse if the clip does no have an
       
   637 audio track or if audio playback has been disabled with
       
   638 SetAudioEnabledL().
       
   639 
       
   640 @return ETrue if an audio track is present and audio playback is
       
   641         enabled, otherwise EFalse.
       
   642 
       
   643 @since  7.0s
       
   644 */
       
   645 EXPORT_C TBool CVideoPlayerUtility::AudioEnabledL() const
       
   646 	{
       
   647 	return iBody->AudioEnabledL();
       
   648 	}
       
   649 
       
   650 EXPORT_C void Reserved2()
       
   651 	{
       
   652 	// reserved function replacing removed VideoTypeL() method
       
   653 	// this function should never be called hence generate a
       
   654 	// panic with code ENoVideoTypeL
       
   655 	Panic( ENoVideoTypeL );
       
   656 	}
       
   657 
       
   658 /**
       
   659 Returns the codec used for the audio component of the video clip.
       
   660 
       
   661 @return The four character code representing the audio codec.
       
   662 
       
   663 @since  7.0s
       
   664 */
       
   665 EXPORT_C TFourCC CVideoPlayerUtility::AudioTypeL() const
       
   666 	{
       
   667 	return iBody->AudioTypeL();
       
   668 	}
       
   669 
       
   670 /**
       
   671 Gets the progress of video clip loading/rebuffering.
       
   672 
       
   673 @param aPercentageProgress
       
   674        The percentage of loading/rebuffering complete. The parameter
       
   675        is zero if loading has not begun and 100 if loading has already completed.
       
   676 
       
   677 @since 7.0s
       
   678 */
       
   679 EXPORT_C void CVideoPlayerUtility::GetVideoLoadingProgressL(TInt& aPercentageProgress)
       
   680 	{
       
   681 	iBody->GetVideoLoadingProgressL(aPercentageProgress);
       
   682 	}
       
   683 
       
   684 /**
       
   685 Sends a synchronous custom command to the controller.
       
   686 
       
   687 @param  aDestination
       
   688         The destination of the message, consisting of the UID of
       
   689         the interface of this message.
       
   690 @param  aFunction
       
   691         The function number to indicate which function is to be called
       
   692         on the interface defined in the aDestination parameter.
       
   693 @param  aDataTo1
       
   694         A reference to the first chunk of data to be copied to the controller
       
   695         framework. The exact contents of the data are dependent on the
       
   696         interface being called.  Can be KNullDesC8.
       
   697 @param  aDataTo2
       
   698         A reference to the second chunk of data to be copied to the controller
       
   699         framework. The exact contents of the data are dependent on the
       
   700         interface being called.  Can be KNullDesC8.
       
   701 @param  aDataFrom
       
   702         A reference to an area of memory to which the controller framework will
       
   703         write any data to be passed back to the client.  Can't be KNullDesC8.
       
   704 
       
   705 @return The result of the request. The exact range of values is dependent on the interface.
       
   706 
       
   707 @since  7.0s
       
   708 */
       
   709 EXPORT_C TInt CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom)
       
   710 	{
       
   711 	return iBody->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom);
       
   712 	}
       
   713 
       
   714 /**
       
   715 Sends a synchronous custom command to the controller.
       
   716 
       
   717 @param  aDestination
       
   718         The destination of the message, consisting of the uid of
       
   719         the interface of this message.
       
   720 @param  aFunction
       
   721         The function number to indicate which function is to be called
       
   722         on the interface defined in the aDestination parameter.
       
   723 @param  aDataTo1
       
   724         A reference to the first chunk of data to be copied to the controller
       
   725         framework. The exact contents of the data are dependent on the
       
   726         interface being called.  Can be KNullDesC8.
       
   727 @param  aDataTo2
       
   728         A reference to the second chunk of data to be copied to the controller
       
   729         framework. The exact contents of the data are dependent on the
       
   730         interface being called.  Can be KNullDesC8.
       
   731 
       
   732 @return The result of the request. The exact range of values is dependent on the interface.
       
   733 
       
   734 @since  7.0s
       
   735 */
       
   736 EXPORT_C TInt CVideoPlayerUtility::CustomCommandSync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2)
       
   737 	{
       
   738 	return iBody->CustomCommandSync(aDestination, aFunction, aDataTo1, aDataTo2);
       
   739 	}
       
   740 
       
   741 /**
       
   742 Sends an asynchronous custom command to the controller.
       
   743 
       
   744 Note: 
       
   745 This method will return immediately.  The RunL of the active object owning the
       
   746 aStatus parameter will be called when the command is completed by the
       
   747 controller framework.
       
   748 
       
   749 @param  aDestination
       
   750         The destination of the message, consisting of the uid of
       
   751         the interface of this message.
       
   752 @param  aFunction
       
   753         The function number to indicate which function is to be called
       
   754         on the interface defined in the aDestination parameter.
       
   755 @param  aDataTo1
       
   756         A reference to the first chunk of data to be copied to the controller
       
   757         framework. The exact contents of the data are dependent on the
       
   758         interface being called.  Can be KNullDesC8.
       
   759 @param  aDataTo2
       
   760         A reference to the second chunk of data to be copied to the controller
       
   761         framework. The exact contents of the data are dependent on the
       
   762         interface being called.  Can be KNullDesC8.
       
   763 @param  aDataFrom
       
   764         A reference to an area of memory to which the controller framework will
       
   765         write any data to be passed back to the client.  Can't be KNullDesC8.
       
   766 @param  aStatus
       
   767         The TRequestStatus of an active object.  This will contain the
       
   768         result of the request on completion.  The exact range of
       
   769         result values is dependent on the interface.
       
   770 
       
   771 @since  7.0s
       
   772 */
       
   773 EXPORT_C void CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TDes8& aDataFrom, TRequestStatus& aStatus)
       
   774 	{
       
   775 	iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aDataFrom, aStatus);
       
   776 	}
       
   777 
       
   778 /**
       
   779 Send a asynchronous custom command to the controller.
       
   780 
       
   781 Note: 
       
   782 This method will return immediately.  The RunL of the active object owning the
       
   783 aStatus parameter will be called when the command is completed by the
       
   784 controller framework.
       
   785 
       
   786 @param  aDestination
       
   787         The destination of the message, consisting of the uid of
       
   788         the interface of this message.
       
   789 @param  aFunction
       
   790         The function number to indicate which function is to be called
       
   791         on the interface defined in the aDestination parameter.
       
   792 @param  aDataTo1
       
   793         A reference to the first chunk of data to be copied to the controller
       
   794         framework. The exact contents of the data are dependent on the
       
   795         interface being called.  Can be KNullDesC8.
       
   796 @param  aDataTo2
       
   797         A reference to the second chunk of data to be copied to the controller
       
   798         framework. The exact contents of the data are dependent on the
       
   799         interface being called.  Can be KNullDesC8.
       
   800 @param  aStatus
       
   801         The TRequestStatus of an active object.  This will contain the
       
   802         result of the request on completion.  The exact range of
       
   803         result values is dependent on the interface.
       
   804 
       
   805 @since  7.0s
       
   806 */
       
   807 EXPORT_C void CVideoPlayerUtility::CustomCommandAsync(const TMMFMessageDestinationPckg& aDestination, TInt aFunction, const TDesC8& aDataTo1, const TDesC8& aDataTo2, TRequestStatus& aStatus)
       
   808 	{
       
   809 	iBody->CustomCommandAsync(aDestination, aFunction, aDataTo1, aDataTo2, aStatus);
       
   810 	}
       
   811 	
       
   812 /**
       
   813 Register to receive notifications of video clip loading/rebuffering.
       
   814 
       
   815 When a video clip is being streamed in, it may require rebuffering from time to time. This function 
       
   816 "switches on" callbacks that report the status of the rebuffering.
       
   817 
       
   818 The two callbacks that can be sent are MVideoLoadingObserver::MvloLoadingStarted() and 
       
   819 MVideoLoadingObserver::MvloLoadingComplete().
       
   820 
       
   821 @param  aCallback
       
   822         The object to receive video loading notifications.
       
   823 
       
   824 @since 7.0s
       
   825 */
       
   826 EXPORT_C void CVideoPlayerUtility::RegisterForVideoLoadingNotification(MVideoLoadingObserver& aCallback)
       
   827 	{
       
   828 	iBody->RegisterForVideoLoadingNotification(aCallback);
       
   829 	}
       
   830 
       
   831 /**
       
   832 Sets the video frame rate.
       
   833 
       
   834 @param  aFramesPerSecond
       
   835         The number of frames per second to request.
       
   836 
       
   837 @since 7.0s
       
   838 */
       
   839 EXPORT_C void CVideoPlayerUtility::SetVideoFrameRateL(TReal32 aFramesPerSecond)
       
   840 	{
       
   841 	iBody->SetVideoFrameRateL(aFramesPerSecond);
       
   842 	}
       
   843 
       
   844 /**
       
   845 Requests the video controller to redraw the current frame.
       
   846 
       
   847 @since 7.0s
       
   848 */
       
   849 EXPORT_C void CVideoPlayerUtility::RefreshFrameL()
       
   850 	{
       
   851 	iBody->RefreshFrameL();
       
   852 	}
       
   853 
       
   854 /**
       
   855 Rotates the video image on the screen.
       
   856 
       
   857 @param  aRotation
       
   858         The desired rotation to apply in 90 degree increments.
       
   859 
       
   860 @see    RotationL
       
   861 @since  7.0s
       
   862 */
       
   863 EXPORT_C void CVideoPlayerUtility::SetRotationL(TVideoRotation aRotation)
       
   864 	{
       
   865 	iBody->SetRotationL(aRotation);
       
   866 	}
       
   867 
       
   868 /**
       
   869 Query the rotation that is currently applied to the video image.
       
   870 
       
   871 @return The applied rotation
       
   872 
       
   873 @since 7.0s
       
   874 @see   SetRotationL
       
   875 */
       
   876 EXPORT_C TVideoRotation CVideoPlayerUtility::RotationL() const
       
   877 	{
       
   878 	return iBody->RotationL();
       
   879 	}
       
   880 
       
   881 /**
       
   882 Scales the video image to a specified percentage of its original size.
       
   883 
       
   884 @param  aWidthPercentage
       
   885         The percentage (100 = original size) to be used to scale the width of the video image
       
   886 @param  aHeightPercentage
       
   887         The percentage (100 = original size) to be used to scale the height of the video image. 
       
   888         If this is not equal to aWidthPercentage then the image may be distorted.
       
   889 @param  aAntiAliasFiltering
       
   890         A boolean specifying if anti-aliasing should be used. True if anti-aliasing filtering 
       
   891         should be used.  If the plugin does not	support this kind of processing, 
       
   892         this value will be ignored.
       
   893 
       
   894 @since  7.0s
       
   895 @see    GetScaleFactorL
       
   896 */
       
   897 EXPORT_C void CVideoPlayerUtility::SetScaleFactorL(TReal32 aWidthPercentage, TReal32 aHeightPercentage, TBool aAntiAliasFiltering)
       
   898 	{
       
   899 	iBody->SetScaleFactorL(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering);
       
   900 	}
       
   901 
       
   902 /**
       
   903 Gets the scale factor currently applied to the video image.
       
   904 
       
   905 @param  aWidthPercentage
       
   906         On function return, contains the current scaling percentage applied to the width of the
       
   907         video image (100 = original size).
       
   908 @param  aHeightPercentage
       
   909         On function return, contains the current scaling percentage applied to the height of the
       
   910         of the video image (100 = original size).
       
   911 @param  aAntiAliasFiltering
       
   912         The boolean specifying if anit-aliasing is being used.
       
   913 
       
   914 @since  7.0s
       
   915 @see    SetScaleFactorL
       
   916 */
       
   917 EXPORT_C void CVideoPlayerUtility::GetScaleFactorL(TReal32& aWidthPercentage, TReal32& aHeightPercentage, TBool& aAntiAliasFiltering) const
       
   918 	{
       
   919 	iBody->GetScaleFactorL(aWidthPercentage, aHeightPercentage, aAntiAliasFiltering);
       
   920 	}
       
   921 
       
   922 /**
       
   923 Selects a region of the video image to be displayed.
       
   924 
       
   925 @param  aCropRegion
       
   926         The dimensions of the crop region, relative to the video image.
       
   927 
       
   928 @since 7.0s
       
   929 @see   GetCropRegionL
       
   930 */
       
   931 EXPORT_C void CVideoPlayerUtility::SetCropRegionL(const TRect& aCropRegion)
       
   932 	{
       
   933 	iBody->SetCropRegionL(aCropRegion);
       
   934 	}
       
   935 
       
   936 /**
       
   937 Gets the crop region currently applied to the image.
       
   938 
       
   939 @param  aCropRegion
       
   940         The dimensions of the crop region, relative to the video image. If no
       
   941         crop region has been applied, the full dimensions of the video image will
       
   942         be returned.
       
   943 
       
   944 @since 7.0s
       
   945 @see   SetCropRegionL
       
   946 */
       
   947 EXPORT_C void CVideoPlayerUtility::GetCropRegionL(TRect& aCropRegion) const
       
   948 	{
       
   949 	iBody->GetCropRegionL(aCropRegion);
       
   950 	}
       
   951 
       
   952 /**
       
   953 Prepares the video clip to be accessed.
       
   954 
       
   955 A call to this method tells the loaded controller plugin to finalise its configuration
       
   956 and to prepare to start reading the video clip.  It is not possible to play the video clip
       
   957 or query any of its properties (e.g. duration, meta data etc.) until this method has signalled
       
   958 its completion (successful or otherwise) via the callback MvpuoPrepareComplete.
       
   959 
       
   960 @since  7.0s
       
   961 */
       
   962 EXPORT_C void CVideoPlayerUtility::Prepare()
       
   963 	{
       
   964 	iBody->Prepare();
       
   965 	}
       
   966 
       
   967 /**
       
   968 Returns the controller implementation information associated with the current controller.
       
   969 
       
   970 @return The controller implementation structure associated with the controller.
       
   971 
       
   972 @since 7.0s
       
   973 */
       
   974 EXPORT_C const CMMFControllerImplementationInformation& CVideoPlayerUtility::ControllerImplementationInformationL()
       
   975 	{
       
   976 	return iBody->ControllerImplementationInformationL();
       
   977 	}
       
   978 
       
   979 /**
       
   980 Gets a controller's DRM custom command implementation.
       
   981 
       
   982 @return A pointer to a controller's DRM custom command implementation, or NULL
       
   983 if the controller does not support it.
       
   984 */
       
   985 EXPORT_C MMMFDRMCustomCommand* CVideoPlayerUtility::GetDRMCustomCommand()
       
   986 	{
       
   987 	return iBody->GetDRMCustomCommand();
       
   988 	}
       
   989 
       
   990 
       
   991 /**
       
   992 Enables a client application to stop the video player from using direct screen access (DSA).
       
   993 
       
   994 From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
       
   995 leave with KErrNotSupported.
       
   996 
       
   997 This function leaves if errors are encountered when trying to stop DSA.
       
   998 */
       
   999 EXPORT_C void CVideoPlayerUtility::StopDirectScreenAccessL()
       
  1000 	{
       
  1001 	iBody->StopDirectScreenAccessL();
       
  1002 	}
       
  1003 
       
  1004 /**
       
  1005 Enables a client application to start the video player using direct screen access (DSA).
       
  1006 
       
  1007 From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
       
  1008 leave with KErrNotSupported.
       
  1009 
       
  1010 This function leaves if errors are encountered when trying to start DSA.
       
  1011 */
       
  1012 EXPORT_C void CVideoPlayerUtility::StartDirectScreenAccessL()
       
  1013 	{
       
  1014 	iBody->StartDirectScreenAccessL();
       
  1015 	}
       
  1016 
       
  1017 /**
       
  1018 Registers for notification, when audio resource is available.
       
  1019 
       
  1020 @param	aCallback
       
  1021       	Observer interface for audio resource notification event
       
  1022       	
       
  1023 @param 	aNotificationEventId
       
  1024  		The Event for which the client registers.
       
  1025  	
       
  1026 @param 	aNotificationRegistrationData
       
  1027 		Data specific to notification registration.This has been reserved for future use and its value should be NULL.
       
  1028 	
       
  1029 @return An error code indicating if the registration is successful. KErrNone on success, 
       
  1030 	otherwise another of the system-wide error codes.
       
  1031 */
       
  1032 EXPORT_C TInt CVideoPlayerUtility::RegisterAudioResourceNotification(MMMFAudioResourceNotificationCallback& aCallback, TUid aNotificationEventId, const TDesC8& aNotificationRegistrationData)
       
  1033 	{
       
  1034 	return iBody->RegisterAudioResourceNotification(aCallback, aNotificationEventId, aNotificationRegistrationData);	
       
  1035 	}
       
  1036 
       
  1037 /**
       
  1038 Cancels the registration for audio resource notification.
       
  1039 
       
  1040 @param  aNotificationEventId
       
  1041 	The Event to be cancellled.
       
  1042 	
       
  1043 @return An error code indicating if the cancellation is successful. KErrNone on success, 
       
  1044 	otherwise another of the system-wide error codes.
       
  1045 */
       
  1046 EXPORT_C TInt CVideoPlayerUtility::CancelRegisterAudioResourceNotification(TUid aNotificationEventId)
       
  1047 	{
       
  1048 	return iBody->CancelRegisterAudioResourceNotification(aNotificationEventId);
       
  1049 	}
       
  1050 
       
  1051 /**
       
  1052 Waits for the client to resume the play even after the default timer expires.
       
  1053 Unless the client completes the play no other client gets notification.
       
  1054 
       
  1055 @return An error code indicating if the function call is successful. KErrNone on success, 
       
  1056 		otherwise another of the system-wide error codes.
       
  1057 */
       
  1058 EXPORT_C TInt CVideoPlayerUtility::WillResumePlay()
       
  1059 	{
       
  1060 	return iBody->WillResumePlay();	
       
  1061 	}
       
  1062 
       
  1063 /**
       
  1064 Sets the initial screen to be used for the video display.
       
  1065 
       
  1066 From Symbian release 9.5 onwards this method is not supported when called on an instance of CVideoPlayerUtility2, and will always 
       
  1067 leave with KErrNotSupported.
       
  1068 
       
  1069 @param  aScreenNumber
       
  1070         The screen number of the device.
       
  1071 
       
  1072 @return KErrNotSupported if the secondary screen display is not supported in Multimedia Framework or 
       
  1073 from Symbian release 9.5 onwards when called on an instance of CVideoPlayerUtility2. KErrNone on success.
       
  1074 */
       
  1075 EXPORT_C TInt CVideoPlayerUtility::SetInitScreenNumber(TInt aScreenNumber)
       
  1076 	{
       
  1077 	return iBody->SetInitScreenNumber(aScreenNumber);
       
  1078 	}
       
  1079 	
       
  1080 _LIT(KMMFMediaClientVideoPanicCategory, "MediaClientVideo");
       
  1081 GLDEF_C void Panic(TMmfVideoPanic aError)
       
  1082 	{
       
  1083 	User::Panic(KMMFMediaClientVideoPanicCategory, aError);
       
  1084 	}
       
  1085 
       
  1086 /**
       
  1087 Set video playback velocity relative to the normal video clip speed.
       
  1088 This method can be used for fast forward, rewind, and slow-motion
       
  1089 playback, depending on the capabilities of the underlying play-controller
       
  1090 implementation and the characteristics of the video clip. Velocity set
       
  1091 in this call will take effect immediately. Additionally,
       
  1092 playback velocity cannot be changed for streamed video. Use
       
  1093 GetPlayRateCapabilitiesL() to determine what playback modes are
       
  1094 available.
       
  1095 
       
  1096 Note that due to performance reasons, it may not be possible to perform
       
  1097 fast forward or rewind at the requested speed. If that happens, the
       
  1098 play-controller will use the nearest available velocity. This is not
       
  1099 considered an error and the method will not leave. User can query
       
  1100 velocity in effect by calling PlayVelocityL().
       
  1101 
       
  1102 The default playback velocity is 100.
       
  1103 Play velocity is persistent across stop play calls on utility. 
       
  1104 That is SetPlayVelocityL(),call StopL(),then PlayL() will play with 
       
  1105 the velocity set in most recent call. On opening different
       
  1106 file the velocity will default to 100.
       
  1107 
       
  1108 This function quits or exits leaving any of the system wide error codes.
       
  1109 Common error codes are listed below.
       
  1110 
       
  1111 @param aVelocity Playback velocity as a percentage relative to the
       
  1112                  normal video clip speed. Use 100 for normal-speed
       
  1113                  forward playback and negative value for reverse. Values above
       
  1114                  100 and below 0 correspond to fast forward and
       
  1115                  rewind respectively, while values 1 to 100 represent
       
  1116                  slow-motioned playback.
       
  1117 
       
  1118 @pre Playback has been started, but may be paused.
       
  1119 
       
  1120 @see CVideoPlayerUtility::GetPlayRateCapabilitiesL()
       
  1121 
       
  1122 @leave KErrNotSupported The requested playback velocity is not
       
  1123          supported.
       
  1124 @leave KErrNotReady Playback has not yet been started
       
  1125 
       
  1126 @publishedPartner
       
  1127 */
       
  1128 EXPORT_C void CVideoPlayerUtility::SetPlayVelocityL(TInt aVelocity)
       
  1129 	{
       
  1130 	iBody->SetPlayVelocityL(aVelocity);
       
  1131 	}
       
  1132 
       
  1133 /**
       
  1134 Returns the current playback velocity. If setting play velocity is
       
  1135 not supported or velocity is not set this will return default play velocity
       
  1136 100 corresponding to normal playback.
       
  1137 
       
  1138 If implementation is not supporting the velocity set with SetPlayVelocityL
       
  1139 it will default to the nearest velocity. In this case this API will return
       
  1140 the value it has defaulted to.
       
  1141 
       
  1142 If an error occurs, this function leaves with any of the system
       
  1143 wide error codes. Common error codes are listed below.
       
  1144 
       
  1145 @return The current playback velocity as a percentage relative to the
       
  1146         normal video clip speed.
       
  1147 
       
  1148 @pre Playback has been started, but may be paused.
       
  1149 
       
  1150 @see CVideoPlayerUtility::SetPlayVelocityL()
       
  1151 
       
  1152 @leave KErrNotReady Playback has not yet been started
       
  1153 
       
  1154 @publishedPartner
       
  1155 */
       
  1156 EXPORT_C TInt CVideoPlayerUtility::PlayVelocityL() const
       
  1157 	{
       
  1158 	return iBody->PlayVelocityL();
       
  1159 	}
       
  1160 
       
  1161 /**
       
  1162 Steps the current video playback position forward or backward by a
       
  1163 number of frames. Frame step is only available when playback is paused.
       
  1164 
       
  1165 Support for frame stepping may depend on the underlying play-controller
       
  1166 implementation and the video clip open. Additionally, frame step is
       
  1167 typically not available in streamed playback. Use GetPlayRateCapabilitiesL()
       
  1168 to query if frame step is currently possible. Application may check the
       
  1169 value of the current positon after stepping through several frames by calling
       
  1170 PositionL() API.
       
  1171 
       
  1172 Implementations may not be able to step exactly the number of frames
       
  1173 requested, especially when stepping backwards. If this happens, the
       
  1174 play-controller will step to a frame close to the one requested. This is
       
  1175 not considered an error.
       
  1176 
       
  1177 This function quits or exits leaving any of the system wide error codes.
       
  1178 Common error codes are listed below.
       
  1179 
       
  1180 @param aStep The number of frames to step. Use positive values for
       
  1181              stepping forward and negative values for stepping
       
  1182              back.
       
  1183 
       
  1184 @pre Playback has been started and is currently paused. 
       
  1185 	 That means this API can be called only in paused state.
       
  1186 
       
  1187 @see CVideoPlayerUtility::GetPlayRateCapabilitiesL()
       
  1188 
       
  1189 @leave KErrNotSupported Frame step is not supported. Note that some
       
  1190          implementations may support step forward but not step backward.
       
  1191 @leave KErrNotReady Playback has not yet been started or is not in paused state.
       
  1192 
       
  1193 @publishedPartner
       
  1194 */
       
  1195 EXPORT_C void CVideoPlayerUtility::StepFrameL(TInt aStep)
       
  1196 	{
       
  1197 	iBody->StepFrameL(aStep);
       
  1198 	}
       
  1199 
       
  1200 /**
       
  1201 Queries the current playback rate capabilities. The capabilities
       
  1202 describe whether fast forward, reverse playback, slow motion, or
       
  1203 step backward or forward is possible. The capabilities may depend on
       
  1204 the controller implementation and the video clip. Additionally,
       
  1205 only normal-speed forward playback is typically possible in streamed playback.
       
  1206 
       
  1207 This function quits or exits leaving any of the system wide error codes.
       
  1208 Common error codes are listed below.
       
  1209 
       
  1210 @param aCapabilities Playback rate capabilities
       
  1211 
       
  1212 @pre The video clip has been opened
       
  1213 
       
  1214 @leave KErrNotReady The video clip has not yet been opened
       
  1215 
       
  1216 @publishedPartner
       
  1217 */
       
  1218 EXPORT_C void CVideoPlayerUtility::GetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities)const
       
  1219 	{
       
  1220 	iBody->GetPlayRateCapabilitiesL(aCapabilities);
       
  1221 	}
       
  1222 
       
  1223 /**
       
  1224 Enables or disables video playback. This function is used to disable
       
  1225 video playback in a video clip to play only the audio track. By default
       
  1226 video playback is always enabled if the clip has a video track.
       
  1227 
       
  1228 This method can be called after the video clip has been opened, but
       
  1229 only before calling Prepare().
       
  1230 
       
  1231 This function quits or exits leaving any of the system wide error codes.
       
  1232 Common error codes are listed below.
       
  1233 
       
  1234 @param aVideoEnabled ETrue to enable video playback, EFalse to disable
       
  1235 
       
  1236 @pre The video clip has been opened by the client and Prepare() has not been called.
       
  1237 
       
  1238 @leave KErrNotSupported This method is not supported -- video playback
       
  1239          is always enabled. 
       
  1240 @leave KErrNotReady The clip has not been opened or the client has
       
  1241          already called Prepare().
       
  1242 
       
  1243 @publishedPartner
       
  1244 */
       
  1245 EXPORT_C void CVideoPlayerUtility::SetVideoEnabledL(TBool aVideoEnabled)
       
  1246 	{
       
  1247 	iBody->SetVideoEnabledL(aVideoEnabled);
       
  1248 	}
       
  1249 
       
  1250 /**
       
  1251 Queries whether video playback is currently enabled or not.
       
  1252 If an error occurs, this function leaves with any of the system
       
  1253 wide error codes. Common error codes are listed below.
       
  1254 
       
  1255 @return ETrue if video playback is enabled, EFalse if not.
       
  1256 
       
  1257 @publishedPartner
       
  1258 */
       
  1259 EXPORT_C TBool CVideoPlayerUtility::VideoEnabledL() const
       
  1260 	{
       
  1261 	return iBody->VideoEnabledL();
       
  1262 	}
       
  1263 
       
  1264 /**
       
  1265 Enables or disables audio playback. This function is used to disable
       
  1266 audio playback in a video clip to play only the video track. By default
       
  1267 audio playback is always enabled if the clip has an audio track.
       
  1268 
       
  1269 This method can be called after the video clip has been opened, but
       
  1270 only before calling Prepare().
       
  1271 
       
  1272 This function quits or exits leaving any of the system wide error codes.
       
  1273 Common error codes are listed below.
       
  1274 
       
  1275 @param aAudioEnabled ETrue to enable audio playback, EFalse to disable
       
  1276 
       
  1277 @pre The video clip has been opened by the client and Prepare() has not been called.
       
  1278 
       
  1279 @leave KErrNotSupported This method is not supported -- audio playback
       
  1280          is always enabled
       
  1281 @leave KErrNotReady The clip has not been opened or the client has
       
  1282          already called Prepare().
       
  1283 
       
  1284 @publishedPartner
       
  1285 */
       
  1286 EXPORT_C void CVideoPlayerUtility::SetAudioEnabledL(TBool aAudioEnabled)
       
  1287 	{
       
  1288 	iBody->SetAudioEnabledL(aAudioEnabled);
       
  1289 	}
       
  1290 
       
  1291 /** 
       
  1292 Set video automatic scaling. When automatic scaling is active, the
       
  1293 video picture is scaled automatically to match the video window,
       
  1294 based on the scaling type. This variant of SetAutoScaleL() will
       
  1295 always center the picture in the window.
       
  1296 
       
  1297 Calling SetAutoScaleL() will override any scaling factors set with
       
  1298 SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic
       
  1299 scaling.
       
  1300 
       
  1301 Not all video controllers support automatic scaling. 
       
  1302 
       
  1303 This function quits or exits leaving any of the system wide error codes.
       
  1304 Common error codes are listed below.
       
  1305 
       
  1306 @see TAutoScaleType, THorizontalAlign, TVerticalAlign
       
  1307 
       
  1308 @param aScaleType Automatic scaling type
       
  1309 
       
  1310 @pre The video clip has been opened by the client
       
  1311 
       
  1312 @leave KErrNotSupported Automatic scaling is not supported
       
  1313 */
       
  1314 EXPORT_C void CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType aScaleType)
       
  1315 	{
       
  1316 	iBody->SetAutoScaleL(aScaleType);
       
  1317 	}
       
  1318 
       
  1319 /** 
       
  1320 Set video automatic scaling. When automatic scaling is active, the
       
  1321 video picture is scaled automatically to match the video window,
       
  1322 based on the scaling type, and positioned according to the
       
  1323 parameters.
       
  1324 
       
  1325 Calling SetAutoScaleL() will override any scaling factors set with
       
  1326 SetScaleFactorL(). Calling SetScaleFactorL() will disable automatic
       
  1327 scaling.
       
  1328 
       
  1329 Not all video controller support automatic scaling. 
       
  1330 
       
  1331 This function quits or exits leaving any of the system wide error codes.
       
  1332 Common error codes are listed below.
       
  1333 
       
  1334 @see TAutoScaleType, THorizontalAlign, TVerticalAlign
       
  1335 
       
  1336 @param aScaleType Automatic scaling type
       
  1337 @param aHorizPos Video picture horizontal position, relative to the
       
  1338                  video window. The value can be either a pixel offset
       
  1339                  (positive or negative) from the top left corner of the
       
  1340                  window to the top left corner of the picture, or an
       
  1341                  alignment constant from enum THorizontalAlign.
       
  1342 @param aVertPos Video picture vertical position, relative to the
       
  1343                  video window. The value can be either a pixel offset
       
  1344                  (positive or negative) from the top left corner of the
       
  1345                  window to the top left corner of the picture, or an
       
  1346                  alignment constant from enum TVerticalAlign.
       
  1347 
       
  1348 @pre The video clip has been opened by the client.
       
  1349 
       
  1350 @leave KErrNotSupported Automatic scaling is not supported
       
  1351 */
       
  1352 EXPORT_C void CVideoPlayerUtility::SetAutoScaleL(TAutoScaleType aScaleType, TInt aHorizPos, TInt aVertPos)
       
  1353 	{
       
  1354 	iBody->SetAutoScaleL(aScaleType, aHorizPos, aVertPos );
       
  1355 	}
       
  1356 
       
  1357 /**
       
  1358 When enabled sets automatic switching of surface to/from external display when it is connected/disconnected from the device.
       
  1359 
       
  1360 Automatic switching is enabled by default, but only if the client thread that created this utility has an Active Scheduler
       
  1361 installed and the device supports external display switching.
       
  1362 
       
  1363 To use this function the client thread must have an Active Scheduler installed otherwise it will leave with KErrNotReady.
       
  1364 
       
  1365 @param  aControl
       
  1366         ETrue to enable. EFalse to disable.
       
  1367 @param  aDisplay
       
  1368         Display id of display to enable external switching for.
       
  1369 @leave  KErrNotSupported Device does not support external displays
       
  1370 @leave  KErrNotReady CActiveScheduler is not installed
       
  1371 */
       
  1372 EXPORT_C void CVideoPlayerUtility::SetExternalDisplaySwitchingL(TInt aDisplay, TBool aControl)
       
  1373     {
       
  1374     iBody->SetExternalDisplaySwitchingL(aDisplay, aControl);
       
  1375     }