35 #include "thumbnailpanic.h" |
35 #include "thumbnailpanic.h" |
36 #include "thumbnailcenrep.h" |
36 #include "thumbnailcenrep.h" |
37 #include "thumbnailmemorycardobserver.h" |
37 #include "thumbnailmemorycardobserver.h" |
38 #include "tmgetimei.h" |
38 #include "tmgetimei.h" |
39 #include "thumbnailfetchedchecker.h" |
39 #include "thumbnailfetchedchecker.h" |
|
40 #include "OstTraceDefinitions.h" |
|
41 #ifdef OST_TRACE_COMPILER_IN_USE |
|
42 #include "thumbnailserverTraces.h" |
|
43 #endif |
|
44 |
40 |
45 |
41 |
46 |
42 _LIT8( KThumbnailMimeWildCard, "*" ); |
47 _LIT8( KThumbnailMimeWildCard, "*" ); |
43 _LIT8( KThumbnailMimeImage, "image" ); |
48 _LIT8( KThumbnailMimeImage, "image" ); |
44 _LIT8( KThumbnailMimeVideo, "video" ); |
49 _LIT8( KThumbnailMimeVideo, "video" ); |
345 void CThumbnailServer::HandleSessionOpened( CMdESession& /* aSession */, TInt aError ) |
352 void CThumbnailServer::HandleSessionOpened( CMdESession& /* aSession */, TInt aError ) |
346 #else |
353 #else |
347 void CThumbnailServer::HandleSessionOpened( CMdESession& /* aSession */, TInt /*aError*/ ) |
354 void CThumbnailServer::HandleSessionOpened( CMdESession& /* aSession */, TInt /*aError*/ ) |
348 #endif |
355 #endif |
349 { |
356 { |
|
357 #ifdef _DEBUG |
350 TN_DEBUG2( "CThumbnailServer::HandleSessionOpened error == %d", aError ); |
358 TN_DEBUG2( "CThumbnailServer::HandleSessionOpened error == %d", aError ); |
|
359 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_HANDLESESSIONOPENED, "CThumbnailServer::HandleSessionOpened;aError=%d", aError ); |
|
360 #endif |
351 } |
361 } |
352 |
362 |
353 // ----------------------------------------------------------------------------- |
363 // ----------------------------------------------------------------------------- |
354 // CThumbnailServer::HandleSessionError |
364 // CThumbnailServer::HandleSessionError |
355 // ----------------------------------------------------------------------------- |
365 // ----------------------------------------------------------------------------- |
356 // |
366 // |
357 void CThumbnailServer::HandleSessionError( CMdESession& /*aSession*/, TInt aError ) |
367 void CThumbnailServer::HandleSessionError( CMdESession& /*aSession*/, TInt aError ) |
358 { |
368 { |
359 TN_DEBUG2( "CThumbnailServer::HandleSessionError == %d", aError ); |
369 TN_DEBUG2( "CThumbnailServer::HandleSessionError == %d", aError ); |
|
370 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_HANDLESESSIONERROR, "CThumbnailServer::HandleSessionError;aError=%d", aError ); |
360 if (aError != KErrNone && !iShutdown && !iSessionError) |
371 if (aError != KErrNone && !iShutdown && !iSessionError) |
361 { |
372 { |
362 iSessionError = ETrue; |
373 iSessionError = ETrue; |
363 |
374 |
364 if (!iReconnect->IsActive()) |
375 if (!iReconnect->IsActive()) |
365 { |
376 { |
366 iReconnect->Start( KMdEReconnect, KMdEReconnect, |
377 iReconnect->Start( KMdEReconnect, KMdEReconnect, |
367 TCallBack(ReconnectCallBack, this)); |
378 TCallBack(ReconnectCallBack, this)); |
368 |
379 |
369 TN_DEBUG1( "CThumbnailServer::HandleSessionError() - reconnect timer started" ); |
380 TN_DEBUG1( "CThumbnailServer::HandleSessionError() - reconnect timer started" ); |
|
381 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_HANDLESESSIONERROR, "CThumbnailServer::HandleSessionError - reconnect timer started" ); |
370 } |
382 } |
371 } |
383 } |
372 } |
384 } |
373 |
385 |
374 // ----------------------------------------------------------------------------- |
386 // ----------------------------------------------------------------------------- |
409 server = CThumbnailServer::NewL(); // Adds server in scheduler |
421 server = CThumbnailServer::NewL(); // Adds server in scheduler |
410 // No need to CleanupStack::PushL(server) since no leaves can happen |
422 // No need to CleanupStack::PushL(server) since no leaves can happen |
411 RProcess::Rendezvous( KErrNone ); |
423 RProcess::Rendezvous( KErrNone ); |
412 TN_DEBUG1( |
424 TN_DEBUG1( |
413 "CThumbnailServer::ThreadFunctionL() -- CActiveScheduler::Start() in" ); |
425 "CThumbnailServer::ThreadFunctionL() -- CActiveScheduler::Start() in" ); |
|
426 OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_THREADFUNCTIONL, "CThumbnailServer::ThreadFunctionL -- CActiveScheduler::Start() in" ); |
414 CActiveScheduler::Start(); |
427 CActiveScheduler::Start(); |
415 TN_DEBUG1( |
428 TN_DEBUG1( |
416 "CThumbnailServer::ThreadFunctionL() -- CActiveScheduler::Start() out" ); |
429 "CThumbnailServer::ThreadFunctionL() -- CActiveScheduler::Start() out" ); |
|
430 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_THREADFUNCTIONL, "CThumbnailServer::ThreadFunctionL - out" ); |
417 // Comes here if server gets shut down |
431 // Comes here if server gets shut down |
418 delete server; |
432 delete server; |
419 server = NULL; |
433 server = NULL; |
420 CleanupStack::PopAndDestroy( scheduler ); |
434 CleanupStack::PopAndDestroy( scheduler ); |
421 } |
435 } |
440 // |
455 // |
441 void CThumbnailServer::DropSession(CThumbnailServerSession* aSession) |
456 void CThumbnailServer::DropSession(CThumbnailServerSession* aSession) |
442 { |
457 { |
443 TN_DEBUG2( "CThumbnailServer::DropSession() iSessionCount was %d", |
458 TN_DEBUG2( "CThumbnailServer::DropSession() iSessionCount was %d", |
444 iSessionCount ); |
459 iSessionCount ); |
|
460 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;iSessionCount=%d", iSessionCount ); |
445 iSessionCount--; |
461 iSessionCount--; |
446 |
462 |
447 if(iProcessor) |
463 if(iProcessor) |
448 { |
464 { |
449 iProcessor->RemoveTasks(aSession); |
465 iProcessor->RemoveTasks(aSession); |
450 } |
466 } |
451 |
467 |
452 TN_DEBUG2( "CThumbnailServer::DropSession() aSession = 0x%08x", aSession ); |
468 TN_DEBUG2( "CThumbnailServer::DropSession() aSession = 0x%08x", aSession ); |
|
469 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;aSession=%o", aSession ); |
453 |
470 |
454 // clean-up bitmap pool |
471 // clean-up bitmap pool |
455 THashMapIter < TInt, TThumbnailBitmapRef > bpiter( iBitmapPool ); |
472 THashMapIter < TInt, TThumbnailBitmapRef > bpiter( iBitmapPool ); |
456 |
473 |
457 // const pointer to a non-const object |
474 // const pointer to a non-const object |
460 while ( ref ) |
477 while ( ref ) |
461 { |
478 { |
462 if ( ref->iSession == aSession ) |
479 if ( ref->iSession == aSession ) |
463 { |
480 { |
464 TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession ); |
481 TN_DEBUG2( "CThumbnailServer::DropSession() - ref->iSession = 0x%08x", ref->iSession ); |
|
482 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;ref->iSession=%o", ref->iSession ); |
465 |
483 |
466 delete ref->iBitmap; |
484 delete ref->iBitmap; |
467 bpiter.RemoveCurrent(); |
485 bpiter.RemoveCurrent(); |
468 |
486 |
469 TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", iBitmapPool.Count()); |
487 TN_DEBUG2( "CThumbnailServer::DropSession() - deleted bitmap, left=%d", iBitmapPool.Count()); |
|
488 OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_DROPSESSION, "CThumbnailServer::DropSession;iBitmapPool.Count()=%d", iBitmapPool.Count() ); |
470 } |
489 } |
471 |
490 |
472 ref = bpiter.NextValue(); |
491 ref = bpiter.NextValue(); |
473 } |
492 } |
474 |
493 |
491 // ----------------------------------------------------------------------------- |
510 // ----------------------------------------------------------------------------- |
492 // |
511 // |
493 void CThumbnailServer::ShutdownNotification() |
512 void CThumbnailServer::ShutdownNotification() |
494 { |
513 { |
495 TN_DEBUG1( "CThumbnailServer::ShutdownNotification()"); |
514 TN_DEBUG1( "CThumbnailServer::ShutdownNotification()"); |
|
515 OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_SHUTDOWNNOTIFICATION, "CThumbnailServer::ShutdownNotification" ); |
496 if (!iShutdown) |
516 if (!iShutdown) |
497 { |
517 { |
498 TN_DEBUG1( "CThumbnailServer::ShutdownNotification() shutdown"); |
518 TN_DEBUG1( "CThumbnailServer::ShutdownNotification() shutdown"); |
|
519 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_SHUTDOWNNOTIFICATION, "CThumbnailServer::ShutdownNotification - shutdown" ); |
499 CActiveScheduler::Stop(); |
520 CActiveScheduler::Stop(); |
500 iShutdown = ETrue; |
521 iShutdown = ETrue; |
501 } |
522 } |
502 } |
523 } |
503 |
524 |
511 CFbsBitmap* aBitmap, TThumbnailServerRequestId aRequestId ) |
532 CFbsBitmap* aBitmap, TThumbnailServerRequestId aRequestId ) |
512 { |
533 { |
513 if( !aBitmap ) |
534 if( !aBitmap ) |
514 { |
535 { |
515 TN_DEBUG1( "CThumbnailServer::AddBitmapToPoolL() - KErrArgument"); |
536 TN_DEBUG1( "CThumbnailServer::AddBitmapToPoolL() - KErrArgument"); |
|
537 OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_ADDBITMAPTOPOOLL, "CThumbnailServer::AddBitmapToPoolL - KErrArgument" ); |
516 User::Leave( KErrArgument ); |
538 User::Leave( KErrArgument ); |
517 } |
539 } |
518 TN_DEBUG4( |
540 TN_DEBUG4( |
519 "CThumbnailServer::AddBitmapToPoolL(aSession=0x%08x, aBitmap=0x%08x), handle=%d", aSession, aBitmap, aBitmap->Handle()); |
541 "CThumbnailServer::AddBitmapToPoolL(aSession=0x%08x, aBitmap=0x%08x), handle=%d", aSession, aBitmap, aBitmap->Handle()); |
520 |
542 |
521 TThumbnailBitmapRef* ptr = iBitmapPool.Find( aBitmap->Handle()); |
543 TThumbnailBitmapRef* ptr = iBitmapPool.Find( aBitmap->Handle()); |
522 |
544 |
523 TN_DEBUG2( "CThumbnailServer::AddBitmapToPoolL() - req id = %d", aRequestId.iRequestId ); |
545 TN_DEBUG2( "CThumbnailServer::AddBitmapToPoolL() - req id = %d", aRequestId.iRequestId ); |
|
546 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_ADDBITMAPTOPOOLL, "CThumbnailServer::AddBitmapToPoolL;aRequestId.iRequestId=%u", aRequestId.iRequestId ); |
524 |
547 |
525 if ( ptr ) |
548 if ( ptr ) |
526 { |
549 { |
527 ptr->iRefCount++; |
550 ptr->iRefCount++; |
528 } |
551 } |
551 const TSize& aOriginalSize, const TBool aCropped, const TThumbnailSize aThumbnailSize, |
575 const TSize& aOriginalSize, const TBool aCropped, const TThumbnailSize aThumbnailSize, |
552 const TInt64 aModified, const TBool aThumbFromPath, const TBool aCheckExist ) |
576 const TInt64 aModified, const TBool aThumbFromPath, const TBool aCheckExist ) |
553 { |
577 { |
554 TN_DEBUG6( |
578 TN_DEBUG6( |
555 "CThumbnailServer::StoreBitmapL(aPath=%S, aBitmap=0x%08x, aOriginalSize=%dx%d, aCropped=%d)", &aPath, aBitmap, aOriginalSize.iWidth, aOriginalSize.iHeight, aCropped ); |
579 "CThumbnailServer::StoreBitmapL(aPath=%S, aBitmap=0x%08x, aOriginalSize=%dx%d, aCropped=%d)", &aPath, aBitmap, aOriginalSize.iWidth, aOriginalSize.iHeight, aCropped ); |
|
580 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aBitmap=%o", aBitmap ); |
|
581 OstTraceExt1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aPath=%S", aPath ); |
|
582 OstTraceExt3( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aOriginalSize.iWidth=%d;aOriginalSize.iHeight=%d;aCropped=%u", aOriginalSize.iWidth, aOriginalSize.iHeight, aCropped ); |
|
583 |
556 #ifdef _DEBUG |
584 #ifdef _DEBUG |
557 TN_DEBUG2( "CThumbnailServer::StoreThumbnailL() - iScaledBitmap displaymode is %d", aBitmap->DisplayMode()); |
585 TN_DEBUG2( "CThumbnailServer::StoreThumbnailL() - iScaledBitmap displaymode is %d", aBitmap->DisplayMode()); |
|
586 OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL;aBitmap->DisplayMode()=%u", aBitmap->DisplayMode() ); |
558 #endif |
587 #endif |
559 |
588 |
560 if (!aCheckExist) |
589 if (!aCheckExist) |
561 { |
590 { |
562 StoreForPathL( aPath )->StoreThumbnailL( aPath, aBitmap, aOriginalSize, |
591 StoreForPathL( aPath )->StoreThumbnailL( aPath, aBitmap, aOriginalSize, |
568 aCropped, aThumbnailSize, aModified, aThumbFromPath, EFalse ); |
597 aCropped, aThumbnailSize, aModified, aThumbFromPath, EFalse ); |
569 } |
598 } |
570 else |
599 else |
571 { |
600 { |
572 TN_DEBUG1( "CThumbnailServer::StoreThumbnailL() - file doesn't exists anymore, skip store!"); |
601 TN_DEBUG1( "CThumbnailServer::StoreThumbnailL() - file doesn't exists anymore, skip store!"); |
|
602 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_STORETHUMBNAILL, "CThumbnailServer::StoreThumbnailL - file doesn't exists anymore, skip store!" ); |
573 } |
603 } |
574 |
604 |
575 if( iFetchedChecker ) |
605 if( iFetchedChecker ) |
576 { |
606 { |
577 iFetchedChecker->SetFetchResult( aPath, aThumbnailSize, KErrNone ); |
607 iFetchedChecker->SetFetchResult( aPath, aThumbnailSize, KErrNone ); |
585 // |
615 // |
586 void CThumbnailServer::FetchThumbnailL( const TDesC& aPath, CFbsBitmap* & |
616 void CThumbnailServer::FetchThumbnailL( const TDesC& aPath, CFbsBitmap* & |
587 aThumbnail, TDesC8* & aData, const TThumbnailSize aThumbnailSize, TSize &aOriginalSize ) |
617 aThumbnail, TDesC8* & aData, const TThumbnailSize aThumbnailSize, TSize &aOriginalSize ) |
588 { |
618 { |
589 TN_DEBUG3( "CThumbnailServer::FetchThumbnailL(aPath=%S aThumbnailSize=%d)", &aPath, aThumbnailSize ); |
619 TN_DEBUG3( "CThumbnailServer::FetchThumbnailL(aPath=%S aThumbnailSize=%d)", &aPath, aThumbnailSize ); |
|
620 OstTraceExt2( TRACE_NORMAL, CTHUMBNAILSERVER_FETCHTHUMBNAILL, "CThumbnailServer::FetchThumbnailL;aPath=%S;aThumbnailSize=%hu", aPath, aThumbnailSize ); |
590 if( iFetchedChecker ) |
621 if( iFetchedChecker ) |
591 { |
622 { |
592 TInt err( iFetchedChecker->LastFetchResult( aPath, aThumbnailSize ) ); |
623 TInt err( iFetchedChecker->LastFetchResult( aPath, aThumbnailSize ) ); |
593 if ( err == KErrNone ) // To avoid useless sql gets that fails for sure |
624 if ( err == KErrNone ) // To avoid useless sql gets that fails for sure |
594 { |
625 { |
626 // ----------------------------------------------------------------------------- |
657 // ----------------------------------------------------------------------------- |
627 // |
658 // |
628 void CThumbnailServer::DeleteBitmapFromPool( TInt aHandle ) |
659 void CThumbnailServer::DeleteBitmapFromPool( TInt aHandle ) |
629 { |
660 { |
630 TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool(%d)", aHandle ); |
661 TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool(%d)", aHandle ); |
|
662 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool;aHandle=%d", aHandle ); |
631 |
663 |
632 TThumbnailBitmapRef* ptr = iBitmapPool.Find( aHandle ); |
664 TThumbnailBitmapRef* ptr = iBitmapPool.Find( aHandle ); |
633 if ( ptr ) |
665 if ( ptr ) |
634 { |
666 { |
635 ptr->iRefCount--; |
667 ptr->iRefCount--; |
636 if ( !ptr->iRefCount ) |
668 if ( !ptr->iRefCount ) |
637 { |
669 { |
638 TN_DEBUG3( |
670 TN_DEBUG3( |
639 "CThumbnailServer::DeleteBitmapFromPool(%d) -- deleting 0x%08x)", aHandle, ptr ); |
671 "CThumbnailServer::DeleteBitmapFromPool(%d) -- deleting 0x%08x)", aHandle, ptr ); |
|
672 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool -- deleting;ptr=%o", ptr ); |
640 delete ptr->iBitmap; |
673 delete ptr->iBitmap; |
641 ptr->iBitmap = NULL; |
674 ptr->iBitmap = NULL; |
642 iBitmapPool.Remove( aHandle ); |
675 iBitmapPool.Remove( aHandle ); |
643 TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool -- items left %d", iBitmapPool.Count() ); |
676 TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool -- items left %d", iBitmapPool.Count() ); |
|
677 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool -- items left;iBitmapPool.Count()=%d", iBitmapPool.Count() ); |
644 } |
678 } |
645 else |
679 else |
646 { |
680 { |
647 TN_DEBUG3( |
681 TN_DEBUG3( |
648 "CThumbnailServer::DeleteBitmapFromPool(%d) -- refcount now %d", |
682 "CThumbnailServer::DeleteBitmapFromPool(%d) -- refcount now %d", |
649 aHandle, ptr->iRefCount ); |
683 aHandle, ptr->iRefCount ); |
|
684 OstTraceExt2( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool) -- refcount now;aHandle=%d;ptr->iRefCount=%d", aHandle, ptr->iRefCount ); |
650 } |
685 } |
651 } |
686 } |
652 else |
687 else |
653 { |
688 { |
654 //__ASSERT_DEBUG(( EFalse ), ThumbnailPanic( EThumbnailBitmapNotReleased )); |
689 //__ASSERT_DEBUG(( EFalse ), ThumbnailPanic( EThumbnailBitmapNotReleased )); |
655 TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool(%d) -- not found!", |
690 TN_DEBUG2( "CThumbnailServer::DeleteBitmapFromPool(%d) -- not found!", |
656 aHandle ); |
691 aHandle ); |
|
692 OstTrace1( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_DELETEBITMAPFROMPOOL, "CThumbnailServer::DeleteBitmapFromPool -- not found!;aHandle=%d", aHandle ); |
657 } |
693 } |
658 } |
694 } |
659 |
695 |
660 |
696 |
661 // ----------------------------------------------------------------------------- |
697 // ----------------------------------------------------------------------------- |
698 |
735 |
699 if ( drm && filetype != ContentAccess::EOma1Dcf ) |
736 if ( drm && filetype != ContentAccess::EOma1Dcf ) |
700 { |
737 { |
701 // cannot handle other than Oma DRM 1.x files |
738 // cannot handle other than Oma DRM 1.x files |
702 TN_DEBUG1( "CThumbnailStore::ResolveMimeTypeL()- only OMA DRM 1.0 supported"); |
739 TN_DEBUG1( "CThumbnailStore::ResolveMimeTypeL()- only OMA DRM 1.0 supported"); |
|
740 OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_RESOLVEMIMETYPEL, "CThumbnailServer::ResolveMimeTypeL - only OMA DRM 1.0 supported" ); |
703 User::Leave(KErrNotSupported); |
741 User::Leave(KErrNotSupported); |
704 } |
742 } |
705 |
743 |
706 TDataRecognitionResult res; |
744 TDataRecognitionResult res; |
707 if ( iRecognizer.Handle() == KNullHandle ) |
745 if ( iRecognizer.Handle() == KNullHandle ) |
795 TN_DEBUG2( |
837 TN_DEBUG2( |
796 "CThumbnailServer::GetProviderL() -- loading plug-in, UID 0x%08x", |
838 "CThumbnailServer::GetProviderL() -- loading plug-in, UID 0x%08x", |
797 aImplUid ); |
839 aImplUid ); |
798 res = CThumbnailProvider::NewL( aImplUid ); |
840 res = CThumbnailProvider::NewL( aImplUid ); |
799 TN_DEBUG1( "CThumbnailServer::GetProviderL() -- loading complete" ); |
841 TN_DEBUG1( "CThumbnailServer::GetProviderL() -- loading complete" ); |
|
842 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_GETPROVIDERL, "CThumbnailServer::GetProviderL -- loading complete" ); |
800 CleanupStack::PushL( res ); |
843 CleanupStack::PushL( res ); |
801 iProviders.InsertL( aImplUid.iUid, res ); |
844 iProviders.InsertL( aImplUid.iUid, res ); |
802 CleanupStack::Pop( res ); |
845 CleanupStack::Pop( res ); |
803 } |
846 } |
804 |
847 |
850 const TThumbnailBitmapRef* ref = bpiter.NextValue(); |
894 const TThumbnailBitmapRef* ref = bpiter.NextValue(); |
851 |
895 |
852 while ( ref ) |
896 while ( ref ) |
853 { |
897 { |
854 TN_DEBUG2( "CThumbnailServer::DequeTask() - ref->iRequestId = %d", ref->iRequestId ); |
898 TN_DEBUG2( "CThumbnailServer::DequeTask() - ref->iRequestId = %d", ref->iRequestId ); |
|
899 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_DEQUETASK, "CThumbnailServer::DequeTask;ref->iRequestId=%u", ref->iRequestId ); |
855 |
900 |
856 if ( ref->iSession == aRequestId.iSession && |
901 if ( ref->iSession == aRequestId.iSession && |
857 ref->iRequestId == aRequestId.iRequestId ) |
902 ref->iRequestId == aRequestId.iRequestId ) |
858 { |
903 { |
859 delete ref->iBitmap; |
904 delete ref->iBitmap; |
860 bpiter.RemoveCurrent(); |
905 bpiter.RemoveCurrent(); |
861 |
906 |
862 TN_DEBUG2( "CThumbnailServer::DequeTask() - deleted bitmap, left=%d", |
907 TN_DEBUG2( "CThumbnailServer::DequeTask() - deleted bitmap, left=%d", |
863 iBitmapPool.Count()); |
908 iBitmapPool.Count()); |
|
909 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_DEQUETASK, "CThumbnailServer::DequeTask;iBitmapPool.Count()=%d", iBitmapPool.Count() ); |
864 } |
910 } |
865 |
911 |
866 ref = bpiter.NextValue(); |
912 ref = bpiter.NextValue(); |
867 } |
913 } |
868 |
914 |
930 // ----------------------------------------------------------------------------- |
976 // ----------------------------------------------------------------------------- |
931 // |
977 // |
932 CThumbnailStore* CThumbnailServer::StoreForDriveL( const TInt aDrive ) |
978 CThumbnailStore* CThumbnailServer::StoreForDriveL( const TInt aDrive ) |
933 { |
979 { |
934 TN_DEBUG2( "CThumbnailServer::StoreForDriveL() drive=%d", aDrive ); |
980 TN_DEBUG2( "CThumbnailServer::StoreForDriveL() drive=%d", aDrive ); |
|
981 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL;aDrive=%d", aDrive ); |
935 |
982 |
936 if(iUnmountedDrives.Find( aDrive ) >= KErrNone) |
983 if(iUnmountedDrives.Find( aDrive ) >= KErrNone) |
937 { |
984 { |
938 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() unmount in progress, skip!"); |
985 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() unmount in progress, skip!"); |
|
986 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - unmount in progress, skip!" ); |
939 User::Leave( KErrDisMounted ); |
987 User::Leave( KErrDisMounted ); |
940 } |
988 } |
941 |
989 |
942 CThumbnailStore** resPtr = iStores.Find( aDrive ); |
990 CThumbnailStore** resPtr = iStores.Find( aDrive ); |
943 CThumbnailStore* res = NULL; |
991 CThumbnailStore* res = NULL; |
949 else |
997 else |
950 { |
998 { |
951 if( iFormatting ) |
999 if( iFormatting ) |
952 { |
1000 { |
953 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - FORMATTING! - ABORT"); |
1001 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - FORMATTING! - ABORT"); |
|
1002 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - FORMATTING! - ABORT" ); |
954 User::Leave( KErrNotSupported ); |
1003 User::Leave( KErrNotSupported ); |
955 } |
1004 } |
956 |
1005 |
957 TVolumeInfo volumeInfo; |
1006 TVolumeInfo volumeInfo; |
958 TInt err = iFs.Volume( volumeInfo, aDrive ); |
1007 TInt err = iFs.Volume( volumeInfo, aDrive ); |
959 |
1008 |
960 if ( err ) |
1009 if ( err ) |
961 { |
1010 { |
962 // Locked |
1011 // Locked |
963 TN_DEBUG2( "CThumbnailServer::StoreForDriveL() - err %d", err); |
1012 TN_DEBUG2( "CThumbnailServer::StoreForDriveL() - err %d", err); |
|
1013 OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL;err=%d", err ); |
964 User::Leave( err); |
1014 User::Leave( err); |
965 } |
1015 } |
966 else if( volumeInfo.iDrive.iMediaAtt& KMediaAttLocked ) |
1016 else if( volumeInfo.iDrive.iMediaAtt& KMediaAttLocked ) |
967 { |
1017 { |
968 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - locked"); |
1018 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - locked"); |
|
1019 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - locked" ); |
969 User::Leave( KErrAccessDenied ); |
1020 User::Leave( KErrAccessDenied ); |
970 } |
1021 } |
971 else if ( volumeInfo.iDrive.iDriveAtt& KDriveAttRom || |
1022 else if ( volumeInfo.iDrive.iDriveAtt& KDriveAttRom || |
972 volumeInfo.iDrive.iDriveAtt& KDriveAttRemote || |
1023 volumeInfo.iDrive.iDriveAtt& KDriveAttRemote || |
973 volumeInfo.iDrive.iMediaAtt& KMediaAttWriteProtected ) |
1024 volumeInfo.iDrive.iMediaAtt& KMediaAttWriteProtected ) |
974 { |
1025 { |
975 // We support ROM disks and remote disks in read only mode. |
1026 // We support ROM disks and remote disks in read only mode. |
976 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - rom/remote/write protected"); |
1027 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - rom/remote/write protected"); |
|
1028 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - rom/remote/write protected" ); |
977 res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, ETrue ); |
1029 res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, ETrue ); |
978 } |
1030 } |
979 else |
1031 else |
980 { |
1032 { |
981 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - normal"); |
1033 TN_DEBUG1( "CThumbnailServer::StoreForDriveL() - normal"); |
|
1034 OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSERVER_STOREFORDRIVEL, "CThumbnailServer::StoreForDriveL - normal" ); |
982 res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, EFalse ); |
1035 res = CThumbnailStore::NewL( iFs, aDrive, iImei, this, EFalse ); |
983 } |
1036 } |
984 |
1037 |
985 CleanupStack::PushL( res ); |
1038 CleanupStack::PushL( res ); |
986 iStores.InsertL( aDrive, res ); |
1039 iStores.InsertL( aDrive, res ); |
1004 CThumbnailStore* CThumbnailServer::StoreForPathL( const TDesC& aPath ) |
1057 CThumbnailStore* CThumbnailServer::StoreForPathL( const TDesC& aPath ) |
1005 { |
1058 { |
1006 if(aPath.Length() < 3 || aPath.Length() > KMaxPath) |
1059 if(aPath.Length() < 3 || aPath.Length() > KMaxPath) |
1007 { |
1060 { |
1008 TN_DEBUG1( "CThumbnailServer::StoreForPathL() - KErrArgument"); |
1061 TN_DEBUG1( "CThumbnailServer::StoreForPathL() - KErrArgument"); |
|
1062 OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_STOREFORPATHL, "CThumbnailServer::StoreForPathL - KErrArgument" ); |
1009 User::Leave(KErrArgument); |
1063 User::Leave(KErrArgument); |
1010 } |
1064 } |
1011 TInt drive = 0; |
1065 TInt drive = 0; |
1012 User::LeaveIfError( RFs::CharToDrive( aPath[0], drive )); |
1066 User::LeaveIfError( RFs::CharToDrive( aPath[0], drive )); |
1013 return StoreForDriveL( drive ); |
1067 return StoreForDriveL( drive ); |
1132 |
1188 |
1133 // if removable drive, add observer |
1189 // if removable drive, add observer |
1134 if (!err && driveInfo.iDriveAtt& KDriveAttRemovable) |
1190 if (!err && driveInfo.iDriveAtt& KDriveAttRemovable) |
1135 { |
1191 { |
1136 TN_DEBUG2( "CThumbnailServer::AddOnMountObserver drive=%d", drive); |
1192 TN_DEBUG2( "CThumbnailServer::AddOnMountObserver drive=%d", drive); |
|
1193 OstTrace1( TRACE_NORMAL, CTHUMBNAILSERVER_ADDUNMOUNTOBSERVERSL, "CThumbnailServer::AddUnmountObserversL;drive=%d", drive ); |
1137 CThumbnailDiskUnmountObserver* obs = CThumbnailDiskUnmountObserver::NewL( iFs, drive, this ); |
1194 CThumbnailDiskUnmountObserver* obs = CThumbnailDiskUnmountObserver::NewL( iFs, drive, this ); |
1138 CleanupStack::PushL( obs ); |
1195 CleanupStack::PushL( obs ); |
1139 iUnmountObservers.AppendL( obs ); |
1196 iUnmountObservers.AppendL( obs ); |
1140 CleanupStack::Pop( obs ); |
1197 CleanupStack::Pop( obs ); |
1141 } |
1198 } |
1172 if (!err && !err_drive |
1230 if (!err && !err_drive |
1173 && driveInfo.iType != EMediaNotPresent |
1231 && driveInfo.iType != EMediaNotPresent |
1174 && driveInfo.iDriveAtt& KDriveAttRemovable ) |
1232 && driveInfo.iDriveAtt& KDriveAttRemovable ) |
1175 { |
1233 { |
1176 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL mount drive==%d", drive); |
1234 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL mount drive==%d", drive); |
|
1235 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL;drive=%d", drive ); |
1177 |
1236 |
1178 CThumbnailStore** resPtr = iStores.Find( drive ); |
1237 CThumbnailStore** resPtr = iStores.Find( drive ); |
1179 |
1238 |
1180 if ( resPtr ) |
1239 if ( resPtr ) |
1181 { |
1240 { |
1182 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() already mounted, skip %d", drive); |
1241 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() already mounted, skip %d", drive); |
|
1242 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL;drive=%d", drive ); |
1183 continue; |
1243 continue; |
1184 } |
1244 } |
1185 |
1245 |
1186 // ignore errors |
1246 // ignore errors |
1187 TRAP_IGNORE( StoreForDriveL( drive )); |
1247 TRAP_IGNORE( StoreForDriveL( drive )); |
1188 |
1248 |
1189 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() update KItemsleft == %d", KErrNotReady); |
1249 TUint driveStatus(0); |
1190 RProperty::Set(KTAGDPSNotification, KItemsleft, KErrNotReady ); |
1250 DriveInfo::GetDriveStatus(iFs, drive, driveStatus); |
|
1251 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() driveStatus = %d", driveStatus); |
|
1252 if (!(driveStatus & DriveInfo::EDriveUsbMemory) && |
|
1253 !(driveStatus & DriveInfo::EDriveRemote)) |
|
1254 { |
|
1255 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() update KItemsleft = %d", KErrNotReady); |
|
1256 OstTrace1( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL;KErrNotReady=%d - update KItemsleft", KErrNotReady ); |
|
1257 RProperty::Set(KTAGDPSNotification, KItemsleft, KErrNotReady ); |
|
1258 } |
1191 |
1259 |
1192 TInt index = iUnmountedDrives.Find( drive ); |
1260 TInt index = iUnmountedDrives.Find( drive ); |
1193 |
1261 |
1194 if(index >= KErrNone) |
1262 if(index >= KErrNone) |
1195 { |
1263 { |
1197 } |
1265 } |
1198 |
1266 |
1199 if(!iUnmountedDrives.Count()&& iUnmount && iUnmount->IsActive()) |
1267 if(!iUnmountedDrives.Count()&& iUnmount && iUnmount->IsActive()) |
1200 { |
1268 { |
1201 TN_DEBUG1( "CThumbnailServer::MemoryCardStatusChangedL() cancel unmount timer"); |
1269 TN_DEBUG1( "CThumbnailServer::MemoryCardStatusChangedL() cancel unmount timer"); |
|
1270 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL - cancel unmount timer" ); |
1202 iUnmount->Cancel(); |
1271 iUnmount->Cancel(); |
1203 } |
1272 } |
1204 } |
1273 } |
1205 |
1274 |
1206 //dismount -- if removable drive, close store |
1275 //dismount -- if removable drive, close store |
1207 else if(err && !err_drive && driveInfo.iDriveAtt& KDriveAttRemovable ) |
1276 else if(err && !err_drive && driveInfo.iDriveAtt& KDriveAttRemovable ) |
1208 { |
1277 { |
1209 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() unmount drive==%d", drive); |
1278 TN_DEBUG2( "CThumbnailServer::MemoryCardStatusChangedL() unmount drive==%d", drive); |
|
1279 OstTrace1( TRACE_NORMAL, DUP5_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL - unmount drive;drive=%d", drive ); |
1210 CloseStoreForDriveL( drive); |
1280 CloseStoreForDriveL( drive); |
1211 } |
1281 } |
1212 } |
1282 } |
1213 |
1283 |
1214 TN_DEBUG1( "CThumbnailServer::MemoryCardStatusChangedL out()" ); |
1284 TN_DEBUG1( "CThumbnailServer::MemoryCardStatusChangedL out()" ); |
|
1285 OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSERVER_MEMORYCARDSTATUSCHANGEDL, "CThumbnailServer::MemoryCardStatusChangedL - out" ); |
1215 } |
1286 } |
1216 |
1287 |
1217 |
1288 |
1218 // ----------------------------------------------------------------------------- |
1289 // ----------------------------------------------------------------------------- |
1219 // Get the required size (in characters) for a buffer that contains the |
1290 // Get the required size (in characters) for a buffer that contains the |
1268 // |
1339 // |
1269 TBool CThumbnailServer::UpdateThumbnailsL( const TDesC& aPath, |
1340 TBool CThumbnailServer::UpdateThumbnailsL( const TDesC& aPath, |
1270 const TInt /*aOrientation*/, const TInt64 aModified ) |
1341 const TInt /*aOrientation*/, const TInt64 aModified ) |
1271 { |
1342 { |
1272 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL()"); |
1343 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL()"); |
|
1344 OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL" ); |
1273 |
1345 |
1274 // 1. check path change |
1346 // 1. check path change |
1275 // 2. check orientation change |
1347 // 2. check timestamp change |
1276 // 3. check timestamp change |
|
1277 |
|
1278 TBool orientationChanged = EFalse; |
|
1279 TBool modifiedChanged = EFalse; |
1348 TBool modifiedChanged = EFalse; |
1280 |
1349 |
1281 CThumbnailStore* store = StoreForPathL( aPath ); |
1350 CThumbnailStore* store = StoreForPathL( aPath ); |
1282 |
1351 |
1283 // placeholder for orientation check |
1352 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exist"); |
1284 orientationChanged = EFalse; |
1353 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - exist" ); |
1285 |
1354 |
1286 if (orientationChanged) |
1355 TBool exists = store->CheckModifiedByPathL(aPath, aModified, modifiedChanged); |
1287 { |
1356 |
1288 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - orientation updated"); |
1357 if(!exists) |
1289 |
1358 { |
1290 // orientation updated, no need to check further |
1359 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exists NO"); |
|
1360 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - exists NO" ); |
|
1361 //not found, needs to be generated |
|
1362 return EFalse; |
|
1363 } |
|
1364 |
|
1365 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified ?"); |
|
1366 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - modified ?" ); |
|
1367 |
|
1368 if (modifiedChanged) |
|
1369 { |
|
1370 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified YES"); |
|
1371 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - modified YES" ); |
|
1372 |
|
1373 // delete old thumbs |
|
1374 store->DeleteThumbnailsL(aPath, ETrue); |
|
1375 |
|
1376 if( iFetchedChecker ) |
|
1377 { |
|
1378 iFetchedChecker->DeleteFetchResult( aPath ); |
|
1379 } |
|
1380 |
|
1381 // need to create new thumbs |
|
1382 } |
|
1383 else |
|
1384 { |
|
1385 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified NO"); |
|
1386 OstTrace0( TRACE_NORMAL, DUP6_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - modified NO" ); |
|
1387 |
|
1388 // not modified |
1291 return ETrue; |
1389 return ETrue; |
1292 } |
1390 } |
1293 else |
|
1294 { |
|
1295 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exist"); |
|
1296 |
|
1297 TBool exists = store->CheckModifiedByPathL(aPath, aModified, modifiedChanged); |
|
1298 |
|
1299 if(!exists) |
|
1300 { |
|
1301 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - exists NO"); |
|
1302 //not found, needs to be generated |
|
1303 return EFalse; |
|
1304 } |
|
1305 |
|
1306 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified ?"); |
|
1307 |
|
1308 if (modifiedChanged) |
|
1309 { |
|
1310 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified YES"); |
|
1311 |
|
1312 // delete old thumbs |
|
1313 store->DeleteThumbnailsL(aPath, ETrue); |
|
1314 |
|
1315 if( iFetchedChecker ) |
|
1316 { |
|
1317 iFetchedChecker->DeleteFetchResult( aPath ); |
|
1318 } |
|
1319 |
|
1320 // need to create new thumbs |
|
1321 } |
|
1322 else |
|
1323 { |
|
1324 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - modified NO"); |
|
1325 |
|
1326 // not modified |
|
1327 return ETrue; |
|
1328 } |
|
1329 } |
|
1330 |
|
1331 |
1391 |
1332 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - no thumbs found, create new"); |
1392 TN_DEBUG1( "CThumbnailServer::UpdateThumbnailsL() - no thumbs found, create new"); |
|
1393 OstTrace0( TRACE_NORMAL, DUP7_CTHUMBNAILSERVER_UPDATETHUMBNAILSL, "CThumbnailServer::UpdateThumbnailsL - no thumbs found, create new" ); |
1333 |
1394 |
1334 return EFalse; |
1395 return EFalse; |
1335 } |
1396 } |
1336 |
1397 |
1337 // ----------------------------------------------------------------------------- |
1398 // ----------------------------------------------------------------------------- |
1339 // ----------------------------------------------------------------------------- |
1400 // ----------------------------------------------------------------------------- |
1340 // |
1401 // |
1341 void CThumbnailServer::RenameThumbnailsL( const TDesC& aCurrentPath, const TDesC& aNewPath ) |
1402 void CThumbnailServer::RenameThumbnailsL( const TDesC& aCurrentPath, const TDesC& aNewPath ) |
1342 { |
1403 { |
1343 TN_DEBUG2( "CThumbnailServer::RenameThumbnailsL(%S)", &aCurrentPath); |
1404 TN_DEBUG2( "CThumbnailServer::RenameThumbnailsL(%S)", &aCurrentPath); |
|
1405 OstTraceExt1( TRACE_NORMAL, CTHUMBNAILSERVER_RENAMETHUMBNAILSL, "CThumbnailServer::RenameThumbnailsL;aCurrentPath=%S", aCurrentPath ); |
1344 |
1406 |
1345 StoreForPathL( aCurrentPath )->RenameThumbnailsL( aCurrentPath, aNewPath ); |
1407 StoreForPathL( aCurrentPath )->RenameThumbnailsL( aCurrentPath, aNewPath ); |
1346 |
1408 |
1347 if( iFetchedChecker ) |
1409 if( iFetchedChecker ) |
1348 { |
1410 { |
1416 aMimeType = TDataType( KBmpMime ); |
1478 aMimeType = TDataType( KBmpMime ); |
1417 } |
1479 } |
1418 else if ( ext.CompareF( K3gpExt ) == 0 ) |
1480 else if ( ext.CompareF( K3gpExt ) == 0 ) |
1419 { |
1481 { |
1420 aMimeType = TDataType( KVideo3gppMime ); |
1482 aMimeType = TDataType( KVideo3gppMime ); |
|
1483 return KErrNotFound; |
|
1484 // 3gp can contain video or audio, should go to recognizer |
1421 } |
1485 } |
1422 else if ( ext.CompareF( K3gppExt ) == 0 ) |
1486 else if ( ext.CompareF( K3gppExt ) == 0 ) |
1423 { |
1487 { |
1424 aMimeType = TDataType( KVideo3gppMime ); |
1488 aMimeType = TDataType( KVideo3gppMime ); |
|
1489 return KErrNotFound; |
|
1490 // 3gp can contain video or audio, should go to recognizer |
1425 } |
1491 } |
1426 else if ( ext.CompareF( KAmrExt ) == 0 ) |
1492 else if ( ext.CompareF( KAmrExt ) == 0 ) |
1427 { |
1493 { |
1428 aMimeType = TDataType( KAudioAmrMime ); |
1494 aMimeType = TDataType( KAudioAmrMime ); |
1429 } |
1495 } |
1623 { |
1689 { |
1624 TRAP( result, CThumbnailServer::ThreadFunctionL()); |
1690 TRAP( result, CThumbnailServer::ThreadFunctionL()); |
1625 TN_DEBUG2( |
1691 TN_DEBUG2( |
1626 "CThumbnailServer::E32Main() -- thread function out, result=%d", |
1692 "CThumbnailServer::E32Main() -- thread function out, result=%d", |
1627 result ); |
1693 result ); |
|
1694 OstTrace1( TRACE_NORMAL, _E32MAIN, "::E32Main;result=%d - thread function out", result ); |
1628 delete cleanup; |
1695 delete cleanup; |
1629 cleanup = NULL; |
1696 cleanup = NULL; |
1630 } |
1697 } |
1631 if ( result != KErrNone ) |
1698 if ( result != KErrNone ) |
1632 { |
1699 { |
1633 // Signal the client that server creation failed |
1700 // Signal the client that server creation failed |
1634 TN_DEBUG1( "CThumbnailServer::E32Main() -- Rendezvous() in" ); |
1701 TN_DEBUG1( "CThumbnailServer::E32Main() -- Rendezvous() in" ); |
|
1702 OstTrace0( TRACE_NORMAL, DUP2__E32MAIN, "::E32Main - in" ); |
1635 RProcess::Rendezvous( result ); |
1703 RProcess::Rendezvous( result ); |
1636 TN_DEBUG1( "CThumbnailServer::E32Main() -- Rendezvous() out" ); |
1704 TN_DEBUG1( "CThumbnailServer::E32Main() -- Rendezvous() out" ); |
|
1705 OstTrace0( TRACE_NORMAL, DUP1__E32MAIN, "::E32Main - out" ); |
1637 } |
1706 } |
1638 |
1707 |
1639 __UHEAP_MARKEND; |
1708 __UHEAP_MARKEND; |
1640 return result; |
1709 return result; |
1641 } |
1710 } |
1819 // --------------------------------------------------------------------------- |
1897 // --------------------------------------------------------------------------- |
1820 // |
1898 // |
1821 TInt CThumbnailServer::UnmountCallBack(TAny* aAny) |
1899 TInt CThumbnailServer::UnmountCallBack(TAny* aAny) |
1822 { |
1900 { |
1823 TN_DEBUG1( "CThumbnailServer::UnmountCallBack() - unmount finished"); |
1901 TN_DEBUG1( "CThumbnailServer::UnmountCallBack() - unmount finished"); |
|
1902 OstTrace0( TRACE_NORMAL, CTHUMBNAILSERVER_UNMOUNTCALLBACK, "CThumbnailServer::UnmountCallBack - unmount finished" ); |
1824 |
1903 |
1825 CThumbnailServer* self = static_cast<CThumbnailServer*>( aAny ); |
1904 CThumbnailServer* self = static_cast<CThumbnailServer*>( aAny ); |
1826 |
1905 |
1827 self->iUnmount->Cancel(); |
1906 self->iUnmount->Cancel(); |
1828 |
1907 |
1829 self->iUnmountedDrives.Reset(); |
1908 self->iUnmountedDrives.Reset(); |
1830 |
1909 |
1831 TN_DEBUG1( "CThumbAGDaemon::UnmountCallBack() - done"); |
1910 TN_DEBUG1( "CThumbAGDaemon::UnmountCallBack() - done"); |
|
1911 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBNAILSERVER_UNMOUNTCALLBACK, "CThumbnailServer::UnmountCallBack - done" ); |
1832 |
1912 |
1833 return KErrNone; |
1913 return KErrNone; |
1834 } |
1914 } |