# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1284701588 -10800 # Node ID 3b098142db8376f35f1e26e1970ec5476c80bed0 # Parent f4fd77a452f2585543fd322d4586c9c7da3189dc Revision: 201035 Kit: 201037 diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/audiofetcher/group/audiofetcher.mmp --- a/mmappcomponents/audiofetcher/group/audiofetcher.mmp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/audiofetcher/group/audiofetcher.mmp Fri Sep 17 08:33:08 2010 +0300 @@ -61,7 +61,7 @@ LIBRARY avkon.lib LIBRARY bafl.lib // For BaflUtils LIBRARY bitgdi.lib -LIBRARY commonengine.lib +LIBRARY CommonEngine.lib LIBRARY euser.lib LIBRARY ecom.lib LIBRARY cone.lib // TParser @@ -72,7 +72,7 @@ LIBRARY eikcoctl.lib LIBRARY eikcore.lib LIBRARY fbscli.lib -LIBRARY WS32.lib // For Rwindow +LIBRARY ws32.lib // For Rwindow LIBRARY mdccommon.lib // mds LIBRARY mdeclient.lib // mds diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/collectionhelper/inc/mpxcollectioncachedhelper.h --- a/mmappcomponents/collectionhelper/inc/mpxcollectioncachedhelper.h Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/collectionhelper/inc/mpxcollectioncachedhelper.h Fri Sep 17 08:33:08 2010 +0300 @@ -572,8 +572,10 @@ /** * Commits the transactions still left in the caching array + * for abstractAlbum, it would be left in cache if aCacheAbstractAlbum is set to ETrue + * @param aCacheAbstractAlbum whether abstractAlbum is to be cached */ - void Commit(); + void Commit(TBool aCacheAbstractAlbum = EFalse); private: diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp --- a/mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/collectionhelper/src/mpxcollectioncachedhelper.cpp Fri Sep 17 08:33:08 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Extended collection helper with an internal caching array -* Version : %version: da1mmcf#27.1.12.3.5 % +* Version : %version: e003sa33#27.1.12.3.7 % * */ @@ -53,6 +53,7 @@ _LIT( K3G2FileExt, ".3g2" ); _LIT( KODFFileExt, ".odf" ); _LIT( KO4AFileExt, ".o4a" ); +_LIT( KAACFileExt, ".aac" ); // ======== MEMBER FUNCTIONS ======== @@ -179,7 +180,7 @@ if( iCache->Count() >= cacheCount) Commit(); - #ifdef ABSTRACTAUDIOALBUM_INCLUDED +#ifdef ABSTRACTAUDIOALBUM_INCLUDED TBool extract = ETrue; if( aMedia->IsSupported( KMPXMediaMTPSampleDataFlag ) ) { @@ -389,22 +390,29 @@ // Take advantage that MTP always try to access the most recent item // CMPXMedia* media( NULL ); + TBool anotherAbstractMediaFound = EFalse; for( TInt i=count-1; i>=0; --i ) { const TDesC& uri = iCache->AtL(i)->ValueText( KMPXMediaGeneralUri ); + TMPXGeneralCategory category = iCache->AtL(i)->ValueTObjectL(KMPXMediaGeneralCategory); + MPX_DEBUG3("CMPXCollectionCachedHelper::SetL iCache[i].category = %d, uri = %S", category, &uri); if( newUri.CompareF( uri ) == 0 ) { MPX_DEBUG2("Found existing media, index %i", i); media = iCache->AtL(i); break; } + else if ( category == EMPXPlaylist || category == EMPXAbstractAlbum ) + anotherAbstractMediaFound = ETrue; } // Not found in the array if( !media ) { // If the catched count is more than KCacheCount, commit it to database. - if( count >= KCacheCount ) + // could be song or alb coming, not in the cache, and there is at least one .alb on the cache + // commit all if another AbstractMedia is found (anotherAbstractMediaFound is on ETrue if not the current one) + if( ( count >= KCacheCount ) || anotherAbstractMediaFound ) { Commit(); } @@ -808,7 +816,8 @@ delete iFoundMedia; iFoundMedia = NULL; - Commit(); + MPX_DEBUG1("CMPXCollectionCachedHelper::GetL, not found on the cache"); + Commit( ETrue ); // leave AbstractAlbum in cache RArray attributes; CleanupClosePushL(attributes); @@ -853,8 +862,15 @@ CMPXMedia* CMPXCollectionCachedHelper::FindAllL( CMPXMedia& aCriteria, const TArray& aAttrs ) { - Commit(); + TBool cacheAbstractAlbum = EFalse; + TMPXGeneralCategory category = aCriteria.ValueTObjectL( KMPXMediaGeneralCategory ); + // leave AbstractAlbum in cache, unless the new criteria is another abstract media + if ( ( category != EMPXPlaylist ) && ( category != EMPXAbstractAlbum ) ) + cacheAbstractAlbum = ETrue; + + Commit( cacheAbstractAlbum ); + return CMPXCollectionHelperImp::FindAllL( aCriteria, aAttrs ); } @@ -877,32 +893,39 @@ // Commits all transactions left in the helper // --------------------------------------------------------------------------- // -void CMPXCollectionCachedHelper::Commit() +void CMPXCollectionCachedHelper::Commit( TBool aCacheAbstractAlbum ) { MPX_DEBUG2("CMPXCollectionCachedHelper::Commit %d <--", iCache->Count()); TInt error( KErrNotFound ); TInt count( iCache->Count() ); + TInt currentIndex = 0; - for( TInt i=0; iValueTObjectL( KMPXMediaGeneralCategory ); + TBool needCache = EFalse; + + if ( ( category == EMPXAbstractAlbum ) && aCacheAbstractAlbum ) + needCache = ETrue; + if( media ) { - switch( iOp[0] ) + switch( iOp[currentIndex] ) { 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 ); - ); + if ( !needCache ) + { + TRAP( error, SetMissingMetadataL( media ) ); // doing this only before initial add + MPX_DEBUG2( "CMPXCollectionCachedHelper::Commit, SetMissingMetadataL, err = %d", error ); + TRAP( error, CMPXCollectionHelperImp::AddL( media ) ); + } break; } case ESet: { - TRAP(error, + TRAP( error, CMPXCollectionHelperImp::SetL( media ); ); break; @@ -932,10 +955,19 @@ DoAppendContainerL( *media, *iFoundMedia ); DoAppendMTPL( *media, *iFoundMedia ); ); - } - - iCache->Remove(0); - iOp.Remove(0); + } + + if ( needCache ) + { + const TDesC& uri = media->ValueText(KMPXMediaGeneralUri); + MPX_DEBUG2("need cache uri %S", &uri); + currentIndex++; + } + else + { + iCache->Remove( currentIndex ); + iOp.Remove( currentIndex ); + } } MPX_DEBUG1("CMPXCollectionCachedHelper::Commit -->"); @@ -1214,6 +1246,7 @@ // 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(KAACFileExt) == 0 ) || ( parse.Ext().CompareF(KODFFileExt) == 0 ) || ( parse.Ext().CompareF(KO4AFileExt) == 0 ) ) { diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/harvester/filehandler/inc/mpxfolderscanner.h --- a/mmappcomponents/harvester/filehandler/inc/mpxfolderscanner.h Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/harvester/filehandler/inc/mpxfolderscanner.h Fri Sep 17 08:33:08 2010 +0300 @@ -99,6 +99,11 @@ */ void DoScanCompleteL( TInt aErr ); + /** + * Execute asynchronous reading RDir + */ + void ReadDirEntry(); + private: /** @@ -118,6 +123,88 @@ private: // data + /** + * An entry delegates a scanning folder + */ + class CDirQueueEntry : public CBase + { + public: + + /** + * Push a scanning folder into a directory queue + * @param aDirQueue directory queue + * @param aDirEntry entry delegates a scanning folder + */ + static void PushL( RPointerArray< CDirQueueEntry >& aDirQueue, + CDirQueueEntry* aDirEntry ); + + /** + * Pop and destroy a scanning folder from a directory queue + * @param aDirQueue directory queue + */ + static void PopAndDestroy( RPointerArray< CDirQueueEntry >& aDirQueue ); + + /** + * Two-phased constructor + * @param aFullPath full path of this folder + */ + static CDirQueueEntry* NewL( const TDesC& aFullPath ); + + /** + * Virtual destructor + */ + virtual ~CDirQueueEntry(); + + /** + * Get next entry of this folder + * @return next entry of this folder, + * NULL if no next entry + */ + const TEntry* NextEntry(); + + /** + * Reset the position of the EntryArray + */ + void ResetPosition(); + + private: + + /** + * Private constructor + */ + CDirQueueEntry(); + + /** + * 2nd phase constructor + * @param full path of this folder + */ + void ConstructL( const TDesC& aFullPath ); + + public: //data + + /** + * Full path of this folder + * Owned + */ + HBufC* iFullPath; + + /** + * Current position of EntryArray + */ + TInt iPos; + + /** + * RDir object of this folder + * Owned + */ + RDir iDir; + + /** + * EntryArray of this folder + */ + TEntryArray iEntryArray; + }; + MMPXFileAdditionObserver& iObserver; MMPXFileScanStateObserver& iStateObserver; @@ -130,9 +217,9 @@ TBool iScanning; // Scanner objects - CDirScan* iDirScan; - CDir* iDir; - TInt iCount; + RPointerArray< CDirQueueEntry > iDirQueue; // Owned + CDirQueueEntry* iCurDirQueueEntry; // Not Owned + HBufC* iCurFullPath; // Not Owned }; #endif // CMPXFOLDERSCANNER_H diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/harvester/filehandler/src/mpxfolderscanner.cpp --- a/mmappcomponents/harvester/filehandler/src/mpxfolderscanner.cpp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/harvester/filehandler/src/mpxfolderscanner.cpp Fri Sep 17 08:33:08 2010 +0300 @@ -24,6 +24,7 @@ // CONSTANTS const TInt KFileNumBreakCount = 5; +_LIT( KTxtBackSlash, "\\" ); // ======== LOCAL FUNCTIONS ======== @@ -60,7 +61,7 @@ // void CMPXFolderScanner::ConstructL() { - iDirScan = CDirScan::NewL(iFs); + } // --------------------------------------------------------------------------- @@ -88,10 +89,7 @@ CMPXFolderScanner::~CMPXFolderScanner() { Cancel(); - - delete iDirScan; - delete iDir; - + iDirQueue.ResetAndDestroy(); iDrivesToScan.Close(); } @@ -106,6 +104,7 @@ // Copy all the other drives we want to scan // TInt count( aDrives.Count() ); + MPX_DEBUG2("CMPXFolderScanner::ScanL aDrives %d",count); for( TInt i=0; iiFullPath; + ReadDirEntry(); + // We've started scanning iScanning = ETrue; } @@ -143,6 +141,17 @@ } // --------------------------------------------------------------------------- +// Reads dir entries asynchronously +// --------------------------------------------------------------------------- +// +void CMPXFolderScanner::ReadDirEntry() + { + ASSERT( !IsActive() ); + iCurDirQueueEntry->iDir.Read( iCurDirQueueEntry->iEntryArray, iStatus ); + SetActive(); + } + +// --------------------------------------------------------------------------- // Continue Scanning for more files // --------------------------------------------------------------------------- // @@ -150,68 +159,83 @@ { MPX_DEBUG1("CMPXFolderScanner::DoScanL <---"); TBool done (EFalse); - - // Check each file in each directory - TInt numFiles( iDir->Count() ); - while( iCount < numFiles ) + TBool blocked ( EFalse ); + + // read successfully + if ( iStatus == KErrNone || iStatus == KErrEof ) { - TEntry entry = (*iDir)[iCount]; + TBuf buffer; + const TEntry* entry = NULL; + TInt numEntries( iCurDirQueueEntry->iEntryArray.Count() ); + + // process the entry one by one + while ( iCurDirQueueEntry->iPos < numEntries ) + { + entry = iCurDirQueueEntry->NextEntry(); + buffer.Zero(); + + // Generates the full name of the entry + buffer.Append( *iCurFullPath ); + buffer.Append( entry->iName ); + + if ( entry->IsDir() ) // entry is a directory + { + buffer.Append( KTxtBackSlash ); + + blocked = iObserver.IsPathBlockedL( buffer ); - // Construct the full path and file name - TParse fullEntry; - TPtrC dirPath(iDirScan->FullPath()); - fullEntry.Set(entry.iName, &dirPath, NULL); - - TPtrC fullname = fullEntry.FullName(); - TInt index = iObserver.IsMediaFileL( fullname ); - if( KErrNotFound != index ) - { - iObserver.HandleFileAdditionL( fullname, index ); - } - - // Break if we have scanned enough files - // - ++iCount; - if( iCount%KFileNumBreakCount == 0 ) - { - return EFalse; + if ( !blocked ) + { + CDirQueueEntry* newEntry = CDirQueueEntry::NewL( buffer ); + TInt err = newEntry->iDir.Open( iFs, + buffer, + KEntryAttNormal | KEntryAttDir ); + if ( err == KErrNone ) + { + CDirQueueEntry::PushL( iDirQueue, newEntry ); + } + else + { + delete newEntry; + } + } + } + else // entry is a file + { + TInt index = iObserver.IsMediaFileL( buffer ); + if( KErrNotFound != index ) + { + iObserver.HandleFileAdditionL( buffer, index ); + } + } + if ( iCurDirQueueEntry->iPos % KFileNumBreakCount == 0 ) + { + return done; + } } } - - // All files from this directory scanned, so move onto next - // - TInt err( KErrNone ); - TBool blocked (EFalse); - if( iCount == numFiles ) + + // this dir has other entries to read + if ( iStatus == KErrNone ) { - // Get next Folder - // - iCount = 0; - delete iDir; - iDir = NULL; - do + iCurDirQueueEntry->ResetPosition(); + ReadDirEntry(); + } + + // there is nothing to read or some error has occured during reading, + // try to move to next dir + else + { + CDirQueueEntry::PopAndDestroy( iDirQueue ); + if ( iDirQueue.Count() || !SetupNextDriveToScanL() ) { - TRAP(err, iDirScan->NextL(iDir)); - blocked = iObserver.IsPathBlockedL( iDirScan->FullPath() ); - if( blocked ) - { - delete iDir; - iDir = NULL; - } - if( err == KErrNotReady ) - { - delete iDir; - iDir = NULL; - break; - } + iCurDirQueueEntry = iDirQueue[ 0 ]; + iCurFullPath = iCurDirQueueEntry->iFullPath; + ReadDirEntry(); } - while ( err == KErrPathNotFound || blocked ); - - // No more directories to scan on this drive - // - if( !iDir ) + else // there is nothing to scan { - done = SetupNextDriveToScanL(); + done = ETrue; } } @@ -230,46 +254,44 @@ TBool done(EFalse); TBool blocked(EFalse); // Scan next drive - while( iDir == NULL && !done ) + while( iDrivesToScan.Count() && !iDirQueue.Count() ) { - if( !iDrivesToScan.Count() ) + TPath path = iDrivesToScan[0]; + + MPX_DEBUG1( "CMPXFolderScanner::SetupNextDriveToScanL path blocked?" ); + blocked = iObserver.IsPathBlockedL( path ); + MPX_DEBUG2( "CMPXFolderScanner::SetupNextDriveToScanL path blocked %i", + blocked ); + + // If there was something to scan + if( !blocked ) { - // No more drives or folders that we are interested in - done = ETrue; - } - else - { - iDirScan->SetScanDataL(iDrivesToScan[0], KEntryAttNormal, ESortNone); - iCount = 0; - TInt err(KErrNone); - do + CDirQueueEntry* newEntry = CDirQueueEntry::NewL( path ); + TInt err = newEntry->iDir.Open( iFs, + path, + KEntryAttNormal | KEntryAttDir ); + if ( err == KErrNone ) { - MPX_DEBUG1("CMPXFolderScanner::SetupNextDriveToScanL iDirScan->NextL()"); - TRAP(err, iDirScan->NextL(iDir)); - MPX_DEBUG2("CMPXFolderScanner::SetupNextDriveToScanL path %S", &iDirScan->FullPath()); - blocked = iObserver.IsPathBlockedL( iDirScan->FullPath() ); - MPX_DEBUG2("CMPXFolderScanner::SetupNextDriveToScanL path blocked %i", blocked); - if( blocked ) - { - delete iDir; - iDir = NULL; - } - } - while (err == KErrPathNotFound || blocked ); - - // If there was something to scan - // - if( iDir != NULL ) - { + CDirQueueEntry::PushL( iDirQueue, newEntry ); // Inform Observer of the new drive that we are scanning - iObserver.HandleOpenDriveL( ::ExtractDrive(iDrivesToScan[0]), + iObserver.HandleOpenDriveL( ::ExtractDrive(iDrivesToScan[0]), iDrivesToScan[0] ); } - - // Remove the 0th element - iDrivesToScan.Remove(0); - iDrivesToScan.Compress(); + else + { + delete newEntry; + } } + + // Remove the 0th element + iDrivesToScan.Remove(0); + iDrivesToScan.Compress(); + + } + + if ( !iDirQueue.Count() ) + { + done = ETrue; } @@ -287,13 +309,11 @@ // Reset all arrays and data iDrivesToScan.Reset(); - + iDirQueue.ResetAndDestroy(); + // All done! iScanning = EFalse; - - delete iDir; - iDir = NULL; - + // Callback to observer iStateObserver.HandleScanStateCompleteL( MMPXFileScanStateObserver::EScanFiles, aErr ); @@ -319,7 +339,7 @@ { DoScanCompleteL( err ); } - else // if( !done ) + else if ( iCurDirQueueEntry->iPos ) // if( !done ) { MPX_DEBUG1("CMPXFolderScanner::RunL -- Run again"); iStatus = KRequestPending; @@ -353,4 +373,92 @@ TRAP_IGNORE( DoScanCompleteL( aError ) ); return KErrNone; - } + } + +// --------------------------------------------------------------------------- +// Two Phased Constructor +// --------------------------------------------------------------------------- +// +CMPXFolderScanner::CDirQueueEntry* CMPXFolderScanner::CDirQueueEntry::NewL( + const TDesC& aFullPath ) + { + CDirQueueEntry* self = new ( ELeave ) CDirQueueEntry; + CleanupStack::PushL( self ); + self->ConstructL( aFullPath ); + CleanupStack::Pop( self ); + return self; + } + +// --------------------------------------------------------------------------- +// Destructor +// --------------------------------------------------------------------------- +// +CMPXFolderScanner::CDirQueueEntry::~CDirQueueEntry() + { + iDir.Close(); + delete iFullPath; + } + +// --------------------------------------------------------------------------- +// Push a dir entry into a dir entry queue +// --------------------------------------------------------------------------- +// +void CMPXFolderScanner::CDirQueueEntry::PushL( + RPointerArray& aDirQueue, + CDirQueueEntry* aDirEntry ) + { + aDirQueue.AppendL( aDirEntry ); + } + +// --------------------------------------------------------------------------- +// Pop and destroy a dir entry from a dir entry queue +// --------------------------------------------------------------------------- +// +void CMPXFolderScanner::CDirQueueEntry::PopAndDestroy( + RPointerArray< CDirQueueEntry >& aDirQueue ) + { + CDirQueueEntry* entry = aDirQueue[ 0 ]; + delete entry; + aDirQueue.Remove( 0 ); + } + +// --------------------------------------------------------------------------- +// CMPXFolderScanner::CDirQueueEntry::NextEntry +// --------------------------------------------------------------------------- +// +const TEntry* CMPXFolderScanner::CDirQueueEntry::NextEntry() + { + const TEntry* entry = NULL; + if ( iPos >= 0 && iPos < iEntryArray.Count() ) + { + entry = &iEntryArray[ iPos++ ]; + } + return entry; + } + +// --------------------------------------------------------------------------- +// Reset the current position of entry array +// --------------------------------------------------------------------------- +// +void CMPXFolderScanner::CDirQueueEntry::ResetPosition() + { + iPos = 0; + } + +// --------------------------------------------------------------------------- +// Constructor +// --------------------------------------------------------------------------- +// +CMPXFolderScanner::CDirQueueEntry::CDirQueueEntry() + { + // Do nothing + } + +// --------------------------------------------------------------------------- +// 2nd Phase Contructor +// --------------------------------------------------------------------------- +// +void CMPXFolderScanner::CDirQueueEntry::ConstructL( const TDesC& aFullPath ) + { + iFullPath = aFullPath.AllocL(); + } diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/harvester/metadataextractor/group/mpxmetadataextractor.mmp --- a/mmappcomponents/harvester/metadataextractor/group/mpxmetadataextractor.mmp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/harvester/metadataextractor/group/mpxmetadataextractor.mmp Fri Sep 17 08:33:08 2010 +0300 @@ -53,7 +53,7 @@ LIBRARY mmfstandardcustomcommands.lib LIBRARY mpxcommon.lib -LIBRARY SysUtil.lib +LIBRARY sysutil.lib LIBRARY thumbnailmanager.lib #if defined(ARMCC) diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp --- a/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/harvester/metadataextractor/src/mpxmetadataextractor.cpp Fri Sep 17 08:33:08 2010 +0300 @@ -12,7 +12,7 @@ * Contributors: * * Description: Extracts metadata from a file -* Version : %version: da1mmcf#38.1.4.2.6.1.5.3.8 % << Don't touch! Updated by Synergy at check-out. +* Version : %version: da1mmcf#38.1.4.2.6.1.5.3.9 % << Don't touch! Updated by Synergy at check-out. * */ @@ -460,12 +460,12 @@ const TDesC& mimeType = iMedia->ValueText( KMPXMediaGeneralMimeType ); MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL, mimeType = %S", &mimeType); - // Verify if WMA, get the duration + // Verify if WMA, get the bit rate if( mimeType.Compare(KWmaMimeType) == 0 || mimeType.Compare(KWmaCafMimeType) == 0 ) { MPX_DEBUG1("CMPXMetadataExtractor::SetMediaPropertiesL- WMA"); - // Perform the duration conversion + // Perform the bit rate conversion TLex lexer( *value ); TInt32 bitRate ( 0 ); lexer.Val( bitRate ); @@ -473,7 +473,7 @@ iMedia->SetTObjectValueL( KMPXMediaAudioBitrate, bitRate ); - MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- duration = %i", bitRate); + MPX_DEBUG2("CMPXMetadataExtractor::SetMediaPropertiesL- bit rate = %i", bitRate); } break; } @@ -549,13 +549,17 @@ MPX_DEBUG2("CMPXMetadataExtractor::SetExtMediaPropertiesL, file info util error %i", err2); if( KErrNone == err2 ) { + // Get duration prior getting sample and bit rates + // MMF blocks for accumulating audio data to calculate duration + // but MMF does not block for calculating sample rate or bit rate + TInt64 duration = (TInt64) iFileInfoUtil->Duration().Int64() / 1000; // ms + iMedia->SetTObjectValueL( KMPXMediaGeneralDuration, + duration ); + iMedia->SetTObjectValueL( KMPXMediaAudioBitrate, iFileInfoUtil->BitRate() ); iMedia->SetTObjectValueL( KMPXMediaAudioSamplerate, iFileInfoUtil->SampleRate() ); - TInt64 duration = (TInt64) iFileInfoUtil->Duration().Int64() / 1000; // ms - iMedia->SetTObjectValueL( KMPXMediaGeneralDuration, - duration ); MPX_DEBUG2("CMPXMetadataExtractor::SetExtMediaPropertiesL -- duration %i", duration); } diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp --- a/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/mmmtpdprequestprocessor/group/mmmtpdprequestprocessor.mmp Fri Sep 17 08:33:08 2010 +0300 @@ -76,10 +76,10 @@ LIBRARY mtpdatatypes.lib LIBRARY mtpdataproviderapi.lib -LIBRARY platformenv.lib +LIBRARY PlatformEnv.lib LIBRARY edbms.lib -LIBRARY contentlistingframework.lib +LIBRARY ContentListingFramework.lib LIBRARY caf.lib #if defined(__WINDOWS_MEDIA) diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp --- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp Fri Sep 17 08:33:08 2010 +0300 @@ -40,7 +40,7 @@ #include "mmmtpvideodbdefs.h" #include "tobjectdescription.h" -const TInt KStorageRootMaxLength = 10; +_LIT( KMTPNoBackupFolder, "nobackup\\" ); #ifdef _DEBUG static const TInt KMtpMaxStringDescLength = KMtpMaxStringLength - 1; @@ -109,12 +109,17 @@ { PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::OpenDatabase" ) ); - iRfs.CreatePrivatePath( iStoreNum ); - TInt err = iRfs.SetSessionToPrivate( iStoreNum ); + TFileName dbFileName; + TDriveUnit dbDrive( iStoreNum ); + iRfs.PrivatePath( dbFileName ); + dbFileName.Insert( 0, dbDrive.Name() ); + dbFileName.Append( KMTPNoBackupFolder ); + dbFileName.Append( KMtpVideoDb ); + TInt err = iRfs.MkDirAll( dbFileName ); - if ( err == KErrNone ) + if ( err == KErrNone || err == KErrAlreadyExists ) { - TRAP( err, iFileStore = CPermanentFileStore::OpenL( iRfs, KMtpVideoDb, EFileRead | EFileWrite ) ); + TRAP( err, iFileStore = CPermanentFileStore::OpenL( iRfs, dbFileName, EFileRead | EFileWrite ) ); if ( err == KErrNone ) TRAP( err, iFileStore->SetTypeL( iFileStore->Layout() ) ); @@ -127,8 +132,8 @@ if ( err != KErrNone ) { - iRfs.Delete( KMtpVideoDb ); // delete first before creating a new one - TRAP( err, iFileStore = CPermanentFileStore::CreateL( iRfs, KMtpVideoDb, EFileRead | EFileWrite ) ); + iRfs.Delete( dbFileName ); // delete first before creating a new one + TRAP( err, iFileStore = CPermanentFileStore::CreateL( iRfs, dbFileName, EFileRead | EFileWrite ) ); PRINT1( _L( "MM MTP <> OpenDatabase RDbNamedDatabase::CreateL, err = %d" ), err ); if ( err == KErrNone ) @@ -149,7 +154,7 @@ if ( KErrNone != err ) { iDatabase.Close(); - iRfs.Delete( KMtpVideoDb ); + iRfs.Delete( dbFileName ); } } } @@ -160,13 +165,7 @@ iDbOpened = ETrue; } - TBuf storeRoot; - if( PathInfo::GetRootPath( storeRoot, iStoreNum ) == KErrNone ) - { - iRfs.SetSessionPath( storeRoot ); - } - - PRINT( _L( "MM MTP <= CMmMtpDpMetadataVideoAccess::OpenDatabase" ) ); + PRINT1( _L( "MM MTP <= CMmMtpDpMetadataVideoAccess::OpenDatabase err = %d" ), err ); return err; } diff -r f4fd77a452f2 -r 3b098142db83 mmappcomponents/playlistengine/group/mpxplaylistengine.mmp --- a/mmappcomponents/playlistengine/group/mpxplaylistengine.mmp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappcomponents/playlistengine/group/mpxplaylistengine.mmp Fri Sep 17 08:33:08 2010 +0300 @@ -47,7 +47,7 @@ LIBRARY estor.lib LIBRARY bafl.lib LIBRARY apmime.lib -LIBRARY SysLangUtil.lib +LIBRARY syslangutil.lib LIBRARY charconv.lib LIBRARY mpxcommon.lib diff -r f4fd77a452f2 -r 3b098142db83 mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testviewplugin.cpp --- a/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testviewplugin.cpp Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappfw_plat/mpx_common_api/tsrc/ui_commontestclass/src/testviewplugin.cpp Fri Sep 17 08:33:08 2010 +0300 @@ -25,26 +25,27 @@ // ----------------------------------------------------------------------------- TInt CCommonTestClass::CreateCMPXViewPlugin() { - FTRACE(FPrint(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL begin"))); - iLog->Log(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL begin")); - TInt err = KErrNone; - if ( iViewPlugin != NULL) - { - delete iViewPlugin; - } - iViewPlugin = NULL; - - TUid aUid = TUid::Uid(270531770); - - TRAP(err,iViewPlugin = CMPXViewPlugin::NewL( aUid, this )); - if ( iViewPlugin == NULL) - { - err = KErrNotFound; - } - - FTRACE(FPrint(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL end err=%d"), err)); - iLog->Log(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL end err=%d"), err); - return err; +// FTRACE(FPrint(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL begin"))); +// iLog->Log(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL begin")); +// TInt err = KErrNone; +// if ( iViewPlugin != NULL) +// { +// delete iViewPlugin; +// } +// iViewPlugin = NULL; +// +// TUid aUid = TUid::Uid(270531770); +// +// TRAP(err,iViewPlugin = CMPXViewPlugin::NewL( aUid, this )); +// if ( iViewPlugin == NULL) +// { +// err = KErrNotFound; +// } +// +// FTRACE(FPrint(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL end err=%d"), err)); +// iLog->Log(_L("CCommonTestClass::CreateCMPXViewPlugin testing CMPXViewPlugin::NewL end err=%d"), err); +// return err; + return KErrNone; } // ----------------------------------------------------------------------------- @@ -53,18 +54,19 @@ // ----------------------------------------------------------------------------- TInt CCommonTestClass::DeleteCMPXViewPlugin() { - FTRACE(FPrint(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ begin"))); - iLog->Log(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ begin")); - TInt err = KErrNone; - if ( iViewPlugin ) - { - delete iViewPlugin; - REComSession::FinalClose(); - iViewPlugin = NULL; - } - FTRACE(FPrint(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ end err=%d"), err)); - iLog->Log(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ end err=%d"), err); - return err; +// FTRACE(FPrint(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ begin"))); +// iLog->Log(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ begin")); +// TInt err = KErrNone; +// if ( iViewPlugin ) +// { +// delete iViewPlugin; +// REComSession::FinalClose(); +// iViewPlugin = NULL; +// } +// FTRACE(FPrint(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ end err=%d"), err)); +// iLog->Log(_L("CCommonTestClass::DeleteCMPXViewPlugin testing CMPXViewPlugin::~ end err=%d"), err); +// return err; + return KErrNone; } diff -r f4fd77a452f2 -r 3b098142db83 mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsstream.h --- a/mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsstream.h Thu Sep 02 20:56:29 2010 +0300 +++ b/mmappfw_plat/qt_telephony_multimedia_service_api/inc/qtmsstream.h Fri Sep 17 08:33:08 2010 +0300 @@ -89,29 +89,32 @@ * * QTMSFactory *iFactory; * QTMSCall *iCall; - * QTMSStream *iUplink; - * QTMSStream *iDownlink; + * QTMSStream *iUplinkStream; + * QTMSStream *iDownlinkStream; * gint err; * * err = QTMSFactory::CreateFactory(iFactory); * err = iFactory->CreateCall(QTMS_CALL_IP, iCall); - * err = iCall->CreateStream(QTMS_STREAM_UPLINK, iUplink); - * err = iCall->CreateStream(QTMS_STREAM_DOWNLINK, iDownlink); + * err = iCall->CreateStream(QTMS_STREAM_UPLINK, iUplinkStream); + * err = iCall->CreateStream(QTMS_STREAM_DOWNLINK, iDownlinkStream); * // Configure CS uplink stream - * iUplinkStream->AddObserver(*this); + * connect(iUplinkStream, + * SIGNAL(TMSStreamEvent(const QTMSStream&, QTMSSignalEvent)), + * this, + * SLOT(TMSStreamEvent(const QTMSStream&, QTMSSignalEvent))); * iUplinkStream->AddSource(iMicSource); * iUplinkStream->AddSink(iModemSink); * iUplinkStream->AddEffect(iGainEffect); // To control mic gain * iUplinkStream->Init(); - * // Wait for state change callback + * // Wait for TMSStreamEvent signal * iUplinkStream->Play(); - * // Wait for state change callback + * //Wait for TMSStreamEvent signal * ... * // call terminated on the cell modem side, now signal multimedia system * iUplinkStream->Stop(); * ... - * err = iCall->DeleteStream(iDownlink); - * err = iCall->DeleteStream(iUplink); + * err = iCall->DeleteStream(iDownlinkStream); + * err = iCall->DeleteStream(iUplinkStream); * err = iFactory->DeleteCall(iCall); * delete iFactory; * diff -r f4fd77a452f2 -r 3b098142db83 mpx/commonframework/common/group/mpxcommon.mmp --- a/mpx/commonframework/common/group/mpxcommon.mmp Thu Sep 02 20:56:29 2010 +0300 +++ b/mpx/commonframework/common/group/mpxcommon.mmp Fri Sep 17 08:33:08 2010 +0300 @@ -79,8 +79,8 @@ //CAMESE_IN_DRM_UTILITY LIBRARY drmuihandling.lib LIBRARY drmautomatedusage.lib -LIBRARY drmcommon.lib -LIBRARY drmrights.lib +LIBRARY DRMCommon.lib +LIBRARY DrmRights.lib LIBRARY caf.lib LIBRARY cafutils.lib LIBRARY ws32.lib diff -r f4fd77a452f2 -r 3b098142db83 mpx/playbackframework/playbackengine/group/mpxplaybackengine.mmp --- a/mpx/playbackframework/playbackengine/group/mpxplaybackengine.mmp Thu Sep 02 20:56:29 2010 +0300 +++ b/mpx/playbackframework/playbackengine/group/mpxplaybackengine.mmp Fri Sep 17 08:33:08 2010 +0300 @@ -48,8 +48,8 @@ LIBRARY mpxcollectionutility.lib mpxcommon.lib LIBRARY centralrepository.lib #ifdef __ACCESSORY_FW -LIBRARY accClient.lib // Accessory client -LIBRARY telephonyaudiorouting.lib +LIBRARY accclient.lib // Accessory client +LIBRARY TelephonyAudioRouting.lib #else LIBRARY dsclient.lib // Dos services #endif // __ACCESSORY_FW diff -r f4fd77a452f2 -r 3b098142db83 mpx/playbackframework/playbackserver/src/mpxplaybackserversession.cpp --- a/mpx/playbackframework/playbackserver/src/mpxplaybackserversession.cpp Thu Sep 02 20:56:29 2010 +0300 +++ b/mpx/playbackframework/playbackserver/src/mpxplaybackserversession.cpp Fri Sep 17 08:33:08 2010 +0300 @@ -173,10 +173,15 @@ } case EPbsGetAsyncBuffer: { + //In case of other application leaving, causing us to leave + //we could have a task that does not get removed from the top of the queue + //but the data for that task has been deleted. + //When the task runs again, there will be no data causing a panic - leave if this occurs + User::LeaveIfNull(iAsyncBuffer); aMessage.WriteL(0,iAsyncBuffer->Ptr(0)); delete iAsyncBuffer; - iAsyncBuffer = NULL; - break; + iAsyncBuffer = NULL; + break; } case EPbsInitFromCollection: { diff -r f4fd77a452f2 -r 3b098142db83 package_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_definition.xml Fri Sep 17 08:33:08 2010 +0300 @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r f4fd77a452f2 -r 3b098142db83 package_map.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package_map.xml Fri Sep 17 08:33:08 2010 +0300 @@ -0,0 +1,1 @@ + diff -r f4fd77a452f2 -r 3b098142db83 tsrc/group/bld.inf --- a/tsrc/group/bld.inf Thu Sep 02 20:56:29 2010 +0300 +++ b/tsrc/group/bld.inf Fri Sep 17 08:33:08 2010 +0300 @@ -30,7 +30,7 @@ #include "../../mmappfw_plat/collection_helper_api/tsrc/group/bld.inf" #include "../../mmappfw_plat/harvester_utility_api/tsrc/group/bld.inf" #include "../../mmappfw_plat/media_player_settings_engine_api/tsrc/group/bld.inf" -#include "../../mmappfw_plat/mpx_base_view_plugins_api/tsrc/group/bld.inf" +//#include "../../mmappfw_plat/mpx_base_view_plugins_api/tsrc/group/bld.inf" #include "../../mmappfw_plat/mpx_collection_utility_api/tsrc/group/bld.inf" #include "../../mmappfw_plat/mpx_common_api/tsrc/group/bld.inf" #include "../../mmappfw_plat/mpx_playback_utility_api/tsrc/group/bld.inf"