Revision: 201003 PDK_3.0.g
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 02 Feb 2010 00:27:58 +0200
changeset 4 d45095c2f4f3
parent 3 b425f12f328d
child 8 5daa7cafd16d
child 9 bee149131e4b
child 11 5529f24b6aaf
child 20 b1fb57be53fe
Revision: 201003 Kit: 201005
mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp
mpx/collectionframework/collectionengine/inc/mpxcollectionengine.h
mpx/collectionframework/collectionengine/src/mpxcollectionengine.cpp
--- a/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp	Tue Jan 26 12:18:42 2010 +0200
+++ b/mmappcomponents/mmmtpdataprovider/src/cmmmtpdpmetadatavideoaccess.cpp	Tue Feb 02 00:27:58 2010 +0200
@@ -1,19 +1,19 @@
 /*
-* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
-* All rights reserved.
-* This component and the accompanying materials are made available
-* under the terms of "Eclipse Public License v1.0"
-* which accompanies this distribution, and is available
-* at the URL "http://www.eclipse.org/legal/epl-v10.html".
-*
-* Initial Contributors:
-* Nokia Corporation - initial contribution.
-*
-* Contributors:
-*
-* Description:  Meta data Video access
-*
-*/
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  Meta data Video access
+ *
+ */
 
 #include <ContentListingFactory.h>
 #include <MCLFContentListingEngine.h>
@@ -62,23 +62,24 @@
 
 CMmMtpDpMetadataVideoAccess* CMmMtpDpMetadataVideoAccess::NewL( RFs& aRfs )
     {
-    CMmMtpDpMetadataVideoAccess* me = new(ELeave) CMmMtpDpMetadataVideoAccess( aRfs );
-    CleanupStack::PushL(me);
+    CMmMtpDpMetadataVideoAccess* me = new( ELeave ) CMmMtpDpMetadataVideoAccess( aRfs );
+    CleanupStack::PushL( me );
     me->ConstructL();
-    CleanupStack::Pop(me);
+    CleanupStack::Pop( me );
 
     return me;
     }
 
-CMmMtpDpMetadataVideoAccess::CMmMtpDpMetadataVideoAccess( RFs& aRfs ) : iRfs(aRfs),
-                                                    iDbState(ENoRecord),
-                                                    iDbOpened(EFalse)
+CMmMtpDpMetadataVideoAccess::CMmMtpDpMetadataVideoAccess( RFs& aRfs ) :
+    iRfs( aRfs ),
+    iDbState( ENoRecord ),
+    iDbOpened( EFalse )
     {
-    
+    // Do nothing
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::ConstructL
+// CMmMtpDpMetadataVideoAccess::ConstructL
 // Second-phase
 // ---------------------------------------------------------------------------
 //
@@ -88,8 +89,7 @@
 
     User::LeaveIfError( iDbsSession.Connect() );
 
-    TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory,
-        iStoreNum );
+    TInt err = DriveInfo::GetDefaultDrive( DriveInfo::EDefaultPhoneMemory, iStoreNum );
 
     err = OpenDatabase();
 
@@ -100,7 +100,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::OpenDatabase
+// CMmMtpDpMetadataVideoAccess::OpenDatabase
 // Open data base
 // ---------------------------------------------------------------------------
 //
@@ -168,7 +168,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::OpenDatabaseL
+// CMmMtpDpMetadataVideoAccess::OpenDatabaseL
 // Open data base
 // ---------------------------------------------------------------------------
 //
@@ -181,7 +181,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::~CMmMtpDpMetadataVideoAccess
+// CMmMtpDpMetadataVideoAccess::~CMmMtpDpMetadataVideoAccess
 // Destructor
 // ---------------------------------------------------------------------------
 //
@@ -196,7 +196,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::CreateDatabaseTablesL
+// CMmMtpDpMetadataVideoAccess::CreateDatabaseTablesL
 // Case where a new memory card is used and the player has not been opened
 // ---------------------------------------------------------------------------
 //
