videoplayback/videohelix/tsrc/ut_videohelixtest/src/mpxvideoplayerutility_stub.cpp
changeset 0 96612d01cf9f
child 1 6711b85517b7
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: Stub for helix
       
    15 *
       
    16 */
       
    17 
       
    18 // Version : %version: 10 %
       
    19 
       
    20 #include <audiopreference.h>
       
    21 #include <mmf/server/mmffile.h>
       
    22 
       
    23 #include "stifutilities.h"
       
    24 #include "mpxvideoplayerutility_stub.h"
       
    25 #include "mpxvideoplaybackcontroller.h"
       
    26 #include "mpxvideo_debug.h"
       
    27 
       
    28 
       
    29 
       
    30 #define MAX_VOLUME 100
       
    31 
       
    32 CMpxVideoPlayerUtility*
       
    33 CMpxVideoPlayerUtility::NewL( CMPXVideoPlaybackController* aVideoPlaybackCtrl )
       
    34 {
       
    35     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::NewL()"));
       
    36 
       
    37     StifUtilities* utility = reinterpret_cast<StifUtilities*>( Dll::Tls() );
       
    38 
       
    39     if ( ! utility->iPlayerUtility )
       
    40     {
       
    41         utility->iPlayerUtility = new (ELeave) CMpxVideoPlayerUtility( aVideoPlaybackCtrl );
       
    42         utility->iPlayerUtility->ConstructL();
       
    43     }
       
    44 
       
    45     return utility->iPlayerUtility;
       
    46 }
       
    47 
       
    48 CMpxVideoPlayerUtility::CMpxVideoPlayerUtility( CMPXVideoPlaybackController* aVideoPlaybackCtrl )
       
    49     : iVideoPlaybackController( aVideoPlaybackCtrl )
       
    50     , iFirstPlayCmd( ETrue )
       
    51 {
       
    52 }
       
    53 
       
    54 void CMpxVideoPlayerUtility::ConstructL()
       
    55 {
       
    56     iEventArray = new (ELeave) CMmfCallbackArray( 1 );
       
    57     iCallback   = CIdle::NewL( CActive::EPriorityLow );
       
    58 }
       
    59 
       
    60 CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()
       
    61 {
       
    62     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::~CMpxVideoPlayerUtility()"));
       
    63 
       
    64     if ( iCallback->IsActive() )
       
    65     {
       
    66         iCallback->Cancel();
       
    67     }
       
    68 
       
    69     delete iCallback;
       
    70 
       
    71     iEventArray->ResetAndDestroy();
       
    72 }
       
    73 
       
    74 void CMpxVideoPlayerUtility::Close()
       
    75 {
       
    76     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Close()"));
       
    77 }
       
    78 
       
    79 void CMpxVideoPlayerUtility::Reset()
       
    80 {
       
    81     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Reset()"));
       
    82 }
       
    83 
       
    84 void CMpxVideoPlayerUtility::OpenControllerL()
       
    85 {
       
    86     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenControllerL()"));
       
    87 }
       
    88 
       
    89 TTimeIntervalMicroSeconds CMpxVideoPlayerUtility::PositionL() const
       
    90 {
       
    91     MPX_DEBUG(_L("CMpxVideoPlayerUtility::PositionL(%Ld)"), iPosition.Int64());
       
    92 
       
    93     return iPosition;
       
    94 }
       
    95 
       
    96 TTimeIntervalMicroSeconds CMpxVideoPlayerUtility::DurationL() const
       
    97 {
       
    98     TTimeIntervalMicroSeconds dur( iDuration );
       
    99     MPX_DEBUG(_L("CMpxVideoPlayerUtility::DurationL(%Ld)"), dur.Int64());
       
   100     return dur;
       
   101 }
       
   102 
       
   103 TInt CMpxVideoPlayerUtility::NumberOfMetaDataEntriesL() const
       
   104 {
       
   105     MPX_DEBUG(_L("CMpxVideoPlayerUtility::NumberOfMetaDataEntriesL(%d)"), iMetaData.Count() );
       
   106 
       
   107     return iMetaData.Count();
       
   108 }
       
   109 
       
   110 CMMFMetaDataEntry* CMpxVideoPlayerUtility::MetaDataEntryL( TInt aMetaDataIndex ) const
       
   111 {
       
   112     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::MetaDataEntryL()"),
       
   113                    _L("index = %d"), aMetaDataIndex );
       
   114 
       
   115     CMMFMetaDataEntry* pEntry = NULL;
       
   116 
       
   117     if ( aMetaDataIndex < iMetaData.Count() )
       
   118     {
       
   119         CMMFMetaDataEntry* pTmp = iMetaData[aMetaDataIndex];
       
   120 
       
   121         if ( pTmp )
       
   122         {
       
   123             pEntry = CMMFMetaDataEntry::NewL( pTmp->Name(), pTmp->Value() );
       
   124         }
       
   125     }
       
   126 
       
   127     return pEntry;
       
   128 }
       
   129 
       
   130 void CMpxVideoPlayerUtility::SetVolumeL( TInt aVolume )
       
   131 {
       
   132     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetVolumeL()"),
       
   133                    _L("volume = %d"), aVolume );
       
   134 
       
   135     iVolume = aVolume;
       
   136 }
       
   137 
       
   138 TInt CMpxVideoPlayerUtility::Volume() const
       
   139 {
       
   140     TInt vol = iVolume;
       
   141 
       
   142     MPX_DEBUG(_L("CMpxVideoPlayerUtility::Volume(%d)"), vol);
       
   143 
       
   144     return vol;
       
   145 }
       
   146 
       
   147 TInt CMpxVideoPlayerUtility::MaxVolume() const
       
   148 {
       
   149     TInt maxVol = MAX_VOLUME;
       
   150 
       
   151     MPX_DEBUG(_L("CMpxVideoPlayerUtility::MaxVolume(%d)"), maxVol);
       
   152 
       
   153     return maxVol;
       
   154 }
       
   155 
       
   156 void CMpxVideoPlayerUtility::VideoFrameSizeL( TSize& aSize ) const
       
   157 {
       
   158     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::VideoFrameSizeL()"));
       
   159     aSize = iSize;
       
   160 }
       
   161 
       
   162 TInt CMpxVideoPlayerUtility::AudioBitRateL() const
       
   163 {
       
   164     TInt bitRate = iAudioBitRate;
       
   165 
       
   166     MPX_DEBUG(_L("CMpxVideoPlayerUtility::AudioBitRateL(%d)"), bitRate);
       
   167 
       
   168     return bitRate;
       
   169 }
       
   170 
       
   171 TInt CMpxVideoPlayerUtility::VideoBitRateL() const
       
   172 {
       
   173     TInt bitRate = iVideoBitRate;
       
   174 
       
   175     MPX_DEBUG(_L("CMpxVideoPlayerUtility::VideoBitRateL(%d)"), bitRate);
       
   176 
       
   177     return bitRate;
       
   178 }
       
   179 
       
   180 TInt CMpxVideoPlayerUtility::VideoFormatMimeType( TDes8& aMimeType ) const
       
   181 {
       
   182     if ( iMimeType )
       
   183     {
       
   184         aMimeType = iMimeType->Des();
       
   185     }
       
   186 
       
   187     return KErrNone;
       
   188 }
       
   189 
       
   190 void CMpxVideoPlayerUtility::RefreshFrameL()
       
   191 {
       
   192     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RefreshFrameL()"));
       
   193 }
       
   194 
       
   195 void CMpxVideoPlayerUtility::RestartDsa( const TRegion& /*aRegion*/ )
       
   196 {
       
   197     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::RestartDsa()"));
       
   198 
       
   199     if ( iStifObserver )
       
   200     {
       
   201         TCallbackEvent* event = new TCallbackEvent;
       
   202         event->iEvent = EPbCmdRestartDSA;
       
   203         event->iData  = 0;
       
   204         event->iError = KErrNone;
       
   205         iStifObserver->HandleUtilityEvent( event );
       
   206     }
       
   207 }
       
   208 
       
   209 void CMpxVideoPlayerUtility::AbortDsa()
       
   210 {
       
   211     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::AbortDsa()"));
       
   212 
       
   213     if ( iStifObserver )
       
   214     {
       
   215         TCallbackEvent* event = new TCallbackEvent;
       
   216         event->iEvent = EPbCmdAbortDSA;
       
   217         event->iData  = 0;
       
   218         event->iError = KErrNone;
       
   219         iStifObserver->HandleUtilityEvent( event );
       
   220     }
       
   221 }
       
   222 
       
   223 void CMpxVideoPlayerUtility::SetDisplayWindowL( const TRect& /*aScreenRect*/,
       
   224                                                 const TRect& /*aClipRect*/,
       
   225                                                 const TRegion& /*aDrawingRegion*/ )
       
   226 {
       
   227     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetDisplayWindowL()"));
       
   228 
       
   229     if ( iStifObserver )
       
   230     {
       
   231         TCallbackEvent* event = new TCallbackEvent;
       
   232         event->iEvent = EPbCmdSetDisplayWindow;
       
   233         event->iData  = 0;
       
   234         event->iError = KErrNone;
       
   235         iStifObserver->HandleUtilityEvent( event );
       
   236     }
       
   237 }
       
   238 
       
   239 TBool CMpxVideoPlayerUtility::AudioEnabledL() const
       
   240 {
       
   241     TBool enabled = iAudioEnabled;
       
   242 
       
   243     MPX_DEBUG(_L("CMpxVideoPlayerUtility::AudioEnabledL(%d)"), enabled);
       
   244 
       
   245     return enabled;
       
   246 }
       
   247 
       
   248 void CMpxVideoPlayerUtility::Prepare()
       
   249 {
       
   250     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Prepare()"));
       
   251 
       
   252     //
       
   253     //  Read PrepareComplete error
       
   254     //
       
   255     RFile file;
       
   256     _LIT(KFileName, "\\vhpp_prepareerror.txt");
       
   257 
       
   258     RFs fs;
       
   259     fs.Connect();
       
   260 
       
   261     file.Open( fs, KFileName, EFileRead | EFileShareAny );
       
   262 
       
   263     TInt prepError;
       
   264     HBufC8* fBuf = HBufC8::NewL( 16 );
       
   265     TPtr8 fileBuf = fBuf->Des();
       
   266 
       
   267     file.Read( fileBuf, 16 );
       
   268 
       
   269     TLex8 number( fileBuf );
       
   270     number.Val( prepError );
       
   271 
       
   272     TMMFEvent* event = new TMMFEvent();
       
   273 
       
   274     event->iEventType = KMMFEventCategoryVideoPrepareComplete;
       
   275     event->iErrorCode = prepError;
       
   276 
       
   277     AddCallbackEvent( event );
       
   278 
       
   279     file.Close();
       
   280     fs.Close();
       
   281 }
       
   282 
       
   283 void CMpxVideoPlayerUtility::GetVideoLoadingProgressL( TInt& aPercentageProgress )
       
   284 {
       
   285     aPercentageProgress = 100;
       
   286 
       
   287     MPX_DEBUG(_L("CMpxVideoPlayerUtility::GetVideoLoadingProgressL(%d)"), aPercentageProgress );
       
   288 }
       
   289 
       
   290 void CMpxVideoPlayerUtility::Play()
       
   291 {
       
   292     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Play()"));
       
   293 
       
   294     if ( iFirstPlayCmd )
       
   295     {
       
   296         //
       
   297         //  Send Loading Started
       
   298         //
       
   299         TMMFEvent* event = new TMMFEvent();
       
   300         event->iErrorCode = KErrNone;
       
   301         event->iEventType = KMMFEventCategoryVideoLoadingStarted;
       
   302 
       
   303         AddCallbackEvent( event );
       
   304 
       
   305         //
       
   306         //  Send Loading Complete
       
   307         //
       
   308         event = new TMMFEvent();
       
   309         event->iErrorCode = KErrNone;
       
   310         event->iEventType = KMMFEventCategoryVideoLoadingComplete;
       
   311 
       
   312         AddCallbackEvent( event );
       
   313 
       
   314         iFirstPlayCmd = EFalse;
       
   315     }
       
   316 }
       
   317 
       
   318 void CMpxVideoPlayerUtility::PauseL()
       
   319 {
       
   320     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::PauseL()"));
       
   321 }
       
   322 
       
   323 void CMpxVideoPlayerUtility::SetPlayVelocityL( TInt aVelocity )
       
   324 {
       
   325     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetPlayVelocityL()"),
       
   326                    _L("velocity = %d"), aVelocity);
       
   327 }
       
   328 
       
   329 void CMpxVideoPlayerUtility::SetPositionL(const TTimeIntervalMicroSeconds& aPosition)
       
   330 {
       
   331     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SetPositionL()"),
       
   332                    _L("aPosition = %Ld"), aPosition.Int64());
       
   333 
       
   334     iPosition = aPosition;
       
   335 
       
   336     RFile file;
       
   337     _LIT(KFileName, "\\vhpp_playerror.txt");
       
   338 
       
   339     RFs fs;
       
   340     fs.Connect();
       
   341 
       
   342     TInt err = file.Open( fs, KFileName, EFileRead | EFileShareAny );
       
   343 
       
   344     if ( err == KErrNone )
       
   345     {
       
   346         TInt playError;
       
   347         HBufC8* fBuf = HBufC8::NewL( 16 );
       
   348         TPtr8 fileBuf = fBuf->Des();
       
   349 
       
   350         file.Read( fileBuf, 16 );
       
   351 
       
   352         TLex8 number( fileBuf );
       
   353         number.Val( playError );
       
   354 
       
   355         TMMFEvent* event = new TMMFEvent();
       
   356 
       
   357         event->iErrorCode = playError;
       
   358 
       
   359         if ( iPosition >= iDuration )
       
   360         {
       
   361             MPX_DEBUG(_L("    Sending PlaybackComplete()"));
       
   362 
       
   363             //
       
   364             //  Send Playback Complete
       
   365             //
       
   366             event->iEventType = KMMFEventCategoryPlaybackComplete;
       
   367         }
       
   368         else if ( iPosition < 0 )
       
   369         {
       
   370             //
       
   371             //  Send Event
       
   372             //
       
   373             event->iEventType = KMMFEventCategoryVideoPlayerGeneralError;
       
   374         }
       
   375 
       
   376         AddCallbackEvent( event );
       
   377     }
       
   378 
       
   379     file.Close();
       
   380     fs.Close();
       
   381 }
       
   382 
       
   383 TInt CMpxVideoPlayerUtility::Stop()
       
   384 {
       
   385     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::Stop()"));
       
   386 
       
   387     return KErrNone;
       
   388 }
       
   389 
       
   390 void CMpxVideoPlayerUtility::HandleEvent( const TMMFEvent& aEvent )
       
   391 {
       
   392     MPX_ENTER_EXIT(
       
   393         _L("CMpxVideoPlayerUtility::HandleEvent()"),
       
   394         _L("EventType = 0x%08x, ErrorCode = %d"), aEvent.iEventType, aEvent.iErrorCode );
       
   395 
       
   396     //
       
   397     //  Call on the controller to handle the event
       
   398     //
       
   399     iVideoPlaybackController->HandleMMFEvent( aEvent );
       
   400 }
       
   401 
       
   402 void CMpxVideoPlayerUtility::OpenFileL( const RFile& aFile )
       
   403 {
       
   404     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFileL()"));
       
   405 
       
   406     TInt openError = ReadOpenError();
       
   407 
       
   408     if ( ! openError )
       
   409     {
       
   410         ReadFileDetails( aFile );
       
   411     }
       
   412 }
       
   413 
       
   414 void CMpxVideoPlayerUtility::OpenFileL( const TDesC& aFileName )
       
   415 {
       
   416     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFileL()"),
       
   417                    _L("aFileName = %S"), &aFileName);
       
   418 }
       
   419 
       
   420 void CMpxVideoPlayerUtility::OpenUrlL( const TDesC& aUrl, TInt aApId )
       
   421 {
       
   422     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenUrlL()"),
       
   423                    _L("aUrl = %S, ApId = %d"), &aUrl, aApId);
       
   424 
       
   425     TInt openError = ReadOpenError();
       
   426 }
       
   427 
       
   428 
       
   429 TInt CMpxVideoPlayerUtility::ReadOpenError()
       
   430 {
       
   431     //
       
   432     //  Read OpenComplete error
       
   433     //
       
   434     RFile file;
       
   435     _LIT(KFileName, "\\vhpp_openerror.txt");
       
   436 
       
   437     RFs fs;
       
   438     fs.Connect();
       
   439 
       
   440     file.Open( fs, KFileName, EFileRead | EFileShareAny );
       
   441 
       
   442     TInt openError;
       
   443     HBufC8* fBuf = HBufC8::NewL( 16 );
       
   444     TPtr8 fileBuf = fBuf->Des();
       
   445 
       
   446     file.Read( fileBuf, 16 );
       
   447 
       
   448     TLex8 number( fileBuf );
       
   449     number.Val( openError );
       
   450 
       
   451     TMMFEvent* event = new TMMFEvent();
       
   452 
       
   453     event->iEventType = KMMFEventCategoryVideoOpenComplete;
       
   454     event->iErrorCode = openError;
       
   455 
       
   456     AddCallbackEvent( event );
       
   457 
       
   458     file.Close();
       
   459     fs.Close();
       
   460 
       
   461     return openError;
       
   462 }
       
   463 
       
   464 
       
   465 TInt CMpxVideoPlayerUtility::CustomCommandSync( const TMMFMessageDestinationPckg& /*aDestination*/,
       
   466                                                 TInt /*aFunction*/,
       
   467                                                 const TDesC8& /*aDataTo1*/,
       
   468                                                 const TDesC8& /*aDataTo2*/ )
       
   469 {
       
   470     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::CustomCommandSync()"));
       
   471 
       
   472     return KErrNone;
       
   473 }
       
   474 
       
   475 TInt CMpxVideoPlayerUtility::SendMmfEvent( TAny* aPtr )
       
   476 {
       
   477     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::SendMmfEvent()"));
       
   478 
       
   479     static_cast<CMpxVideoPlayerUtility*>(aPtr)->DoSendMmfEvent();
       
   480 
       
   481     return KErrNone;
       
   482 }
       
   483 
       
   484 void CMpxVideoPlayerUtility::DoSendMmfEvent()
       
   485 {
       
   486     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::DoSendMmfEvent()"));
       
   487 
       
   488     TInt count = iEventArray->Count();
       
   489 
       
   490     if ( count > 0 )
       
   491     {
       
   492         TMMFEvent* event = (*iEventArray)[0];
       
   493 
       
   494         iVideoPlaybackController->HandleMMFEvent( *event );
       
   495 
       
   496         if ( count > 1 )
       
   497         {
       
   498             //
       
   499             //  More events exist, start another callback
       
   500             //
       
   501             iCallback->Start( TCallBack( CMpxVideoPlayerUtility::SendMmfEvent, this ) );
       
   502         }
       
   503 
       
   504         iEventArray->Delete( 0 );
       
   505     }
       
   506 }
       
   507 
       
   508 void CMpxVideoPlayerUtility::AddCallbackEvent( TMMFEvent* event )
       
   509 {
       
   510     iEventArray->AppendL( event );
       
   511 
       
   512     if ( ! iCallback->IsActive() )
       
   513     {
       
   514         iCallback->Start( TCallBack( CMpxVideoPlayerUtility::SendMmfEvent, this ) );
       
   515     }
       
   516 }
       
   517 
       
   518 void CMpxVideoPlayerUtility::AddStifObserver( MStifTestObserver* aStifObserver )
       
   519 {
       
   520     iStifObserver = aStifObserver;
       
   521 }
       
   522 
       
   523 void CMpxVideoPlayerUtility::ReadFileDetails( const RFile& aFile )
       
   524 {
       
   525     MPX_DEBUG(_L("CMpxVideoPlayerUtility::ReadFileDetails()"));
       
   526 
       
   527     HBufC8* fBuf = HBufC8::NewL( 1024 );
       
   528     TPtr8 fileBuf = fBuf->Des();
       
   529 
       
   530     aFile.Read( fileBuf, 1024 );
       
   531 
       
   532     ParseFileDetails( fileBuf );
       
   533 }
       
   534 
       
   535 void CMpxVideoPlayerUtility::ParseFileDetails( TDesC8& aBuffer )
       
   536 {
       
   537     MPX_DEBUG(_L("CMpxVideoPlayerUtility::ParseFileDetails()"));
       
   538 
       
   539     TPtrC8 bufferPtr;
       
   540     bufferPtr.Set( aBuffer );
       
   541 
       
   542     TInt offset;
       
   543 
       
   544     TInt error = KErrNone;
       
   545 
       
   546     do
       
   547     {
       
   548         error = KErrNone;
       
   549         TPtrC8 ptr;
       
   550 
       
   551         offset = bufferPtr.Find(_L8(";"));
       
   552 
       
   553         if ( offset == KErrNotFound )
       
   554         {
       
   555             error = offset;
       
   556         }
       
   557         else
       
   558         {
       
   559             ptr.Set( bufferPtr.Left( offset ) );
       
   560             bufferPtr.Set( bufferPtr.Mid( ++offset ));
       
   561 
       
   562             ParseDetail( ptr );
       
   563         }
       
   564     }
       
   565     while ( ! error );
       
   566 }
       
   567 
       
   568 
       
   569 TInt CMpxVideoPlayerUtility::ParseDetail( TPtrC8& aData )
       
   570 {
       
   571     MPX_DEBUG(_L("CMpxVideoPlayerUtility::ParseDetail()"));
       
   572 
       
   573     TInt error = KErrNone;
       
   574 
       
   575     TPtrC8 item;
       
   576     TPtrC8 value;
       
   577 
       
   578     TInt offset = aData.Find(_L8("="));
       
   579 
       
   580     if ( offset == KErrNotFound )
       
   581     {
       
   582         error = offset;
       
   583     }
       
   584     else
       
   585     {
       
   586         item.Set( aData.Left( offset ) );
       
   587         value.Set( aData.Mid( ++offset ) );
       
   588 
       
   589         FindFileDetail( item, value );
       
   590     }
       
   591 
       
   592     return error;
       
   593 }
       
   594 
       
   595 
       
   596 void CMpxVideoPlayerUtility::FindFileDetail( TPtrC8& aItem, TPtrC8& value )
       
   597 {
       
   598     MPX_DEBUG(_L("CMpxVideoPlayerUtility::FindFileDetail()"));
       
   599 
       
   600     if ( ! aItem.Compare(_L8("VideoFrameSizeWidth")) )
       
   601     {
       
   602         TLex8 lex(value);
       
   603         lex.Val( iSize.iWidth );
       
   604     }
       
   605     else if ( ! aItem.Compare(_L8("VideoFrameSizeHeight")) )
       
   606     {
       
   607         TLex8 lex(value);
       
   608         lex.Val( iSize.iHeight );
       
   609     }
       
   610     else if ( ! aItem.Compare(_L8("VideoBitRate")) )
       
   611     {
       
   612         TLex8 lex(value);
       
   613         lex.Val( iVideoBitRate );
       
   614     }
       
   615     else if ( ! aItem.Compare(_L8("AudioBitRate")) )
       
   616     {
       
   617         TLex8 lex(value);
       
   618         lex.Val( iAudioBitRate );
       
   619     }
       
   620     else if ( ! aItem.Compare(_L8("AudioEnabled")) )
       
   621     {
       
   622         TLex8 lex(value);
       
   623         lex.Val( iAudioEnabled );
       
   624     }
       
   625     else if ( ! aItem.Compare(_L8("Duration")) )
       
   626     {
       
   627         TInt dur = 0;
       
   628         TLex8 lex(value);
       
   629         lex.Val( dur );
       
   630 
       
   631         iDuration = dur;
       
   632     }
       
   633     else if ( ! aItem.Compare(_L8("MimeType")) )
       
   634     {
       
   635         delete iMimeType;
       
   636 
       
   637         iMimeType = value.AllocL();
       
   638     }
       
   639     else if ( ! aItem.Compare(_L8("NumMetaDataEntries")) )
       
   640     {
       
   641         TLex8 lex(value);
       
   642         lex.Val( iNumMetaDataEntries );
       
   643     }
       
   644     else if ( ! aItem.Compare(_L8("Seekable")) )
       
   645     {
       
   646         TLex8 lex(value);
       
   647         lex.Val( iSeekable );
       
   648     }
       
   649     else if ( ! aItem.Compare(_L8("LiveStream")) )
       
   650     {
       
   651         TLex8 lex(value);
       
   652         lex.Val( iLiveStream );
       
   653     }
       
   654     else if ( ! aItem.Compare(_L8("Title")) )
       
   655     {
       
   656         delete iTitle;
       
   657 
       
   658         iTitle = value.AllocL();
       
   659     }
       
   660     else if ( ! aItem.Compare(_L8("Description")) )
       
   661     {
       
   662         delete iDescription;
       
   663 
       
   664         iDescription = value.AllocL();
       
   665     }
       
   666     else if ( ! aItem.Compare(_L8("Artist")) )
       
   667     {
       
   668         delete iArtist;
       
   669 
       
   670         iArtist = value.AllocL();
       
   671     }
       
   672 
       
   673     HBufC* name = HBufC::NewL( aItem.Length() );
       
   674     TPtr namePtr( name->Des() );
       
   675     namePtr.Copy( aItem );
       
   676 
       
   677     HBufC* data = HBufC::NewL( value.Length() );
       
   678     TPtr dataPtr( data->Des() );
       
   679     dataPtr.Copy( value );
       
   680 
       
   681     CMMFMetaDataEntry* pEntry = CMMFMetaDataEntry::NewL( namePtr, dataPtr );
       
   682     iMetaData.Append( pEntry );
       
   683 }
       
   684 
       
   685 void CMpxVideoPlayerUtility::SetVolumeSteps( TInt aVolumeSteps )
       
   686 {
       
   687     MPX_DEBUG(_L("CMpxVideoPlayerUtility::SetVolumeSteps()"));
       
   688 
       
   689     //
       
   690     // variate volume steps to set expected result for STIF
       
   691     // depending on if it's a 10-steps or 20-steps)
       
   692     //
       
   693     iVideoPlaybackController->SetVolumeSteps( aVolumeSteps );
       
   694 }
       
   695 
       
   696 TUint32 CMpxVideoPlayerUtility::FourCCCode() const
       
   697 {
       
   698     MPX_DEBUG(_L("CMpxVideoPlayerUtility::FourCCCode()"));
       
   699 
       
   700     return 0;
       
   701 }
       
   702 
       
   703 #ifdef SYMBIAN_BUILD_GCE
       
   704 
       
   705 TInt CMpxVideoPlayerUtility::VideoSurfaceCreated()
       
   706 {
       
   707     return KErrNone;
       
   708 }
       
   709 
       
   710 TInt CMpxVideoPlayerUtility::SurfaceParametersChanged()
       
   711 {
       
   712     return KErrNone;
       
   713 }
       
   714 
       
   715 TInt CMpxVideoPlayerUtility::RemoveSurface()
       
   716 {
       
   717     return KErrNone;
       
   718 }
       
   719 
       
   720 #endif
       
   721 
       
   722 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   723 
       
   724 void CMpxVideoPlayerUtility::OpenFile64L( const RFile64& aFile )
       
   725 {
       
   726     MPX_ENTER_EXIT(_L("CMpxVideoPlayerUtility::OpenFile64L()"));
       
   727 
       
   728     TInt openError = ReadOpenError();
       
   729 
       
   730     if ( ! openError )
       
   731     {
       
   732         ReadFileDetails( aFile );
       
   733     }
       
   734 }
       
   735 
       
   736 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
       
   737