# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1284491850 -10800 # Node ID 666f9a5a90a92c8963ac9b82e566499792548d0f # Parent 63223d4fd95617847dba945d094387f94144dbf1 Revision: 201033 Kit: 201035 diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/collectionhelper/group/mpxcollectionhelper.mmp --- a/mmappcomponents/collectionhelper/group/mpxcollectionhelper.mmp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/collectionhelper/group/mpxcollectionhelper.mmp Tue Sep 14 22:17:30 2010 +0300 @@ -56,9 +56,11 @@ LIBRARY usbman.lib LIBRARY apgrfx.lib LIBRARY mpxmetadataextractor.lib + +LIBRARY metadatautility.lib + #ifdef RD_MPX_TNM_INTEGRATION LIBRARY thumbnailmanager.lib - #endif //RD_MPX_TNM_INTEGRATION #if defined(ARMCC) diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/collectionhelper/inc/mpxcollectioncachedhelper.h --- a/mmappcomponents/collectionhelper/inc/mpxcollectioncachedhelper.h Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/collectionhelper/inc/mpxcollectioncachedhelper.h Tue Sep 14 22:17:30 2010 +0300 @@ -618,6 +618,12 @@ * @param aDestination destination media to copt attributes to */ void DoAppendMTPL( CMPXMedia& aSrc, CMPXMedia& aDestination ); + + /** + * Attempt to set missing Metadata info in specific case + * @param aMedia media object to be checked and adding the info if needed + */ + void SetMissingMetadataL(CMPXMedia* aMedia); #ifdef RD_MPX_COLLECTION_CACHE diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp --- a/mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp Tue Sep 14 22:17:30 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Extended collection helper with an internal caching array -* Version : %version: e003sa33#27.1.12.1.3 % +* Version : %version: da1mmcf#27.1.12.1.4 % * */ @@ -43,9 +43,17 @@ #include "mpxcollectionhelpercommon.h" #include +#include // for SetMissingMetadataL +#include // for SetMissingMetadataL + // CONSTANTS const TInt KCacheCount = 10; +_LIT( K3GPFileExt, ".3gp" ); +_LIT( K3G2FileExt, ".3g2" ); +_LIT( KODFFileExt, ".odf" ); +_LIT( KO4AFileExt, ".o4a" ); + // ======== MEMBER FUNCTIONS ======== // --------------------------------------------------------------------------- @@ -884,6 +892,9 @@ { case EAdd: { + TRAP( error, SetMissingMetadataL( media ) ); // doing this only before initial add + MPX_DEBUG2( "CMPXCollectionCachedHelper::Commit, SetMissingMetadataL, err = %d", error ); + TRAP(error, CMPXCollectionHelperImp::AddL( media ); ); @@ -1188,5 +1199,113 @@ aDestination.SetTObjectValueL( KMPXMediaMTPDrmStatus, val ); } } + +// --------------------------------------------------------------------------- +// Attempt to set missing Metadata info in specific case +// --------------------------------------------------------------------------- +// +void CMPXCollectionCachedHelper::SetMissingMetadataL(CMPXMedia* aMedia) + { + MPX_FUNC("CMPXCollectionCachedHelper::SetMissingMetadataL"); + + const TDesC& path = aMedia->ValueText(KMPXMediaGeneralUri); + TParsePtrC parse( path ); + + // only do this for file that might not be natively supported by PC + if ( ( parse.Ext().CompareF(K3GPFileExt) == 0 ) + || ( parse.Ext().CompareF(K3G2FileExt) == 0 ) + || ( parse.Ext().CompareF(KODFFileExt) == 0 ) + || ( parse.Ext().CompareF(KO4AFileExt) == 0 ) ) + { + TBool isTitleMissing = EFalse; + TBool isArtistMissing = EFalse; + TBool isAlbumMissing = EFalse; + + if ( aMedia->ValueText( KMPXMediaGeneralTitle ).Length() == 0 ) + isTitleMissing = ETrue; + + if ( aMedia->ValueText( KMPXMediaMusicArtist ).Length() == 0 ) + isArtistMissing = ETrue; + + if ( aMedia->ValueText( KMPXMediaMusicAlbum ).Length() == 0 ) + isAlbumMissing = ETrue; + + MPX_DEBUG4("CMPXCollectionCachedHelper::SetMissingMetadataL, isTitleMissing = %d, isArtistMissing = %d, isAlbumMissing = %d", isTitleMissing, isArtistMissing, isAlbumMissing); + + // only do this if one of the following is missing: + // - Title + // - Artist + // - Album + // but can easily be extended to support any category field like: composer, genre + if ( isTitleMissing || isArtistMissing || isAlbumMissing ) + { + // metadataextractor should be used instead, but not until CreateMediaL can be called without add/TN of the embedded art + // CR is needed to add parameter (TBool aAlbumArtNeeded = ETrue) // ETrue by default, for all existing caller + // for now use MDU instead + CMetaDataUtility* metadataUtility = CMetaDataUtility::NewL(); + + CleanupStack::PushL( metadataUtility ); + metadataUtility->OpenFileL( path ); + + MPX_DEBUG1( "CMPXCollectionCachedHelper::SetMissingMetadataL, CMetaDataUtility::OpenFileL succeed" ); + + const CMetaDataFieldContainer& metaCont = metadataUtility->MetaDataFieldsL(); + + for ( TInt i = 0; i < metaCont.Count(); i++ ) + { + TMetaDataFieldId fieldType; + TMPXAttributeData attribute; + + metaCont.FieldIdAt( i, fieldType ); // get the field type + + switch ( fieldType ) + { + case EMetaDataSongTitle: // fall through + case EMetaDataArtist: // fall through + case EMetaDataAlbum: + { + if ( ( isTitleMissing && ( fieldType == EMetaDataSongTitle ) ) + || ( isArtistMissing && ( fieldType == EMetaDataArtist ) ) + || ( isAlbumMissing && ( fieldType == EMetaDataAlbum ) ) ) + { + HBufC* value = metaCont.At( i, fieldType ).AllocL(); + CleanupStack::PushL( value ); + + TPtr valptr = value->Des(); + valptr.Trim(); + + // replace '\t' as ' ' + for ( TInt i = 0; i < value->Length(); i++ ) + { + if ( valptr[i] == TText( '\t' ) ) + valptr[i] = TText( ' ' ); + } + + if ( fieldType == EMetaDataSongTitle ) + attribute = KMPXMediaGeneralTitle; + else if ( fieldType == EMetaDataArtist ) + attribute = KMPXMediaMusicArtist; + else + attribute = KMPXMediaMusicAlbum; + + MPX_DEBUG3( "fieldType = %d, value = %S", fieldType, &valptr ); + aMedia->SetTextValueL( attribute , *value ); + CleanupStack::PopAndDestroy( value ); + } + } + + break; + + default: + + break; + } + } + + metadataUtility->ResetL(); + CleanupStack::PopAndDestroy( metadataUtility ); + } + } + } // END OF FILE diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/harvester/filehandler/inc/mpxdbcommon.h --- a/mmappcomponents/harvester/filehandler/inc/mpxdbcommon.h Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/harvester/filehandler/inc/mpxdbcommon.h Tue Sep 14 22:17:30 2010 +0300 @@ -24,11 +24,11 @@ // Please update the increment number for each increment // Please update the version number for each schema change #ifdef ABSTRACTAUDIOALBUM_INCLUDED -_LIT( KHarvesterDBName, "harvesterdbv10_1.dat" ); -_LIT( KHarvesterDBNameEMMC, "harvesterdbv10_1i.dat" ); +_LIT( KHarvesterDBName, "harvesterdbv10_2.dat" ); +_LIT( KHarvesterDBNameEMMC, "harvesterdbv10_2i.dat" ); #else -_LIT( KHarvesterDBName, "harvesterdbv10_1n.dat" ); -_LIT( KHarvesterDBNameEMMC, "harvesterdbv10_1in.dat" ); +_LIT( KHarvesterDBName, "harvesterdbv10_2n.dat" ); +_LIT( KHarvesterDBNameEMMC, "harvesterdbv10_2in.dat" ); #endif _LIT( KHarvesterDBPattern, "harvesterdbv*.dat" ); diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp --- a/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Tue Sep 14 22:17:30 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Extracts metadata from a file -* Version : %version: da1mmcf#38.1.4.2.6.1.15 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: da1mmcf#38.1.4.2.6.1.17 % << Don't touch! Updated by Synergy at check-out. * */ @@ -254,6 +254,10 @@ // URL aMediaProp.SetTextValueL( KMPXMediaMusicURL, KNullDesC ); + // AlbumArtist + aMediaProp.SetTextValueL( KMPXMediaMusicAlbumArtist, + KNullDesC ); + } // --------------------------------------------------------------------------- @@ -476,6 +480,18 @@ } break; } + case EMetaDataAlbumArtist: + { + TPtr valptr = value->Des(); + valptr.Trim(); + TInt vallen = value->Length(); + if (vallen>0) + { + FindAndReplaceForbiddenChars(valptr, vallen); + iMedia->SetTextValueL(KMPXMediaMusicAlbumArtist, *value); + } + break; + } case EMetaDataOriginalArtist: // fall through case EMetaDataVendor: // fall through case EMetaDataRating: // fall through @@ -926,7 +942,20 @@ { TDataType dataType; TUid dummyUid(KNullUid); - iAppArc.AppForDocument(iFileName, dummyUid, dataType); + // File handle based mime type recogniton required , because AppArc does + // not have All Files capa required for files in private folders + TDataRecognitionResult result; + RFs fs; + RFile rFile; + User::LeaveIfError(fs.Connect()); + CleanupClosePushL(fs); + User::LeaveIfError(fs.ShareProtected()); + User::LeaveIfError(rFile.Open(fs, iFileName, EFileShareReadersOrWriters)); + CleanupClosePushL(rFile); + User::LeaveIfError(iAppArc.RecognizeData(rFile, result)); + CleanupStack::PopAndDestroy(&rFile); + CleanupStack::PopAndDestroy(&fs); + dataType = result.iDataType; iMedia->SetTextValueL( KMPXMediaGeneralMimeType,dataType.Des() ); } diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectproplist.cpp Tue Sep 14 22:17:30 2010 +0300 @@ -124,7 +124,7 @@ PRINT2( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData sampleFile.Size size=%d, err=%d" ), size, err ); if( err == KErrNone && size > 0 ) { - HBufC8* sampleData = HBufC8::NewLC( size * sizeof( TUint8 ) ); // + sampleData + HBufC8* sampleData = HBufC8::NewLC( size ); // + sampleData TPtr8 samplePtr = sampleData->Des(); err = sampleFile.Read( samplePtr ); PRINT1( _L( "MM MTP <> EMTPObjectPropCodeRepresentativeSampleData sampleFile.Read err=%d" ), err ); diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdpplugins/abstractmediamtpdataprovider/src/cabstractmediamtpdataprovidergetobjectpropvalue.cpp Tue Sep 14 22:17:30 2010 +0300 @@ -126,7 +126,7 @@ if( size > 0 ) { - HBufC8* sampleData = HBufC8::NewLC( size * sizeof(TUint8) ); // + sampleData + HBufC8* sampleData = HBufC8::NewLC( size ); // + sampleData TPtr8 samplePtr = sampleData->Des(); User::LeaveIfError( sampleFile.Read( samplePtr ) ); iMTPTypeArray->SetByDesL( samplePtr ); diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp --- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatampxaccess.cpp Tue Sep 14 22:17:30 2010 +0300 @@ -902,7 +902,7 @@ delete iSampleData; iSampleData = NULL; - iSampleData = HBufC8::NewL( numElements * sizeof( TUint8 ) ); + iSampleData = HBufC8::NewL( numElements ); TPtr8 samplePtr = iSampleData->Des(); mtpTypeArray.ToDes( samplePtr ); RFile sampleFile; diff -r 63223d4fd956 -r 666f9a5a90a9 mmappcomponents/playbackhelper/src/streaminglinkmodel.cpp --- a/mmappcomponents/playbackhelper/src/streaminglinkmodel.cpp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappcomponents/playbackhelper/src/streaminglinkmodel.cpp Tue Sep 14 22:17:30 2010 +0300 @@ -15,7 +15,7 @@ * */ -// Version : %version: 4 % +// Version : %version: 5 % @@ -559,6 +559,8 @@ TInt size = 0; TInt result = KErrNone; + + TBool linkadded = EFalse; if ( aRamFile.Size( size ) == KErrNone && size <= KMaxLinkFileSize ) { @@ -576,6 +578,8 @@ // Get links from buffer while ( ret == KErrNone ) { + linkadded = EFalse; + // Create a linkitem ptr LinkStruct* linkItem = new( ELeave ) LinkStruct; CleanupStack::PushL( linkItem ); @@ -593,14 +597,23 @@ { ptr2.TrimRight(); iLinkArray.Append( linkItem ); + linkadded = ETrue; } } else { iLinkArray.Append( linkItem ); + linkadded = ETrue; } - CleanupStack::Pop(2); // pop the linkItem and the HbufC created for linkItem->link + if ( linkadded ) + { + CleanupStack::Pop(2); // pop the linkItem and the HbufC created for linkItem->link + } + else + { + CleanupStack::PopAndDestroy(2); //pop and destroy linkItem and the HbufC created for linkItem->link + } } CleanupStack::PopAndDestroy(2); // buffer, recognizer @@ -636,6 +649,8 @@ iLinkCount = 0; TInt ret = KErrNone; + + TBool linkadded = EFalse; if ( aAsxParser ) { @@ -650,6 +665,9 @@ for (TInt i=1; i <= urlCount; i++) { + + linkadded = EFalse; + // Get the asx struct from the parser asxItem = aAsxParser->GetUrl(i); // Set the url to the bufferptr @@ -677,15 +695,23 @@ { ptr2.TrimRight(); iLinkArray.Append( linkItem ); + linkadded = ETrue; } } else { iLinkArray.Append( linkItem ); + linkadded = ETrue; } - - CleanupStack::Pop(2); // pop the linkItem and the HbufC created for linkItem->link - + + if ( linkadded ) + { + CleanupStack::Pop(2); // pop the linkItem and the HbufC created for linkItem->link + } + else + { + CleanupStack::PopAndDestroy(2); //pop and destroy linkItem and the HbufC created for linkItem->link + } } CleanupStack::PopAndDestroy(); //recognizer diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/conf/mpxplaybackutilitytest.cfg --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/conf/mpxplaybackutilitytest.cfg Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/conf/mpxplaybackutilitytest.cfg Tue Sep 14 22:17:30 2010 +0300 @@ -26,6 +26,12 @@ // Timers KTimerEndTest 5000 // 5 sec +// Properties for SetL +EPbPropertyVolume 0 +EPbPropertyPosition 10 + + + [Enddefine] @@ -251,3 +257,526 @@ delete pbutil [Endtest] +[Test] +// +// Test Video play +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play +// +title 14 MMPXPlaybackUtilityVideoCommandPlayL(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video play, then stop +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Stop +// +title 15 MMPXPlaybackUtilityVideoCommandPlayClose(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandStopL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video play, then pause +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Pause +// +title 16 MMPXPlaybackUtilityVideoCommandPlayandPause(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPauseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video play, then playpause +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, PlayPause +// +title 17 MMPXPlaybackUtilityVideoCommandPlayPause(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayPauseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video play, then playpause twice +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, PlayPause, PlayPause +// +title 18 MMPXPlaybackUtilityVideoCommandPlayPausePlay(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayPauseL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayPauseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video playcomplete +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Play Complete +// +title 19 MMPXPlaybackUtilityVideoCommandPlayComplete(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayCompleteL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video seeking forward +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Seek Forward +// +title 20 MMPXPlaybackUtilityVideoCommandSeekForwardPlayState(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandSeekForwardL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video seeking backward +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Seek Backward +// +title 21 MMPXPlaybackUtilityVideoCommandSeekBackwardPlayState(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandSeekBackwardL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video seeking forward while paused +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Pause, Seek Forward +// +title 22 MMPXPlaybackUtilityVideoCommandSeekForwardPauseState(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPauseL +pause 1000 +pbutil MMPXPlaybackUtilityCommandSeekForwardL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video seeking backward while paused +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Pause, Seek Backward +// +title 23 MMPXPlaybackUtilityVideoCommandSeekBackwardPauseState(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPauseL +pause 1000 +pbutil MMPXPlaybackUtilityCommandSeekBackwardL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video play with RFile64 +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - Init64L with RFile64, File MPEG4_VBR_176x144_15fps.3gp +// - File64L to get RFile64 file handler +// +title 24 MMPXPlaybackUtilityVideoFile64PlayL +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInit64L MPEG4_VBR_176x144_15fps.3gp +pause 1000 +pbutil MMPXPlaybackUtilityFile64L +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video close after stop +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Stop, close +// +title 25 MMPXPlaybackUtilityVideoCommandPlayStopClose(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandStopL +pause 1000 +pbutil MMPXPlaybackUtilityCommandCloseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video close +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Close +// +title 26 MMPXPlaybackUtilityVideoCommandPlayClose(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandCloseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video set position (jump while playing) +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Set Position +// +title 27 MMPXPlaybackUtilityVideoSetPosition(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilitySetL EPbPropertyPosition 100 +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + + +[Test] +// +// Test Video set volume +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Set Volume +// +title 28 MMPXPlaybackUtilityVideoSetVolume(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilitySetL EPbPropertyVolume 15 +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video play command while already playing +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play +// +title 29 MMPXPlaybackUtilityVideoCommandPlayPlayL(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video playpause command in stopped state +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Stop, PlayPause +// +title 30 MMPXPlaybackUtilityVideoCommandStopPlayPause(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandStopL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayPauseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video pause command while already paused +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Pause, Pause +// +title 31 MMPXPlaybackUtilityVideoCommandPausePauseL(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPauseL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPauseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video pause command in stopped state +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Stop, Pause +// +title 32 MMPXPlaybackUtilityVideoCommandStopPause(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandStopL +pause 1000 +pbutil MMPXPlaybackUtilityCommandPauseL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video stop command in stopped state +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Play, Stop, Stop +// +title 33 MMPXPlaybackUtilityVideoCommandStopStop(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandPlayL +pause 1000 +pbutil MMPXPlaybackUtilityCommandStopL +pause 1000 +pbutil MMPXPlaybackUtilityCommandStopL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] + +[Test] +// +// Test Video stop command while in buffering state +// - UtilityL with Mode NewPlayer, Category Video +// - Add Observer +// - SelectPlayerL with HelixPlugin UID +// - InitL with URI, File Battle_160x100_30kbps.rm +// - Init, Stop +// +title 34 MMPXPlaybackUtilityVideoCommandInitStop(uri) +create mpxplaybackutilitytest pbutil +pbutil MMPXPlaybackUtilityUtilityWithCatL KMPXCategoryVideo KPbModeNewPlayer +pbutil MMPXPlaybackUtilityAddObserverL +pbutil MMPXPlaybackUtilityPlayerManagerSelectPlayerL KVideoHelixPlaybackPluginUid +pbutil MMPXPlaybackUtilityInitWithUriL Battle_160x100_30kbps.rm +pause 1000 +pbutil MMPXPlaybackUtilityCommandStopL +pause KTimerEndTest +pbutil EndTest +delete pbutil +[Endtest] \ No newline at end of file diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/group/bld.inf --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/group/bld.inf Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/group/bld.inf Tue Sep 14 22:17:30 2010 +0300 @@ -28,5 +28,6 @@ PRJ_TESTMMPFILES #include "../mpxplaybackutilitytest/group/bld.inf" +#include "../testvideoplaybackplugin/group/bld.inf" // End of File diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/bld.inf --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/bld.inf Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/bld.inf Tue Sep 14 22:17:30 2010 +0300 @@ -25,6 +25,9 @@ PRJ_TESTEXPORTS // NOTE: If using ARS requirements all export operations should be done under this. // 'abld test export' +../../conf/mpxplaybackutilitytest.cfg /epoc32/winscw/c/testframework/mpxplaybackutilitytest.cfg +../../init/Testframework.ini /epoc32/winscw/c/testframework/testframework.ini + PRJ_EXPORTS // Specify the source file followed by its destination here diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.mmp --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.mmp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.mmp Tue Sep 14 22:17:30 2010 +0300 @@ -38,6 +38,8 @@ USERINCLUDE ../inc +USERINCLUDE ../../inc + SOURCEPATH ../src @@ -54,7 +56,9 @@ LIBRARY stiftestengine.lib LIBRARY mpxplaybackutility.lib LIBRARY mpxcommon.lib -LIBRARY mpxcollectionutility.lib +LIBRARY mpxcollectionutility.lib +LIBRARY bafl.lib + LANG SC diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.pkg --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.pkg Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/group/mpxplaybackutilitytest.pkg Tue Sep 14 22:17:30 2010 +0300 @@ -34,14 +34,8 @@ ; Install files "\epoc32\release\armv5\udeb\mpxplaybackutilitytest.dll" - "!:\Sys\Bin\mpxplaybackutilitytest.dll" +"\epoc32\release\armv5\udeb\testvideoplaybackplugin.dll" - "!:\Sys\Bin\testvideoplaybackplugin.dll" +"\epoc32\data\z\resource\plugins\testvideoplaybackplugin.rsc" - "!:\resource\plugins\testvideoplaybackplugin.rsc" + "..\..\init\TestFramework.ini" - "c:\testframework\TestFramework.ini" "..\..\conf\mpxplaybackutilitytest.cfg" - "c:\testframework\mpxplaybackutilitytest.cfg" - -"..\..\data\mmc\Battle_160x100_30kbps.rm" - "f:\testing\data\Battle_160x100_30kbps.rm" -"..\..\data\mmc\20k_H263_WB_176x144_15fps.3gp" - "f:\testing\data\20k_H263_WB_176x144_15fps.3gp" -"..\..\data\mmc\30k_MPEG4_AAC_8Khz_176x144_15fps_30secs.mp4" - "f:\testing\data\30k_MPEG4_AAC_8Khz_176x144_15fps_30secs.mp4" -"..\..\data\mmc\80k_H264_AAC16M22_176x144_15fps.3gp" - "f:\testing\data\80k_H264_AAC16M22_176x144_15fps.3gp" -"..\..\data\mmc\DivX_MP3_256x112_30fps_300Kbps.avi" - "f:\testing\data\DivX_MP3_256x112_30fps_300Kbps.avi" -"..\..\data\mmc\honey_im_home_horror_ad.avi" - "f:\testing\data\honey_im_home_horror_ad.avi" -"..\..\data\mmc\MPEG4_VBR_176x144_15fps.3gp" - "f:\testing\data\MPEG4_VBR_176x144_15fps.3gp" -"..\..\data\mmc\XVID_176x144_15fps_261Kbps.avi" - "f:\testing\data\XVID_176x144_15fps_261Kbps.avi" diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytest.h --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytest.h Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytest.h Tue Sep 14 22:17:30 2010 +0300 @@ -40,14 +40,14 @@ _LIT( KmpxplaybackutilitytestLogFile, "mpxplaybackutilitytest.txt" ); _LIT( KmpxplaybackutilitytestLogFileWithTitle, "mpxplaybackutilitytest_[%S].txt" ); // data file -_LIT( KmpxplaybackutilityTestFilePath, "C:\\testing\\data\\" ); +_LIT( KmpxplaybackutilityTestFilePath, "C:\\" ); #else -_LIT( KmpxplaybackutilitytestLogPath, "f:\\logs\\testframework\\mpxplaybackutilitytest\\" ); +_LIT( KmpxplaybackutilitytestLogPath, "c:\\logs\\testframework\\mpxplaybackutilitytest\\" ); // Log file _LIT( KmpxplaybackutilitytestLogFile, "mpxplaybackutilitytest.txt" ); _LIT( KmpxplaybackutilitytestLogFileWithTitle, "mpxplaybackutilitytest_[%S].txt" ); // data file -_LIT( KmpxplaybackutilityTestFilePath, "f:\\testing\\data\\" ); +_LIT( KmpxplaybackutilityTestFilePath, "c:\\" ); #endif // FUNCTION PROTOTYPES @@ -204,6 +204,17 @@ TInt MMPXPlaybackUtilityAddObserverL(CStifItemParser& /*aItem*/); TInt MMPXPlaybackUtilityRemoveObserverL(CStifItemParser& /*aItem*/); TInt MMPXPlaybackUtilityPlayerManagerSelectPlayerL(CStifItemParser& /*aItem*/); + + TInt MMPXPlaybackUtilityCommandPlayL ( CStifItemParser & /*aItem*/ ); + TInt MMPXPlaybackUtilityCommandStopL ( CStifItemParser & /*aItem*/ ); + TInt MMPXPlaybackUtilityCommandPauseL ( CStifItemParser & /*aItem*/); + TInt MMPXPlaybackUtilityCommandPlayPauseL ( CStifItemParser & /*Item*/); + TInt MMPXPlaybackUtilityCommandPlayCompleteL ( CStifItemParser & /*Item*/); + TInt MMPXPlaybackUtilityCommandSeekForwardL ( CStifItemParser & /*Item*/); + TInt MMPXPlaybackUtilityCommandSeekBackwardL ( CStifItemParser & /*Item*/); + TInt MMPXPlaybackUtilityCommandCloseL ( CStifItemParser & /*Item*/); + TInt MMPXPlaybackUtilitySetL(CStifItemParser& /*aItem*/ ); + TInt EndTest(CStifItemParser& /*aItem*/); /** @@ -219,6 +230,8 @@ RFs iFs; TInt iCallbackError; RFile iFile; + TFileName iFileName; + #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API RFile64 iFile64; #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytestdefs.h --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytestdefs.h Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/inc/mpxplaybackutilitytestdefs.h Tue Sep 14 22:17:30 2010 +0300 @@ -21,8 +21,26 @@ const TInt KGeneralPlaybackMsgOffset = 0; const TInt KVideoPlaybackMsgOffset = 100; const TInt KStifPlaybackMsgOffset = 200; + + + + const TInt KMPXMessageStif = 0x20011397; +// +// TInt for Command Id +// +const TMPXAttributeData KMPXStifPlaybackCommand = { KMPXMessageStif, 0x01 }; + + +enum TMPXStifCommand +{ + EPbStifPlayComplete, + EPbStifSeekForward, + EPbStifSeekBackward + +}; + #endif // MPXPLAYBACKUTILITYTESTDEFS_H diff -r 63223d4fd956 -r 666f9a5a90a9 mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/src/mpxplaybackutilitytestBlocks.cpp --- a/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/src/mpxplaybackutilitytestBlocks.cpp Wed Sep 01 12:23:05 2010 +0100 +++ b/mmappfw_plat/mpx_playback_utility_api/tsrc/mpxplaybackutilitytest/src/mpxplaybackutilitytestBlocks.cpp Tue Sep 14 22:17:30 2010 +0300 @@ -18,6 +18,10 @@ // [INCLUDE FILES] - do not remove +#include +#include +#include + #include #include #include @@ -32,6 +36,9 @@ #include #include "mpxplaybackutilitytest.h" #include "mpxplaybackutilitytestdefs.h" +#include "testcommonpluginuids.h" + +const TUid KPbTestVideoPlugin = {KPlaybackTestVideoPluginImpId}; // ============================ MEMBER FUNCTIONS =============================== // --------------------------------------------------------------------------- @@ -40,52 +47,54 @@ // --------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::HandlePlaybackMessage( CMPXMessage* aMessage, TInt aError )"); + iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackMessage: Error %d"), aError); + if ( !aError ) { - iLog->Log(_L("Cmpxharvestertest::HandlePlaybackMessage: Error %d"), aError); - if ( !aError ) - { TMPXMessageId id( *(aMessage->Value(KMPXMessageGeneralId)) ); TInt event( *aMessage->Value( KMPXMessageGeneralEvent ) ); TInt type( *aMessage->Value( KMPXMessageGeneralType ) ); TInt data( *aMessage->Value( KMPXMessageGeneralData ) ); if ( KMPXMessageGeneral == id ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackMessage() General event = %d type = %d value = %d"), event, type, data ); RemoveExpectedEventL( KGeneralPlaybackMsgOffset + event, type, data ); - } + } else if ( KMPXMediaIdVideoPlayback == id ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackMessage() Video event = %d type = %d value = %d"), event, type, data ); RemoveExpectedEventL( KVideoPlaybackMsgOffset + event, type, data ); - } + } else if ( KMPXMessageStif ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackMessage() STIF event = %d type = %d value = %d"), event, type, data ); RemoveExpectedEventL( KStifPlaybackMsgOffset + event, type, data ); - } - } - else - { - if ( !iCallbackError ) - { - iCallbackError = aError; - } } } + else + { + if ( !iCallbackError ) + { + iCallbackError = aError; + } + } +} // --------------------------------------------------------------------------- // Handle playback property. // --------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError ) - { - iLog->Log(_L("Cmpxharvestertest::HandlePropertyL: Property %d, Value %d, Error %d"), +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::HandlePropertyL( TMPXPlaybackProperty aProperty, TInt aValue, TInt aError )"); + iLog->Log(_L("Cmpxplaybackutilitytest::HandlePropertyL: Property %d, Value %d, Error %d"), aProperty, aValue, aError); - } +} // --------------------------------------------------------------------------- // Method is called continously until aComplete=ETrue, signifying that @@ -97,18 +106,20 @@ const MDesCArray* aSubPlayers, TBool aComplete, TInt aError ) - { - iLog->Log(_L("Cmpxharvestertest::HandleSubPlayerNamesL: Complete %d, Error %d"), aComplete, aError); - } +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::HandleSubPlayerNamesL( TUid aPlayer, const MDesCArray* aSubPlayers, TBool aComplete, TInt aError)"); + iLog->Log(_L("Cmpxplaybackutilitytest::HandleSubPlayerNamesL: Complete %d, Error %d"), aComplete, aError); +} // --------------------------------------------------------------------------- // Call back of media request. // --------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::HandleMediaL( const CMPXMedia& aProperties, TInt aError ) - { - iLog->Log(_L("Cmpxharvestertest::HandleMediaL: Error %d"), aError); - } +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::HandleMediaL( const CMPXMedia& aProperties, TInt aError )"); + iLog->Log(_L("Cmpxplaybackutilitytest::HandleMediaL: Error %d"), aError); +} // --------------------------------------------------------------------------- // Handle completion of a asynchronous command. @@ -116,9 +127,10 @@ // --------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::HandlePlaybackCommandComplete( CMPXCommand* aCommandResult, TInt aError ) - { - iLog->Log(_L("Cmpxharvestertest::HandlePlaybackCommandComplete: Error %d"), aError); - } +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::HandlePlaybackCommandComplete( CMPXCommand* aCommandResult, TInt aError )"); + iLog->Log(_L("Cmpxplaybackutilitytest::HandlePlaybackCommandComplete: Error %d"), aError); +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::Delete @@ -127,15 +139,26 @@ // ----------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::Delete() - { - iMPXPlaybackUtility->Close(); +{ + TInt delerr = KErrNone; + + iMPXPlaybackUtility->Close(); #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API iFile64.Close(); #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API iFile.Close(); + + if ( BaflUtils::FileExists( iFs, iFileName ) ) + { + User::After( 1000000 * 10 ); + delerr = BaflUtils::DeleteFile(iFs,iFileName); + iLog->Log(_L("deleting tempfile delerr=%d"),delerr); + } iFs.Close(); iExpectedEventArray->ResetAndDestroy(); - } + +} + // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::CreateL @@ -144,21 +167,22 @@ // ----------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::CreateL() - { +{ iFs.Connect(); iFs.ShareProtected(); iExpectedEventArray = new (ELeave) CArrayPtrFlat( 1 ); iCallbackError = KErrNone; iMPXPlaybackUtility = NULL; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::AddExpectedEventL // ----------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::AddExpectedEventL( TInt aEvent, TInt aType, TInt aData ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::AddExpectedEventL( TInt aEvent, TInt aType, TInt aData )"); iLog->Log(_L("Cmpxplaybackutilitytest::AddExpectedEventL() event = %d type = %d value = %d"), aEvent, aType, aData ); @@ -167,24 +191,25 @@ event->iType = aType; event->iData = aData; iExpectedEventArray->AppendL( event ); - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::RemoveExpectedEventL // ----------------------------------------------------------------------------- // void Cmpxplaybackutilitytest::RemoveExpectedEventL( TInt aEvent, TInt aType, TInt aData ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::RemoveExpectedEventL( TInt aEvent, TInt aType, TInt aData )"); iLog->Log(_L("Cmpxplaybackutilitytest::RemoveExpectedEventL() event = %d type = %d value = %d"), aEvent, aType, aData ); if ( (iExpectedEventArray->Count() > 0) && - ((*iExpectedEventArray)[0]->iEvent == aEvent) ) - { + ((*iExpectedEventArray)[0]->iEvent == aEvent) && ((*iExpectedEventArray)[0]->iType == aType)) + { iLog->Log(_L("Cmpxplaybackutilitytest::RemoveExpectedEventL() event = %d removed."), aEvent); iExpectedEventArray->Delete( 0 ); - } } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::RunMethodL @@ -192,9 +217,9 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::RunMethodL( CStifItemParser& aItem ) - { +{ static TStifFunctionInfo const KFunctions[] = - { + { // Copy this line for every implemented function. // First string is the function name used in TestScripter script file. // Second is the actual implementation member function. @@ -216,14 +241,25 @@ ENTRY( "MMPXPlaybackUtilityAddObserverL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL ), ENTRY( "MMPXPlaybackUtilityRemoveObserverL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL ), ENTRY( "MMPXPlaybackUtilityPlayerManagerSelectPlayerL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL ), + + ENTRY( "MMPXPlaybackUtilityCommandPlayL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayL ), + ENTRY( "MMPXPlaybackUtilityCommandStopL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandStopL ), + ENTRY( "MMPXPlaybackUtilityCommandPauseL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPauseL ), + ENTRY( "MMPXPlaybackUtilityCommandPlayPauseL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayPauseL ), + ENTRY( "MMPXPlaybackUtilityCommandPlayCompleteL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayCompleteL ), + ENTRY( "MMPXPlaybackUtilityCommandSeekForwardL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekForwardL ), + ENTRY( "MMPXPlaybackUtilityCommandSeekBackwardL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekBackwardL ), + ENTRY( "MMPXPlaybackUtilityCommandCloseL", Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandCloseL ), + ENTRY( "MMPXPlaybackUtilitySetL", Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL), + ENTRY( "EndTest", Cmpxplaybackutilitytest::EndTest ), - }; + }; const TInt count = sizeof( KFunctions ) / sizeof( TStifFunctionInfo ); return RunInternalL( KFunctions, count, aItem ); - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL @@ -232,28 +268,29 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL( CStifItemParser& aItem ) - { - iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL")); +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL( CStifItemParser& aItem )"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL")); TInt err = KErrNone; TInt mode; if ( aItem.GetNextInt(mode) != KErrNone ) - { + { iLog->Log(_L("MMPXPlaybackUtilityNewL - Missing playback mode.")); err = KErrArgument; return err; - } + } - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewL: mode %d"), mode); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL: mode %d"), mode); TRAP( err,iMPXPlaybackUtility = MMPXPlaybackUtility::NewL(TUid::Uid(mode), this )); if (err!= KErrNone) - { - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewL: error %d"), err); - } + { + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewL: error %d"), err); + } return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL @@ -262,35 +299,36 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL")); TInt err = KErrNone; TInt mode; TInt category; if ( aItem.GetNextInt(category) != KErrNone ) - { + { iLog->Log(_L("MMPXPlaybackUtilityNewWithCatL - Missing category.")); err = KErrArgument; return err; - } + } if ( aItem.GetNextInt(mode) != KErrNone ) - { + { iLog->Log(_L("MMPXPlaybackUtilityNewWithCatL - Missing playback mode.")); err = KErrArgument; return err; - } + } - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewWithCatL: category %d"), category); - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewWithCatL: mode %d"), mode); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL: category %d"), category); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL: mode %d"), mode); TRAP( err,iMPXPlaybackUtility = MMPXPlaybackUtility::NewL((TMPXCategory)category, TUid::Uid(mode), this )); if (err!= KErrNone) - { - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityNewWithCatL: error %d"), err); - } + { + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityNewWithCatL: error %d"), err); + } return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL @@ -299,26 +337,27 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL")); TInt err = KErrNone; TInt mode = 0; aItem.GetNextInt(mode); - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityL: mode %d"), mode); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL: mode %d"), mode); if ( mode ) - { + { TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL(TUid::Uid(mode))); - } + } else - { + { TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL()); - } + } - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityL: error %d"), err); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityL: error %d"), err); return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL @@ -327,35 +366,36 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL")); TInt err = KErrNone; TInt category; TInt mode = 0; if ( aItem.GetNextInt(category) != KErrNone ) - { + { iLog->Log(_L("MMPXPlaybackUtilityNewWithCatL - Missing category.")); err = KErrArgument; return err; - } + } aItem.GetNextInt(mode); - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityWithCatL: category %d"), category); - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityWithCatL: mode %d"), mode); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL: category %d"), category); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL: mode %d"), mode); if ( mode ) - { + { TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL((TMPXCategory)category, TUid::Uid(mode))); - } + } else - { + { TRAP(err,iMPXPlaybackUtility = MMPXPlaybackUtility::UtilityL((TMPXCategory)category)); - } + } - iLog->Log(_L("Cmpxharvestertest::MMPXPlaybackUtilityUtilityWithCatL: error %d"), err); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityUtilityWithCatL: error %d"), err); return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL @@ -364,7 +404,8 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL( CStifItemParser& /*aItem*/ ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL( CStifItemParser& )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL")); TInt err = KErrNone; CMPXCollectionPlaylist* playlist = CMPXCollectionPlaylist::NewL(); @@ -373,7 +414,7 @@ CleanupStack::PopAndDestroy(playlist); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithPlaylistL - error=%d"),err); return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL @@ -382,35 +423,60 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL")); - TInt err = KErrNone; + TInt err = KErrNone; TPtrC string; - + + MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager(); + MMPXPlayer* player = manager.CurrentPlayer(); + if( aItem.GetNextString( string ) == KErrNone ) - { - TBuf<120> uri; + { + //TBuf<120> uri; + TFileName uri; uri.Append(KmpxplaybackutilityTestFilePath); uri.Append(string); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL - uri = %S."), &uri); + iFileName = uri; + + if ( ! BaflUtils::FileExists( iFs, iFileName ) ) + { + err = iFile.Create( iFs, uri, EFileShareAny ); + iLog->Log(_L("creating tempfile error=%d"),err); + iFile.Close(); + } + TRAP(err,iMPXPlaybackUtility->InitL(uri)); if ( !err ) - { + { TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged; AddExpectedEventL(event, 0, 0); + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete; AddExpectedEventL(event, 0, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateInitialised, 0); + + if ( player->UidL() == KPbTestVideoPlugin ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateBuffering, 0); } - iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL - error=%d"),err); } + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithUriL - error=%d"),err); + } else - { + { iLog->Log(_L("MMPXPlaybackUtilityInitWithUriL - Missing file name.")); err = KErrArgument; - } + } + return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL @@ -419,43 +485,68 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL")); TInt err = KErrNone; TPtrC string; + + MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager(); + MMPXPlayer* player = manager.CurrentPlayer(); if( aItem.GetNextString( string ) == KErrNone ) - { + { TBuf<120> KFrom; KFrom.Append(KmpxplaybackutilityTestFilePath); KFrom.Append(string); + iFileName = KFrom; + if ( iFile.SubSessionHandle() ) - { + { iFile.Close(); - } + } + + if ( ! BaflUtils::FileExists( iFs, iFileName ) ) + { + err = iFile.Create( iFs, KFrom, EFileShareAny ); + iLog->Log(_L("creating tempfile error=%d"),err); + iFile.Close(); + } + err = iFile.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters); + if ( err == KErrNone ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL - Open passed.")); TRAP(err,iMPXPlaybackUtility->InitL(iFile)); if ( !err ) - { + { TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged; AddExpectedEventL(event, 0, 0); + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete; AddExpectedEventL(event, 0, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateInitialised, 0); + + if ( player->UidL() == KPbTestVideoPlugin ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateBuffering, 0); } } + } iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitWithRFileL - error=%d"),err); - } + } else - { + { iLog->Log(_L("MMPXPlaybackUtilityInitWithRFileL - Missing file name.")); err = KErrArgument; - } + } return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL @@ -464,36 +555,60 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL")); TInt err = KErrNone; TPtrC string; TInt accessPoint = 1; + MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager(); + MMPXPlayer* player = manager.CurrentPlayer(); + if( aItem.GetNextString( string ) == KErrNone ) - { + { TBuf<120> uri; uri.Append(KmpxplaybackutilityTestFilePath); uri.Append(string); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL - uri = %S."), &uri); + iFileName = uri; + + if ( ! BaflUtils::FileExists( iFs, iFileName ) ) + { + err = iFile.Create( iFs, uri, EFileShareAny ); + iLog->Log(_L("creating tempfile error=%d"),err); + iFile.Close(); + } + TRAP(err,iMPXPlaybackUtility->InitStreamingL(uri, NULL, accessPoint)); if ( !err ) - { + { TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged; AddExpectedEventL(event, 0, 0); + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete; AddExpectedEventL(event, 0, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateInitialised, 0); + + if ( player->UidL() == KPbTestVideoPlugin ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateBuffering, 0); } - iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL - error=%d"),err); + } + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithUriL - error=%d"),err); + } else - { + { iLog->Log(_L("MMPXPlaybackUtilityInitStreamingWithUriL - Missing file name.")); err = KErrArgument; - } + } return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL @@ -502,44 +617,69 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL")); TInt err = KErrNone; TPtrC string; TInt accessPoint = 1; + MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager(); + MMPXPlayer* player = manager.CurrentPlayer(); + if( aItem.GetNextString( string ) == KErrNone ) - { + { TBuf<120> KFrom; KFrom.Append(KmpxplaybackutilityTestFilePath); KFrom.Append(string); + iFileName = KFrom; + if ( iFile.SubSessionHandle() ) - { + { iFile.Close(); - } + } + + if ( ! BaflUtils::FileExists( iFs, iFileName ) ) + { + err = iFile.Create( iFs, KFrom, EFileShareAny ); + iLog->Log(_L("creating tempfile error=%d"),err); + iFile.Close(); + } + err = iFile.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters); if ( err == KErrNone ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL - Open passed.")); TRAP(err,iMPXPlaybackUtility->InitStreamingL(iFile, accessPoint)); if ( !err ) - { + { TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged; AddExpectedEventL(event, 0, 0); + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete; AddExpectedEventL(event, 0, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateInitialised, 0); + + if ( player->UidL() == KPbTestVideoPlugin ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateBuffering, 0); } + } + } iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreamingWithRFileL - error=%d"),err); - } + } else - { + { iLog->Log(_L("MMPXPlaybackUtilityInitStreamingWithRFileL - Missing file name.")); err = KErrArgument; - } + } return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L @@ -548,7 +688,8 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L")); TInt err = KErrNone; #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API @@ -557,39 +698,64 @@ #else // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API TPtrC string; + MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager(); + MMPXPlayer* player = manager.CurrentPlayer(); + if( aItem.GetNextString( string ) == KErrNone ) - { + { TBuf<120> KFrom; KFrom.Append(KmpxplaybackutilityTestFilePath); KFrom.Append(string); + iFileName = KFrom; + if ( iFile64.SubSessionHandle() ) - { + { iFile64.Close(); - } + } + + if ( ! BaflUtils::FileExists( iFs, iFileName ) ) + { + err = iFile64.Create( iFs, KFrom, EFileShareAny ); + iLog->Log(_L("creating tempfile error=%d"),err); + iFile64.Close(); + } + err = iFile64.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters); + if ( err == KErrNone ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L - Open passed.")); TRAP(err,iMPXPlaybackUtility->Init64L(iFile64)); if ( !err ) - { + { TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged; AddExpectedEventL(event, 0, 0); + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete; AddExpectedEventL(event, 0, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateInitialised, 0); + + if ( player->UidL() == KPbTestVideoPlugin ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateBuffering, 0); } + } + } iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInit64L - error=%d"),err); - } + } else - { + { iLog->Log(_L("MMPXPlaybackUtilityInit64L - Missing file name.")); err = KErrArgument; - } + } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L @@ -598,7 +764,8 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L( CStifItemParser& aItem ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L( CStifItemParser& aItem )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L")); TInt err = KErrNone; #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API @@ -608,39 +775,63 @@ TPtrC string; TInt accessPoint = 1; + MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager(); + MMPXPlayer* player = manager.CurrentPlayer(); + if( aItem.GetNextString( string ) == KErrNone ) - { + { TBuf<120> KFrom; KFrom.Append(KmpxplaybackutilityTestFilePath); KFrom.Append(string); + iFileName = KFrom; + if ( iFile64.SubSessionHandle() ) - { + { iFile64.Close(); - } + } + + if ( ! BaflUtils::FileExists( iFs, iFileName ) ) + { + err = iFile64.Create( iFs, KFrom, EFileShareAny ); + iLog->Log(_L("creating tempfile error=%d"),err); + iFile64.Close(); + } + err = iFile64.Open(iFs, KFrom, EFileRead | EFileShareReadersOrWriters); + if ( err == KErrNone ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L - Open passed.")); TRAP(err,iMPXPlaybackUtility->InitStreaming64L(iFile64, accessPoint)); if ( !err ) - { + { TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPlayerChanged; AddExpectedEventL(event, 0, 0); + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EInitializeComplete; AddExpectedEventL(event, 0, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateInitialised, 0); + + if ( player->UidL() == KPbTestVideoPlugin ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateBuffering, 0); } } + } iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityInitStreaming64L - error=%d"),err); - } + } else - { + { iLog->Log(_L("MMPXPlaybackUtilityInitStreaming64L - Missing file name.")); err = KErrArgument; - } + } #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L @@ -649,7 +840,8 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L( CStifItemParser& /*aItem*/ ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L( CStifItemParser& )"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L")); TInt err = KErrNone; #ifndef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API @@ -659,13 +851,13 @@ RFile64* file64Ptr=NULL; TRAP(err, file64Ptr=iMPXPlaybackUtility->Source()->File64L()); if ( !file64Ptr->SubSessionHandle() ) - { + { iLog->Log(_L("MMPXPlaybackUtilityFile64L - file64 = NULL.")); - } + } iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityFile64L - error=%d"),err); #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL @@ -674,13 +866,14 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL( CStifItemParser& /*aItem*/ ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL( CStifItemParser&)"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL")); TInt err = KErrNone; TRAP(err, iMPXPlaybackUtility->AddObserverL(*this)); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityAddObserverL - error=%d"),err); return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL @@ -689,13 +882,14 @@ // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL( CStifItemParser& /*aItem*/ ) - { +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL( CStifItemParser&)"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL")); TInt err = KErrNone; TRAP(err, iMPXPlaybackUtility->RemoveObserverL(*this)); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityRemoveObserverL - error=%d"),err); return err; - } +} // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL @@ -703,51 +897,499 @@ // (other items were commented in a header). // ----------------------------------------------------------------------------- // -TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL(CStifItemParser& aItem) - { +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL( CStifItemParser& aItem ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL(CStifItemParser& aItem)"); iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityPlayerManagerSelectPlayerL")); TInt uidInt; TInt err = KErrNone; // read in UID if ( aItem.GetNextInt(uidInt) != KErrNone ) - { + { iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - Missing UID.")); err = KErrArgument; return err; - } + } iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - UID = 0x%x."), uidInt); if ( iMPXPlaybackUtility ) - { + { MMPXPlayerManager& manager = iMPXPlaybackUtility->PlayerManager(); - TRAP( err, manager.SelectPlayerL( TUid::Uid(uidInt) ) ); + + if (uidInt == 0x10282551) + { + iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL video uid")); + MPX_DEBUG2(("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - uidInt = %d."), uidInt); + TRAP( err, manager.SelectPlayerL( KPbTestVideoPlugin ) ); + } + else + { + iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL NOT video uid")); + MPX_DEBUG1(("MMPXPlaybackUtilityPlayerManagerSelectPlayerL NOT video uid")); + TRAP( err, manager.SelectPlayerL( TUid::Uid(uidInt) ) ); + } iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - SelectPlayer err = %d."), err); - } + } else - { + { iLog->Log(_L("MMPXPlaybackUtilityPlayerManagerSelectPlayerL - MPX Playback Utility not created.")); err = KErrGeneral; + } + return err; +} + + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayL")); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralType, EPbCmdPlay); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, 0); + + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayL err from commandl: , err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandPlayL err from commandl: , err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayL no error from commandl:")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandPlayL no err from commandl:")); + + TMPXPlaybackState s = iMPXPlaybackUtility->StateL(); + + if ( s != EPbStatePlaying ) + { + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePlaying, 0); } + } + + CleanupStack::PopAndDestroy (cmd); + return err; +} + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandStopL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandStopL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandStopL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandStopL")); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralType, EPbCmdStop); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, 0); + + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandStopL err from commandl: , err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandStopL err from commandl: , err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandStopL no error from commandl:")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandStopL no err from commandl:")); + + TMPXPlaybackState s = iMPXPlaybackUtility->StateL(); + + if ( s != EPbStateStopped ) + { + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateStopped, 0); + } + } + + CleanupStack::PopAndDestroy (cmd); + + return err; +} + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPauseL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPauseL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPauseL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPauseL")); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralType, EPbCmdPause); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, 0); + + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandPauseL err from commandl: , err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandPauseL err from commandl: , err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandPauseL no error from commandl:")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandPauseL no err from commandl:")); + + TMPXPlaybackState s = iMPXPlaybackUtility->StateL(); + + if ( s == EPbStatePlaying ) + { + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePaused, 0); + } + + } + + CleanupStack::PopAndDestroy (cmd); + + return err; +} + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayPauseL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayPauseL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayPauseL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayPauseL")); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralType, EPbCmdPlayPause); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, 0); + + TMPXPlaybackState s = iMPXPlaybackUtility->StateL(); + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayPauseL err from commandl: err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandPlayPauseL err from commandl: err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayPauseL no error from commandl")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandPlayPauseL no error from commandl")); + + + + if (s == EPbStatePlaying) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayPauseL EPbStatePlaying:")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandPlayPauseL EPbStatePlaying:")); + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePaused, 0); + } + else + { + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayPauseL State is not playing:")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandPlayPauseL State is not playing:")); + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePlaying, 0); + } + } + + CleanupStack::PopAndDestroy (cmd); + + return err; +} + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayCompleteL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayCompleteL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayCompleteL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandPlayCompleteL")); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXMessageStif); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, 0); + + cmd->SetTObjectValueL( KMPXStifPlaybackCommand, + EPbStifPlayComplete ); + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayCompleteL error from commandl: err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandPlayCompleteL error from commandl: err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandPlayCompleteL no error from commandl")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandPlayCompleteL no error from commandl")); + + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPropertyChanged; + AddExpectedEventL(event, EPbPropertyPosition, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateStopped, 0); + } + + CleanupStack::PopAndDestroy (cmd); + + return err; +} + + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekForwardL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekForwardL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekForwardL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekForwardL")); + + TMPXPlaybackState s = iMPXPlaybackUtility->StateL(); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXMessageStif); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL( KMPXStifPlaybackCommand, + EPbStifSeekForward ); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, s); + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandSeekForwardL error from commandl: err = %d"), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandSeekForwardL error from commandl: err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandSeekForwardL no error from commandl")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandSeekForwardL no error from commandl")); + + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePluginSeeking, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPropertyChanged; + AddExpectedEventL(event, EPbPropertyPosition, 0); + + if ( s == EPbStatePlaying ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePlaying, 0); + } + else if ( s == EPbStatePaused ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePaused, 0); + } + } + CleanupStack::PopAndDestroy (cmd); + + return err; +} + + + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekBackwardL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekBackwardL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekBackwardL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandSeekBackwardL")); + + TMPXPlaybackState s = iMPXPlaybackUtility->StateL(); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXMessageStif); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL( KMPXStifPlaybackCommand, + EPbStifSeekBackward ); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, s); + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandSeekBackwardL error from commandl: err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandSeekBackwardL error from commandl: err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandSeekForwardL no error from commandl")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandSeekForwardL no error from commandl")); + + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePluginSeeking, 0); + + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPropertyChanged; + AddExpectedEventL(event, EPbPropertyPosition, 0); + + if ( s == EPbStatePlaying ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePlaying, 0); + } + else if ( s == EPbStatePaused ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStatePaused, 0); + } + } + + CleanupStack::PopAndDestroy (cmd); + + return err; +} + + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandCloseL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandCloseL( CStifItemParser& /*aItem*/ ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandCloseL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilityCommandCloseL")); + + TMPXPlaybackState s = iMPXPlaybackUtility->StateL(); + + //create command + CMPXCommand* cmd = CMPXCommand::NewL(); + CleanupStack::PushL( cmd ); + + cmd->SetTObjectValueL(KMPXCommandGeneralId, KMPXCommandIdPlaybackGeneral); + cmd->SetTObjectValueL(KMPXCommandGeneralDoSync, ETrue); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralType, EPbCmdClose); + cmd->SetTObjectValueL(KMPXCommandPlaybackGeneralData, 0); + + TRAPD(err,iMPXPlaybackUtility->CommandL( *cmd )); + + iLog->Log(_L("MMPXPlaybackUtilityCommandCloseL err from commandl: err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilityCommandCloseL err from commandl: err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilityCommandCloseL no error from commandl:")); + MPX_DEBUG1(("MMPXPlaybackUtilityCommandCloseL no err from commandl:")); + + TInt event; + + if ( s != EPbStateStopped ) + { + event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EStateChanged; + AddExpectedEventL(event, EPbStateStopped, 0); + } + } + + CleanupStack::PopAndDestroy (cmd); + + return err; +} + + +// ----------------------------------------------------------------------------- +// Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL +// ----------------------------------------------------------------------------- +// +TInt Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL( CStifItemParser& aItem ) +{ + MPX_FUNC_EX("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL(CStifItemParser&)"); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL")); + + TInt err = KErrNone; + TInt property; + TInt value; + + + if( aItem.GetNextInt( property ) != KErrNone ) + { + MPX_DEBUG1(("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL missing property " )); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL missing property " )); + err = KErrArgument; + return err; + } + + if ( aItem.GetNextInt( value ) != KErrNone) + { + MPX_DEBUG1(("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL missing value " )); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL missing value " )); + err = KErrArgument; + return err; + } + + MPX_DEBUG3(("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL property = %d, value = %d"), property, value ); + iLog->Log(_L("Cmpxplaybackutilitytest::MMPXPlaybackUtilitySetL property = %d, value %d") , property, value ); + + TRAP(err, iMPXPlaybackUtility->SetL((TMPXPlaybackProperty)property, value )); + + iLog->Log(_L("MMPXPlaybackUtilitySetL err from SetL: err = %d."), err); + MPX_DEBUG2(("MMPXPlaybackUtilitySetL err from SetL: err = %d."), err); + + if ( !err ) + { + iLog->Log(_L("MMPXPlaybackUtilitySetL no error from SetL")); + MPX_DEBUG1(("MMPXPlaybackUtilitySetL no err from SetL")); + + TInt event = KGeneralPlaybackMsgOffset + TMPXPlaybackMessage::EPropertyChanged; + AddExpectedEventL(event, property, value); + } + + return err; +} + // ----------------------------------------------------------------------------- // Cmpxplaybackutilitytest::EndTest // ----------------------------------------------------------------------------- // TInt Cmpxplaybackutilitytest::EndTest( CStifItemParser& /*aItem*/ ) - { +{ iLog->Log(_L("Cmpxplaybackutilitytest::EndTest")); TInt err = iCallbackError; // check if event queue is empty if ( !err && (iExpectedEventArray->Count() > 0 ) ) - { + { iLog->Log(_L("Cmpxplaybackutilitytest::EndTest error = KErrTimedOut")); err = KErrTimedOut; - } + } + return err; - } +} // end of file