equal
deleted
inserted
replaced
337 // and will not be processed again until the file is modified |
337 // and will not be processed again until the file is modified |
338 const TInt error = file.Open( iFs, aUri, EFileRead | EFileShareReadersOnly ); |
338 const TInt error = file.Open( iFs, aUri, EFileRead | EFileShareReadersOnly ); |
339 if ( error != KErrNone ) |
339 if ( error != KErrNone ) |
340 { |
340 { |
341 WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - File open error: %d", error ); |
341 WRITELOG1( "CHarvesterVideoPlugin::GetObjectType - File open error: %d", error ); |
342 if( error == KErrInUse ) |
342 if( error == KErrInUse || KErrLocked ) |
343 { |
343 { |
344 #ifdef _DEBUG |
344 #ifdef _DEBUG |
345 TPtrC fileName( aUri.Mid(2) ); |
345 TPtrC fileName( aUri.Mid(2) ); |
346 WRITELOG1( "CHarvesterVideoPlugin :: Checking open file handles to %S", &fileName ); |
346 WRITELOG1( "CHarvesterVideoPlugin :: Checking open file handles to %S", &fileName ); |
347 |
347 |
625 CleanupStack::PushL( helixMetadata ); |
625 CleanupStack::PushL( helixMetadata ); |
626 |
626 |
627 TRAP( error, helixMetadata->OpenFileL( file ) ); |
627 TRAP( error, helixMetadata->OpenFileL( file ) ); |
628 |
628 |
629 // No need for the file handle anymore so closing it |
629 // No need for the file handle anymore so closing it |
|
630 WRITELOG( "CHarvesterVideoPlugin - Parsing done, file handle can be closed" ); |
630 file.Close(); |
631 file.Close(); |
631 |
632 |
632 if ( error == KErrNone ) |
633 if ( error == KErrNone ) |
633 { |
634 { |
634 HBufC *buf = NULL; |
635 HBufC *buf = NULL; |
979 { |
980 { |
980 WRITELOG( "CHarvesterVideoPlugin - Error closing file handle" ); |
981 WRITELOG( "CHarvesterVideoPlugin - Error closing file handle" ); |
981 } |
982 } |
982 #endif |
983 #endif |
983 } |
984 } |
984 WRITELOG( "CHarvesterVideoPlugin - Closing file" ); |
985 WRITELOG( "CHarvesterVideoPlugin - Closing file, if still open" ); |
985 CleanupStack::PopAndDestroy( &file ); |
986 CleanupStack::PopAndDestroy( &file ); |
986 |
987 |
987 #ifdef _DEBUG |
988 #ifdef _DEBUG |
988 dStop.UniversalTime(); |
989 dStop.UniversalTime(); |
989 WRITELOG1( "CHarvesterVideoPlugin::GatherDataL start %d us", (TInt)dStop.MicroSecondsFrom(dStart).Int64() ); |
990 WRITELOG1( "CHarvesterVideoPlugin::GatherDataL start %d us", (TInt)dStop.MicroSecondsFrom(dStart).Int64() ); |
1245 |
1246 |
1246 CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL(); |
1247 CHXMetaDataUtility* helixMetadata = CHXMetaDataUtility::NewL(); |
1247 CleanupStack::PushL( helixMetadata ); |
1248 CleanupStack::PushL( helixMetadata ); |
1248 |
1249 |
1249 TRAPD( err, helixMetadata->OpenFileL( aFile ) ); |
1250 TRAPD( err, helixMetadata->OpenFileL( aFile ) ); |
|
1251 aFile.Close(); |
1250 |
1252 |
1251 if( err == KErrNone ) |
1253 if( err == KErrNone ) |
1252 { |
1254 { |
1253 // doesn't own pointers to MIME types |
1255 // doesn't own pointers to MIME types |
1254 RPointerArray<HBufC> mimes; |
1256 RPointerArray<HBufC> mimes; |
1271 } |
1273 } |
1272 } |
1274 } |
1273 |
1275 |
1274 const TInt mimeCount = mimes.Count(); |
1276 const TInt mimeCount = mimes.Count(); |
1275 |
1277 |
1276 // at least one MIME type must be found |
1278 // Set to Video, regardless how badly file is corrupted |
1277 if( mimeCount == 0 ) |
1279 if( mimeCount == 0 ) |
1278 { |
1280 { |
1279 User::Leave( KErrNotFound ); |
1281 aType.Copy( KVideo ); |
1280 } |
1282 } |
1281 |
1283 |
1282 for( TInt i = 0; i < mimeCount; i++ ) |
1284 for( TInt i = 0; i < mimeCount; i++ ) |
1283 { |
1285 { |
1284 HBufC* mime = mimes[i]; |
1286 HBufC* mime = mimes[i]; |
1334 CleanupStack::PopAndDestroy( helixMetadata ); |
1336 CleanupStack::PopAndDestroy( helixMetadata ); |
1335 |
1337 |
1336 if( blackListError == KErrNone ) |
1338 if( blackListError == KErrNone ) |
1337 { |
1339 { |
1338 RemoveFileFromBlackList( tempName, mediaId ); |
1340 RemoveFileFromBlackList( tempName, mediaId ); |
1339 } |
1341 } |
1340 |
|
1341 } |
1342 } |
1342 |
1343 |
1343 TInt CHarvesterVideoPlugin::AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId ) |
1344 TInt CHarvesterVideoPlugin::AddFileToBlackList( const TFileName& aFullName, const TUint32& aMediaId ) |
1344 { |
1345 { |
1345 TInt blackListError( KErrNone ); |
1346 TInt blackListError( KErrNone ); |