@@ -341,7 +341,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::CleanupDbIfNecessaryL
+// CMmMtpDpMetadataVideoAccess::CleanupDbIfNecessaryL
 // Cleanup Database
 // ---------------------------------------------------------------------------
 //
@@ -369,7 +369,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::IdentifyDeletedFilesL
+// CMmMtpDpMetadataVideoAccess::IdentifyDeletedFilesL
 // Identify deleted files
 // ---------------------------------------------------------------------------
 //
@@ -380,7 +380,7 @@
     ExecuteQueryL( KAllColumns, KMtpVideoTable, KMtpVideoLocation, KNullDesC, ETrue );
     PRINT1( _L( "MM MTP <> CleanupDbIfNecessaryL Database total count = %d" ), iRecordSet.CountL() );
 
-    for ( iRecordSet.FirstL(); iRecordSet.AtRow(); iRecordSet.NextL( ))
+    for ( iRecordSet.FirstL(); iRecordSet.AtRow(); iRecordSet.NextL() )
         {
         HBufC* data = ReadLongTextL( KMtpVideoLocation );
         CleanupStack::PushL( data );
@@ -407,7 +407,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::ReadLongTextL
+// CMmMtpDpMetadataVideoAccess::ReadLongTextL
 // Read from Data base
 // ---------------------------------------------------------------------------
 //
@@ -443,11 +443,12 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::WriteLongTextL
+// CMmMtpDpMetadataVideoAccess::WriteLongTextL
 // Utility to write to the database
 // ---------------------------------------------------------------------------
 //
-void CMmMtpDpMetadataVideoAccess::WriteLongTextL( const TDesC& aColumn, const TDesC& aValue )
+void CMmMtpDpMetadataVideoAccess::WriteLongTextL( const TDesC& aColumn,
+    const TDesC& aValue )
     {
     PRINT2( _L( "MM MTP <> WriteLongTextL Metadata value for %S is \"%S\"" ), &aColumn, &aValue );
     TDbColNo num = iColSet->ColNo( aColumn );
@@ -459,13 +460,16 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::ExecuteQueryL
+// CMmMtpDpMetadataVideoAccess::ExecuteQueryL
 // Executes a query on the database and sets the cursor at the start of the recordset
 // ---------------------------------------------------------------------------
 //
-void CMmMtpDpMetadataVideoAccess::ExecuteQueryL( const TDesC& aSelectThese, const TDesC& aFromTable,
-                                       const TDesC& aColumnToMatch, const TDesC& aMatchCriteria,
-                                       const TBool aIfNot, const TBool aNeedQuotes )
+void CMmMtpDpMetadataVideoAccess::ExecuteQueryL( const TDesC& aSelectThese,
+    const TDesC& aFromTable,
+    const TDesC& aColumnToMatch,
+    const TDesC& aMatchCriteria,
+    const TBool aIfNot,
+    const TBool aNeedQuotes )
     {
     PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::ExecuteQueryL" ) );
 
@@ -531,17 +535,17 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::OpenSessionL
+// CMmMtpDpMetadataVideoAccess::OpenSessionL
 // Called when the MTP session is initialised
 // ---------------------------------------------------------------------------
 //
 void CMmMtpDpMetadataVideoAccess::OpenSessionL()
     {
-
+    // Do nothing
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::CloseSessionL
+// CMmMtpDpMetadataVideoAccess::CloseSessionL
 // Called when the MTP session is closed
 // ---------------------------------------------------------------------------
 //
@@ -562,7 +566,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::AddVideoL
+// CMmMtpDpMetadataVideoAccess::AddVideoL
 // Adds video info to the database
 // ---------------------------------------------------------------------------
 //
@@ -593,7 +597,8 @@
         iRecordSet.SetColL( num, aFullFileName );
 
         num = iColSet->ColNo( KMtpVideoName );
-        iRecordSet.SetColL( num, aFullFileName );     // Default name is the filename.
+        TParsePtrC parser( aFullFileName );
+        iRecordSet.SetColL( num, parser.Name() ); // Default name is the filename.
 
         num = iColSet->ColNo( KMtpVideoArtist );
         iRecordSet.SetColL( num, KNullDesC );
@@ -622,8 +627,8 @@
         num = iColSet->ColNo( KMtpVideoHeight );
         iRecordSet.SetColL( num, 0 );
 
-        num = iColSet->ColNo(KMtpVideoDuration);
-        iRecordSet.SetColL(num, 0);
+        num = iColSet->ColNo( KMtpVideoDuration );
+        iRecordSet.SetColL( num, 0 );
 
         num = iColSet->ColNo( KMtpVideoSampleRate );
         iRecordSet.SetColL( num, 0 );
@@ -643,8 +648,8 @@
         num = iColSet->ColNo( KMtpVideoVideoBitrate );
         iRecordSet.SetColL( num, 0 );
 
-        num = iColSet->ColNo(KMtpVideoFramesPer1000Sec);
-        iRecordSet.SetColL(num, 0);
+        num = iColSet->ColNo( KMtpVideoFramesPer1000Sec );
+        iRecordSet.SetColL( num, 0 );
 
         num = iColSet->ColNo( KMtpVideoKeyFrameDistance );
         iRecordSet.SetColL( num, 0 );
@@ -694,13 +699,13 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::GetObjectMetadataValueL
+// CMmMtpDpMetadataVideoAccess::GetObjectMetadataValueL
 //  Gets a piece of metadata from the collection
 // ---------------------------------------------------------------------------
 //
 void CMmMtpDpMetadataVideoAccess::GetObjectMetadataValueL( const TUint16 aPropCode,
-        MMTPType& aNewData,
-        const CMTPObjectMetaData& aObjectMetaData )
+    MMTPType& aNewData,
+    const CMTPObjectMetaData& aObjectMetaData )
     {
     PRINT1( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::GetObjectMetadataValue aPropCode = 0x%x" ), aPropCode );
 
@@ -718,7 +723,7 @@
     TUint32 uInt32 = 0;
     TUint16 uInt16 = 0;
 
-    switch (aPropCode)
+    switch ( aPropCode )
         {
         case EMTPObjectPropCodeName:
             {
@@ -783,10 +788,13 @@
             PRINT( _L( "MM MTP <> EMTPObjectPropCodeDescription-MD" ) );
             data = ReadLongTextL( KMtpVideoComment );
 
-            if ( data->Length() != 0 )
-                ( ( CMTPTypeString& ) aNewData ).SetL( *data ) ;
-            else
-                ( ( TMTPTypeUint32 & ) aNewData ).Set( 0 );  // return zero if description is empty
+            TInt len = data->Length();
+            PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::GetObjectMetadataValue len = %d" ),len );
+            if ( len != 0 )
+                {
+                for ( TInt i = 0; i < len; i++ )
+                    ( ( CMTPTypeArray& ) aNewData ).AppendUintL( ( *data )[i] );
+                }
 
             delete data;
             data = NULL;
@@ -863,13 +871,13 @@
             num = iColSet->ColNo( KMtpVideoNumberOfChannels );
             uInt16 = iRecordSet.ColUint16( num );
             if ( EMTPTypeUINT16 == aNewData.Type() )
-                 {
-                 ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
-                 }
-             else
-                 {
-                 User::Leave( KErrArgument );
-                 }
+                {
+                ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
+                }
+            else
+                {
+                User::Leave( KErrArgument );
+                }
             }
             break;
 
@@ -975,13 +983,13 @@
             num = iColSet->ColNo( KMtpVideoScanType );
             uInt16 = iRecordSet.ColUint16( num );
             if ( EMTPTypeUINT16 == aNewData.Type() )
-                 {
-                 ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
-                 }
-             else
-                 {
-                 User::Leave( KErrArgument );
-                 }
+                {
+                ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
+                }
+            else
+                {
+                User::Leave( KErrArgument );
+                }
             }
             break;
 
@@ -1021,13 +1029,13 @@
             num = iColSet->ColNo( KMtpVideoDRM );
             uInt16 = iRecordSet.ColUint16( num );
             if ( EMTPTypeUINT16 == aNewData.Type() )
-                 {
-                 ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
-                 }
-             else
-                 {
-                 User::Leave( KErrArgument );
-                 }
+                {
+                ( ( TMTPTypeUint16 & ) aNewData ).Set( uInt16 );
+                }
+            else
+                {
+                User::Leave( KErrArgument );
+                }
             }
             break;
 
@@ -1039,7 +1047,7 @@
         }
 
     // Pack the info to aNewData
-    if (data)
+    if ( data )
         {
 #ifdef _DEBUG
         if ( data->Length() > KMtpMaxStringDescLength )   // Have to concatenate for MTP
@@ -1064,7 +1072,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetObjectMetadataValueL
+// CMmMtpDpMetadataVideoAccess::SetObjectMetadataValueL
 // Sets a piece of metadata in the collection
 // ---------------------------------------------------------------------------
 //
@@ -1096,7 +1104,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetMetadataL
+// CMmMtpDpMetadataVideoAccess::SetMetadataL
 // Set meta data.
 // ---------------------------------------------------------------------------
 //
@@ -1123,7 +1131,7 @@
         case EMTPObjectPropCodeEncodingProfile:
         case EMTPObjectPropCodeParentalRating:
             {
-            if( EMTPTypeString != aNewData.Type())
+            if ( EMTPTypeString != aNewData.Type() )
                 {
                 User::Leave( KErrArgument );
                 }
@@ -1137,12 +1145,12 @@
             {
             PRINT( _L( "MM MTP <> EMTPObjectPropCodeDescription-MD" ) );
 #ifdef __MUSIC_ID_SUPPORT
-            //WriteMusicIdsL(*longString);
+            // WriteMusicIdsL(*longString);
 #else
             desData = CMTPTypeArray::NewLC( EMTPTypeAUINT16 ); // + desData
             MMTPType::CopyL( aNewData, *desData );
             TUint length = desData->NumElements();
-            PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL length = %d" ), length );
+            PRINT1( _L( "MM MTP <> CMmMtpDpMetadataVideoAccess::SetMetadataL length = %d" ), length );
             if ( length != 0 )
                 {
                 TBuf<KMtpMaxDescriptionLength> text;
@@ -1151,7 +1159,7 @@
                     {
                     text.Append( desData->ElementUint( i ) );
                     }
-                PRINT1( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::SetMetadataValueL text = %S" ),
+                PRINT1( _L( "MM MTP <> CMmMtpDpMetadataVideoAccess::SetMetadataL text = %S" ),
                     &text );
                 WriteLongTextL( KMtpVideoComment, text );
                 }
@@ -1210,11 +1218,12 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::RenameRecordL
+// CMmMtpDpMetadataVideoAccess::RenameRecordL
 // Renames the file part of a record in the collection database.
 // ---------------------------------------------------------------------------
 //
-void CMmMtpDpMetadataVideoAccess::RenameRecordL(const TDesC& aOldFileName, const TDesC& aNewFileName)
+void CMmMtpDpMetadataVideoAccess::RenameRecordL( const TDesC& aOldFileName,
+    const TDesC& aNewFileName )
     {
     PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::RenameRecordL()" ) );
 
@@ -1230,7 +1239,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::DeleteRecordL
+// CMmMtpDpMetadataVideoAccess::DeleteRecordL
 // Deletes metadata information associated with the object
 // ---------------------------------------------------------------------------
 //
@@ -1267,7 +1276,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::DeleteAllRecordsL
+// CMmMtpDpMetadataVideoAccess::DeleteAllRecordsL
 // Empties the database - used by the FormatStore command
 // ---------------------------------------------------------------------------
 //
@@ -1276,7 +1285,7 @@
     PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::DeleteAllRecordsL()" ) );
 
     //open database if not opened
-    if (!IsDatabaseOpened())
+    if ( !IsDatabaseOpened() )
         OpenDatabaseL();
 
     SetRecordL( KNullDesC, ENoRecord );   // Commit any other changes to the DB
@@ -1298,18 +1307,19 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetRecordL
+// CMmMtpDpMetadataVideoAccess::SetRecordL
 // Set Record
 // ---------------------------------------------------------------------------
 //
-void CMmMtpDpMetadataVideoAccess::SetRecordL( const TDesC& aFullFileName, TMtpDbState aState )
+void CMmMtpDpMetadataVideoAccess::SetRecordL( const TDesC& aFullFileName,
+    TMtpDbState aState )
     {
     PRINT( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::SetRecordL()" ) );
 
     if ( ( aState == iDbState )
-            && ( 0 == aFullFileName.Compare( iCurrentFileName ) ) )    // Already have it
+        && ( 0 == aFullFileName.Compare( iCurrentFileName ) ) )    // Already have it
         {
-        if (iDbState == ERecordRead)
+        if ( iDbState == ERecordRead )
             iRecordSet.GetL();
 
         PRINT1( _L( "MM MTP <> Cached recordset, filename is '%S'" ), &iCurrentFileName );
@@ -1332,20 +1342,20 @@
             PRINT( _L( "MM MTP <> SetRecordL ERecordWrite" ) );
             TRAPD( err, iRecordSet.PutL() );
 
-            if (KErrNone != err)
+            if ( KErrNone != err )
                 {
                 iRecordSet.Cancel();
                 User::Leave( err );
                 }
-        //lint -fallthrough
+            //lint -fallthrough
         case ENoRecord:                 // intentionally fallthrough
             // We need to just close the open record
             PRINT( _L( "MM MTP <> SetRecordL ENoRecord" ) );
-        //lint -fallthrough
+            //lint -fallthrough
         case ERecordRead:               // intentionally fallthrough
             // We need to open a row for reading
             PRINT( _L( "MM MTP <> SetRecordL ERecordRead" ) );
-        //lint -fallthrough
+            //lint -fallthrough
         default:                        // intentionally fallthrough
             PRINT( _L( "MM MTP <> SetRecordL Closing recordset" ) );
             delete iColSet;
@@ -1355,7 +1365,7 @@
             break;
         }
 
-    if ( aState == ENoRecord )    // We are closing the session if this is the case
+    if ( aState == ENoRecord ) // We are closing the session if this is the case
         {
         PRINT( _L( "MM MTP <> SetRecordL Record closed, no request to open" ) );
         return;
@@ -1365,7 +1375,6 @@
     TUint16 format = MmMtpDpUtility::FormatFromFilename( iCurrentFileName );
     PRINT1( _L( "MM MTP <> SetRecordL format = 0x%x" ), format );
 
-
     if ( MmMtpDpUtility::HasMetadata( format ) )
         {
         // Get the record
@@ -1409,7 +1418,7 @@
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::SetImageObjPropL
+// CMmMtpDpMetadataVideoAccess::SetImageObjPropL
 // set image specific properties specific to videos
 // ---------------------------------------------------------------------------
 //
@@ -1430,24 +1439,24 @@
     TRAP( err, iRecordSet.SetColL( num, aWidth ) );
 
     if ( err != KErrNone )
-       {
-       SetRecordL( aFullFileName, EFailedWrite );
-       User::Leave( err );
-       }
+        {
+        SetRecordL( aFullFileName, EFailedWrite );
+        User::Leave( err );
+        }
 
     num = iColSet->ColNo( KMtpVideoHeight );
     TRAP( err, iRecordSet.SetColL( num, aHeight ) );
 
     if ( err != KErrNone )
-       {
-       SetRecordL( aFullFileName, EFailedWrite );
-       User::Leave( err );
-       }
+        {
+        SetRecordL( aFullFileName, EFailedWrite );
+        User::Leave( err );
+        }
     PRINT( _L( "MM MTP <= CMmMtpDpMetadataVideoAccess::SetImageObjPropL()" ) );
     }
 
 // ---------------------------------------------------------------------------
-// CMmMtpDpMetadataMpxAccess::GetImageObjPropL
+// CMmMtpDpMetadataVideoAccess::GetImageObjPropL
 // Get image specific properties specific to videos
 // ---------------------------------------------------------------------------
 //
@@ -1476,35 +1485,35 @@
 const TDesC& CMmMtpDpMetadataVideoAccess::ColumnNameFromPropCodeL( const TUint16 aPropCode )
     {
     const TColumnNameTable KColumnTable[] =
-    {
-        { EMTPObjectPropCodeName,                    KMtpVideoName },
-        { EMTPObjectPropCodeArtist,                  KMtpVideoArtist },
-        { EMTPObjectPropCodeTrack,                   KMtpVideoTrack },
-        { EMTPObjectPropCodeGenre,                   KMtpVideoGenre },
-        { EMTPObjectPropCodeAlbumName,               KMtpVideoAlbumName },
-        { EMTPObjectPropCodeComposer,                KMtpVideoComposer },
-        { EMTPObjectPropCodeOriginalReleaseDate,     KMtpVideoOrigReleaseDate },
-        { EMTPObjectPropCodeDescription,             KMtpVideoComment },
-        { EMTPObjectPropCodeWidth,                   KMtpVideoWidth },
-        { EMTPObjectPropCodeHeight,                  KMtpVideoHeight },
-        { EMTPObjectPropCodeDuration,                KMtpVideoDuration },
-        { EMTPObjectPropCodeSampleRate,              KMtpVideoSampleRate },
-        { EMTPObjectPropCodeNumberOfChannels,        KMtpVideoNumberOfChannels },
-        { EMTPObjectPropCodeAudioBitRate,            KMtpVideoAudioBitrate },
-        { EMTPObjectPropCodeVideoFourCCCodec,        KMtpVideoVideoCodec },
-        { EMTPObjectPropCodeVideoBitRate,            KMtpVideoVideoBitrate },
-        { EMTPObjectPropCodeFramesPerThousandSeconds,KMtpVideoFramesPer1000Sec },
-        { EMTPObjectPropCodeKeyFrameDistance,        KMtpVideoKeyFrameDistance },
-        { EMTPObjectPropCodeScanType,                KMtpVideoScanType },
-        { EMTPObjectPropCodeEncodingProfile,         KMtpVideoEncodingProfile },
-        { EMTPObjectPropCodeParentalRating,          KMtpVideoParentalRating },
-        { EMTPObjectPropCodeUseCount,                KMtpVideoUseCount },
-        { EMTPObjectPropCodeAudioWAVECodec,          KMtpVideoAudioCodec },
-        { EMTPObjectPropCodeDRMStatus,               KMtpVideoDRM },
-    };
+        {
+            { EMTPObjectPropCodeName,                    KMtpVideoName },
+            { EMTPObjectPropCodeArtist,                  KMtpVideoArtist },
+            { EMTPObjectPropCodeTrack,                   KMtpVideoTrack },
+            { EMTPObjectPropCodeGenre,                   KMtpVideoGenre },
+            { EMTPObjectPropCodeAlbumName,               KMtpVideoAlbumName },
+            { EMTPObjectPropCodeComposer,                KMtpVideoComposer },
+            { EMTPObjectPropCodeOriginalReleaseDate,     KMtpVideoOrigReleaseDate },
+            { EMTPObjectPropCodeDescription,             KMtpVideoComment },
+            { EMTPObjectPropCodeWidth,                   KMtpVideoWidth },
+            { EMTPObjectPropCodeHeight,                  KMtpVideoHeight },
+            { EMTPObjectPropCodeDuration,                KMtpVideoDuration },
+            { EMTPObjectPropCodeSampleRate,              KMtpVideoSampleRate },
+            { EMTPObjectPropCodeNumberOfChannels,        KMtpVideoNumberOfChannels },
+            { EMTPObjectPropCodeAudioBitRate,            KMtpVideoAudioBitrate },
+            { EMTPObjectPropCodeVideoFourCCCodec,        KMtpVideoVideoCodec },
+            { EMTPObjectPropCodeVideoBitRate,            KMtpVideoVideoBitrate },
+            { EMTPObjectPropCodeFramesPerThousandSeconds,KMtpVideoFramesPer1000Sec },
+            { EMTPObjectPropCodeKeyFrameDistance,        KMtpVideoKeyFrameDistance },
+            { EMTPObjectPropCodeScanType,                KMtpVideoScanType },
+            { EMTPObjectPropCodeEncodingProfile,         KMtpVideoEncodingProfile },
+            { EMTPObjectPropCodeParentalRating,          KMtpVideoParentalRating },
+            { EMTPObjectPropCodeUseCount,                KMtpVideoUseCount },
+            { EMTPObjectPropCodeAudioWAVECodec,          KMtpVideoAudioCodec },
+            { EMTPObjectPropCodeDRMStatus,               KMtpVideoDRM },
+        };
 
     TInt i = 0;
-    TInt count = sizeof ( KColumnTable ) / sizeof ( KColumnTable[0] );
+    TInt count = sizeof( KColumnTable ) / sizeof( KColumnTable[0] );
     while ( ( KColumnTable[i].iPropCode != aPropCode ) && ( i < count ) )
         {
         i++;
@@ -1513,7 +1522,7 @@
     if ( i == count )
         {
         // Not supported by MPX, shouldn't call this function
-        PRINT( _L( "MM MTP <> CMmMtpDpMetadataMpxAccess::MpxAttribFromPropL NOT SUPPORTED ATTRIBUTE" ) );
+        PRINT( _L( "MM MTP <> CMmMtpDpMetadataVideoAccess::ColumnNameFromPropCodeL NOT SUPPORTED ATTRIBUTE" ) );
         User::Leave( KErrNotSupported );
         }
     return KColumnTable[i].iDbColumnName;
@@ -1521,7 +1530,7 @@
 
 void CMmMtpDpMetadataVideoAccess::SetStorageRootL( const TDesC& aStorageRoot )
     {
-    PRINT1( _L( "MM MTP => CMmMtpDpMetadataMpxAccess::SetStorageRoot aStoreRoot = %S" ), &aStorageRoot );
+    PRINT1( _L( "MM MTP => CMmMtpDpMetadataVideoAccess::SetStorageRoot aStoreRoot = %S" ), &aStorageRoot );
 
     // get the drive number
     TParse pathParser;
@@ -1529,7 +1538,7 @@
     TChar driveChar( pathParser.Drive()[0] );
 
     User::LeaveIfError( RFs::CharToDrive( driveChar, iStoreNum ) );
-    PRINT1( _L( "MM MTP <= CMmMtpDpMetadataMpxAccess::SetStorageRoot drive number = %d" ), iStoreNum );
+    PRINT1( _L( "MM MTP <= CMmMtpDpMetadataVideoAccess::SetStorageRoot drive number = %d" ), iStoreNum );
     }
 
 void CMmMtpDpMetadataVideoAccess::CleanupDatabaseL()
--- a/mpx/collectionframework/collectionengine/inc/mpxcollectionengine.h	Tue Jan 26 12:18:42 2010 +0200
+++ b/mpx/collectionframework/collectionengine/inc/mpxcollectionengine.h	Tue Feb 02 00:27:58 2010 +0200
@@ -391,6 +391,8 @@
     * If not KNullUid, indicates the plugin that is currently being upgraded.
     */
     TUid iUpdatedPluginUid;
+
+    CMPXMedia* iMediaForHeapKeepAlive; // own
     };
 
 #include "mpxcollectionengine.inl"
--- a/mpx/collectionframework/collectionengine/src/mpxcollectionengine.cpp	Tue Jan 26 12:18:42 2010 +0200
+++ b/mpx/collectionframework/collectionengine/src/mpxcollectionengine.cpp	Tue Feb 02 00:27:58 2010 +0200
@@ -102,6 +102,7 @@
 //
 void CMPXCollectionEngine::ConstructL()
     {
+    iMediaForHeapKeepAlive = CMPXMedia::NewL(); // To avoid continuous heap 
     iPluginHandler=CMPXCollectionPluginHandler::NewL(*this, *this);
     iCache = CMPXCollectionCache::NewL(KMPXMaxCacheSizeRatio);
     }
@@ -112,6 +113,7 @@
 //
 EXPORT_C CMPXCollectionEngine::~CMPXCollectionEngine()
     {
+    delete iMediaForHeapKeepAlive;
     iCleanupStack.Close();
 
     iContexts.ResetAndDestroy();