branch | RCL_3 |
changeset 21 | 6257223ede8a |
parent 20 | 2b4b06654caa |
child 22 | 9d4d3445ce6e |
20:2b4b06654caa | 21:6257223ede8a |
---|---|
28 |
28 |
29 #include "thumbagprocessor.h" |
29 #include "thumbagprocessor.h" |
30 #include "thumbnaillog.h" |
30 #include "thumbnaillog.h" |
31 #include "thumbnailmanagerconstants.h" |
31 #include "thumbnailmanagerconstants.h" |
32 #include "thumbnailmanagerprivatecrkeys.h" |
32 #include "thumbnailmanagerprivatecrkeys.h" |
33 #include "OstTraceDefinitions.h" |
|
34 #ifdef OST_TRACE_COMPILER_IN_USE |
|
35 #include "thumbagprocessorTraces.h" |
|
36 #endif |
|
33 |
37 |
34 // --------------------------------------------------------------------------- |
38 // --------------------------------------------------------------------------- |
35 // CThumbAGProcessor::NewL() |
39 // CThumbAGProcessor::NewL() |
36 // --------------------------------------------------------------------------- |
40 // --------------------------------------------------------------------------- |
37 // |
41 // |
38 CThumbAGProcessor* CThumbAGProcessor::NewL() |
42 CThumbAGProcessor* CThumbAGProcessor::NewL() |
39 { |
43 { |
40 TN_DEBUG1( "CThumbAGProcessor::NewL() - begin" ); |
44 TN_DEBUG1( "CThumbAGProcessor::NewL() - begin" ); |
45 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_NEWL, "CThumbAGProcessor::NewL - begin" ); |
|
41 |
46 |
42 CThumbAGProcessor* self = new( ELeave )CThumbAGProcessor(); |
47 CThumbAGProcessor* self = new( ELeave )CThumbAGProcessor(); |
43 CleanupStack::PushL( self ); |
48 CleanupStack::PushL( self ); |
44 self->ConstructL(); |
49 self->ConstructL(); |
45 CleanupStack::Pop( self ); |
50 CleanupStack::Pop( self ); |
52 // |
57 // |
53 CThumbAGProcessor::CThumbAGProcessor(): CActive( CActive::EPriorityStandard ), iMMCHarvestingItemsLeftTemp(0), |
58 CThumbAGProcessor::CThumbAGProcessor(): CActive( CActive::EPriorityStandard ), iMMCHarvestingItemsLeftTemp(0), |
54 iPHHarvestingItemsLeftTemp(0) |
59 iPHHarvestingItemsLeftTemp(0) |
55 { |
60 { |
56 TN_DEBUG1( "CThumbAGProcessor::CThumbAGProcessor() - begin" ); |
61 TN_DEBUG1( "CThumbAGProcessor::CThumbAGProcessor() - begin" ); |
62 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CTHUMBAGPROCESSOR, "CThumbAGProcessor::CThumbAGProcessor- begin" ); |
|
57 |
63 |
58 CActiveScheduler::Add( this ); |
64 CActiveScheduler::Add( this ); |
59 } |
65 } |
60 |
66 |
61 // --------------------------------------------------------------------------- |
67 // --------------------------------------------------------------------------- |
63 // --------------------------------------------------------------------------- |
69 // --------------------------------------------------------------------------- |
64 // |
70 // |
65 void CThumbAGProcessor::ConstructL() |
71 void CThumbAGProcessor::ConstructL() |
66 { |
72 { |
67 TN_DEBUG1( "CThumbAGProcessor::ConstructL() - begin" ); |
73 TN_DEBUG1( "CThumbAGProcessor::ConstructL() - begin" ); |
74 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CONSTRUCTL, "CThumbAGProcessor::ConstructL - begin" ); |
|
68 |
75 |
69 iShutdown = EFalse; |
76 iShutdown = EFalse; |
70 |
77 |
71 iTMSession = CThumbnailManager::NewL( *this ); |
78 iTMSession = CThumbnailManager::NewL( *this ); |
72 iTMSession->SetRequestObserver(*this); |
79 iTMSession->SetRequestObserver(*this); |
104 |
111 |
105 //start foreground generation observer |
112 //start foreground generation observer |
106 iForegroundGenerationObserver = CTMRPropertyObserver::NewL( *this, KTAGDPSNotification, KForceBackgroundGeneration, ETrue ); |
113 iForegroundGenerationObserver = CTMRPropertyObserver::NewL( *this, KTAGDPSNotification, KForceBackgroundGeneration, ETrue ); |
107 |
114 |
108 TN_DEBUG1( "CThumbAGProcessor::ConstructL() - end" ); |
115 TN_DEBUG1( "CThumbAGProcessor::ConstructL() - end" ); |
116 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CONSTRUCTL, "CThumbAGProcessor::ConstructL - end" ); |
|
109 } |
117 } |
110 |
118 |
111 // --------------------------------------------------------------------------- |
119 // --------------------------------------------------------------------------- |
112 // CThumbAGProcessor::~CThumbAGProcessor() |
120 // CThumbAGProcessor::~CThumbAGProcessor() |
113 // --------------------------------------------------------------------------- |
121 // --------------------------------------------------------------------------- |
114 // |
122 // |
115 CThumbAGProcessor::~CThumbAGProcessor() |
123 CThumbAGProcessor::~CThumbAGProcessor() |
116 { |
124 { |
117 TN_DEBUG1( "CThumbAGProcessor::~CThumbAGProcessor() - begin" ); |
125 TN_DEBUG1( "CThumbAGProcessor::~CThumbAGProcessor() - begin" ); |
126 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CTHUMBAGPROCESSOR, "CThumbAGProcessor::~CThumbAGProcessor - begin" ); |
|
118 |
127 |
119 Shutdown(); |
128 Shutdown(); |
120 |
129 |
121 Cancel(); |
130 Cancel(); |
122 |
131 |
204 iGenerationQueue.Close(); |
213 iGenerationQueue.Close(); |
205 |
214 |
206 iQueryQueue.Close(); |
215 iQueryQueue.Close(); |
207 |
216 |
208 TN_DEBUG1( "CThumbAGProcessor::~CThumbAGProcessor() - end" ); |
217 TN_DEBUG1( "CThumbAGProcessor::~CThumbAGProcessor() - end" ); |
218 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_CTHUMBAGPROCESSOR, "CThumbAGProcessor::~CThumbAGProcessor - end" ); |
|
209 } |
219 } |
210 |
220 |
211 // --------------------------------------------------------------------------- |
221 // --------------------------------------------------------------------------- |
212 // CThumbAGProcessor::Shutdown() |
222 // CThumbAGProcessor::Shutdown() |
213 // --------------------------------------------------------------------------- |
223 // --------------------------------------------------------------------------- |
214 // |
224 // |
215 void CThumbAGProcessor::Shutdown() |
225 void CThumbAGProcessor::Shutdown() |
216 { |
226 { |
217 TN_DEBUG1( "CThumbAGProcessor::Shutdown()" ); |
227 TN_DEBUG1( "CThumbAGProcessor::Shutdown()" ); |
228 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_SHUTDOWN, "CThumbAGProcessor::Shutdown" ); |
|
218 iShutdown = ETrue; |
229 iShutdown = ETrue; |
219 UpdatePSValues(EFalse, EFalse); |
230 UpdatePSValues(EFalse, EFalse); |
220 } |
231 } |
221 |
232 |
222 // ----------------------------------------------------------------------------- |
233 // ----------------------------------------------------------------------------- |
237 if (aNewItemCount > 0) |
248 if (aNewItemCount > 0) |
238 { |
249 { |
239 if(&aQuery == iQueryPlaceholders) |
250 if(&aQuery == iQueryPlaceholders) |
240 { |
251 { |
241 TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults - iQueryPlaceholders, %d new", aNewItemCount); |
252 TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults - iQueryPlaceholders, %d new", aNewItemCount); |
253 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - iQueryPlaceholders;aNewItemCount=%d", aNewItemCount ); |
|
242 |
254 |
243 for(TInt i = aFirstNewItemIndex; i < iQueryPlaceholders->Count(); i++) |
255 for(TInt i = aFirstNewItemIndex; i < iQueryPlaceholders->Count(); i++) |
244 { |
256 { |
245 const CMdEObject* object = &iQueryPlaceholders->Result(i); |
257 const CMdEObject* object = &iQueryPlaceholders->Result(i); |
246 |
258 |
250 } |
262 } |
251 |
263 |
252 if(!object->Placeholder()) |
264 if(!object->Placeholder()) |
253 { |
265 { |
254 TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults %d not placeholder", object->Id()); |
266 TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults %d not placeholder", object->Id()); |
267 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - not placeholder;object->Id()=%u", object->Id() ); |
|
255 continue; |
268 continue; |
256 } |
269 } |
257 |
270 |
258 // ignore if fails |
271 // ignore if fails |
259 TThumbnailGenerationItem item; |
272 TThumbnailGenerationItem item; |
266 } |
279 } |
267 } |
280 } |
268 else if(&aQuery == iQueryAllItems) |
281 else if(&aQuery == iQueryAllItems) |
269 { |
282 { |
270 TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults - QueryAllItems, %d new", aNewItemCount); |
283 TN_DEBUG2( "CThumbAGProcessor::HandleQueryNewResults - QueryAllItems, %d new", aNewItemCount); |
284 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - QueryAllItems;aNewItemCount=%d", aNewItemCount ); |
|
271 |
285 |
272 for(TInt i = aFirstNewItemIndex; i < iQueryAllItems->Count(); i++) |
286 for(TInt i = aFirstNewItemIndex; i < iQueryAllItems->Count(); i++) |
273 { |
287 { |
274 const CMdEObject* object = &iQueryAllItems->Result(i); |
288 const CMdEObject* object = &iQueryAllItems->Result(i); |
275 |
289 |
292 } |
306 } |
293 } |
307 } |
294 else |
308 else |
295 { |
309 { |
296 TN_DEBUG1( "CThumbAGProcessor::HandleQueryNewResults - error, no new items"); |
310 TN_DEBUG1( "CThumbAGProcessor::HandleQueryNewResults - error, no new items"); |
311 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HANDLEQUERYNEWRESULTS, "CThumbAGProcessor::HandleQueryNewResults - error, no new items" ); |
|
297 } |
312 } |
298 } |
313 } |
299 |
314 |
300 // ----------------------------------------------------------------------------- |
315 // ----------------------------------------------------------------------------- |
301 // CThumbAGProcessor::HandleQueryCompleted() |
316 // CThumbAGProcessor::HandleQueryCompleted() |
302 // ----------------------------------------------------------------------------- |
317 // ----------------------------------------------------------------------------- |
303 // |
318 // |
304 void CThumbAGProcessor::HandleQueryCompleted( CMdEQuery& aQuery, const TInt aError ) |
319 void CThumbAGProcessor::HandleQueryCompleted( CMdEQuery& aQuery, const TInt aError ) |
305 { |
320 { |
306 TN_DEBUG3( "CThumbAGProcessor::HandleQueryCompleted, aError == %d Count== %d", aError, aQuery.Count()); |
321 TN_DEBUG3( "CThumbAGProcessor::HandleQueryCompleted, aError == %d Count== %d", aError, aQuery.Count()); |
322 OstTraceExt2( TRACE_NORMAL, CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted;aError=%d;aQuery.Count()=%d", aError, aQuery.Count() ); |
|
307 |
323 |
308 if(iShutdown) |
324 if(iShutdown) |
309 { |
325 { |
310 return; |
326 return; |
311 } |
327 } |
312 |
328 |
313 if(&aQuery == iQueryPlaceholders) |
329 if(&aQuery == iQueryPlaceholders) |
314 { |
330 { |
315 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - iQueryPlaceholders completed"); |
331 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - iQueryPlaceholders completed"); |
332 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - iQueryPlaceholders completed" ); |
|
316 |
333 |
317 //free query |
334 //free query |
318 delete iQueryPlaceholders; |
335 delete iQueryPlaceholders; |
319 iQueryPlaceholders = NULL; |
336 iQueryPlaceholders = NULL; |
320 |
337 |
325 } |
342 } |
326 } |
343 } |
327 else if(&aQuery == iQueryAllItems) |
344 else if(&aQuery == iQueryAllItems) |
328 { |
345 { |
329 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - QueryAllItems completed"); |
346 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - QueryAllItems completed"); |
347 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - QueryAllItems completed" ); |
|
330 |
348 |
331 #ifdef _DEBUG |
349 #ifdef _DEBUG |
332 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted IN-COUNTERS---------- Amount: %d, Add",iQueryAllItems->Count()); |
350 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted IN-COUNTERS---------- Amount: %d, Add",iQueryAllItems->Count()); |
351 OstTrace1( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted IN-COUNTERS---------- Amount;iQueryAllItems->Count()=%d", iQueryAllItems->Count() ); |
|
333 #endif |
352 #endif |
334 |
353 |
335 //free query |
354 //free query |
336 delete iQueryAllItems; |
355 delete iQueryAllItems; |
337 iQueryAllItems = NULL; |
356 iQueryAllItems = NULL; |
338 } |
357 } |
339 else if(&aQuery == iQuery ) |
358 else if(&aQuery == iQuery ) |
340 { |
359 { |
341 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - Query completed"); |
360 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted - Query completed"); |
361 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - Query completed" ); |
|
342 |
362 |
343 if(iQueryActive) |
363 if(iQueryActive) |
344 { |
364 { |
345 iQueryReady = ETrue; |
365 iQueryReady = ETrue; |
346 iQueryActive = EFalse; |
366 iQueryActive = EFalse; |
352 iProcessingCount = iQuery->Count(); |
372 iProcessingCount = iQuery->Count(); |
353 |
373 |
354 if(iProcessingCount != iQueryQueue.Count() ) |
374 if(iProcessingCount != iQueryQueue.Count() ) |
355 { |
375 { |
356 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() some result items missing"); |
376 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() some result items missing"); |
377 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - some result items missing" ); |
|
357 |
378 |
358 RArray<TItemId> queryQueueDelta; |
379 RArray<TItemId> queryQueueDelta; |
359 |
380 |
360 //search delta items which were queried, but not found |
381 //search delta items which were queried, but not found |
361 for(TInt queryItem =0; queryItem < iQueryQueue.Count();queryItem++) |
382 for(TInt queryItem =0; queryItem < iQueryQueue.Count();queryItem++) |
373 } |
394 } |
374 |
395 |
375 if(!found) |
396 if(!found) |
376 { |
397 { |
377 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() %d missing from query results", iQueryQueue[queryItem] ); |
398 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() %d missing from query results", iQueryQueue[queryItem] ); |
399 OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted;iQueryQueue[queryItem]=%d", iQueryQueue[queryItem] ); |
|
378 |
400 |
379 // ignore if fails |
401 // ignore if fails |
380 queryQueueDelta.InsertInOrder(iQueryQueue[queryItem], CompareId); |
402 queryQueueDelta.InsertInOrder(iQueryQueue[queryItem], CompareId); |
381 } |
403 } |
382 } |
404 } |
383 |
405 |
384 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() missing items found %d", queryQueueDelta.Count()); |
406 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() missing items found %d", queryQueueDelta.Count()); |
407 OstTrace1( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - missing items found;queryQueueDelta.Count()=%d", queryQueueDelta.Count() ); |
|
385 //cleanup from previous queue it item is not found from MDS |
408 //cleanup from previous queue it item is not found from MDS |
386 while(queryQueueDelta.Count()) |
409 while(queryQueueDelta.Count()) |
387 { |
410 { |
388 TThumbnailGenerationItem item; |
411 TThumbnailGenerationItem item; |
389 item.iItemId = queryQueueDelta[0]; |
412 item.iItemId = queryQueueDelta[0]; |
390 TInt itemIndex = iQueryQueue.FindInOrder(item.iItemId, CompareId); |
413 TInt itemIndex = iQueryQueue.FindInOrder(item.iItemId, CompareId); |
391 |
414 |
392 if(itemIndex >= 0) |
415 if(itemIndex >= 0) |
393 { |
416 { |
394 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove %d from iQueryQueue", queryQueueDelta[0]); |
417 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove %d from iQueryQueue", queryQueueDelta[0]); |
418 OstTrace1( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove from iQueryQueue;queryQueueDelta[0]=%d", queryQueueDelta[0] ); |
|
395 iQueryQueue.Remove( itemIndex ); |
419 iQueryQueue.Remove( itemIndex ); |
396 |
420 |
397 //remove from procesing queue |
421 //remove from procesing queue |
398 itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
422 itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
399 |
423 |
401 { |
425 { |
402 |
426 |
403 if( iUnknown ) |
427 if( iUnknown ) |
404 { |
428 { |
405 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() mark %d as EGenerationItemTypeNotFound in iGenerationQueue", queryQueueDelta[0]); |
429 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() mark %d as EGenerationItemTypeNotFound in iGenerationQueue", queryQueueDelta[0]); |
430 OstTrace1( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - mark as EGenerationItemTypeNotFound in iGenerationQueue;queryQueueDelta[0]=%d", queryQueueDelta[0] ); |
|
406 //mark to be removed, cleanup is done below |
431 //mark to be removed, cleanup is done below |
407 iGenerationQueue[itemIndex].iItemType = EGenerationItemTypeNotFound; |
432 iGenerationQueue[itemIndex].iItemType = EGenerationItemTypeNotFound; |
408 } |
433 } |
409 else |
434 else |
410 { |
435 { |
411 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove %d from iGenerationQueue", queryQueueDelta[0]); |
436 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove %d from iGenerationQueue", queryQueueDelta[0]); |
437 OstTrace1( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove from iGenerationQueue;queryQueueDelta[0]=%d", queryQueueDelta[0] ); |
|
412 iGenerationQueue.Remove( itemIndex ); |
438 iGenerationQueue.Remove( itemIndex ); |
413 } |
439 } |
414 } |
440 } |
415 } |
441 } |
416 queryQueueDelta.Remove(0); |
442 queryQueueDelta.Remove(0); |
438 TThumbnailGenerationItem& item = iGenerationQueue[itemIndex]; |
464 TThumbnailGenerationItem& item = iGenerationQueue[itemIndex]; |
439 |
465 |
440 if(iGenerationQueue[itemIndex].iItemType == EGenerationItemTypeNotFound) |
466 if(iGenerationQueue[itemIndex].iItemType == EGenerationItemTypeNotFound) |
441 { |
467 { |
442 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove EGenerationItemTypeNotFound %d item from iGenerationQueue", item.iItemId); |
468 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove EGenerationItemTypeNotFound %d item from iGenerationQueue", item.iItemId); |
469 OstTrace1( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove EGenerationItemTypeNotFound item from iGenerationQueue;item.iItemId=%u", item.iItemId ); |
|
443 iGenerationQueue.Remove(itemIndex); |
470 iGenerationQueue.Remove(itemIndex); |
444 continue; |
471 continue; |
445 } |
472 } |
446 |
473 |
447 SetGenerationItemType(item, object->Def().Id()); |
474 SetGenerationItemType(item, object->Def().Id()); |
448 |
475 |
449 if(item.iItemType == EGenerationItemTypeUnknown ) |
476 if(item.iItemType == EGenerationItemTypeUnknown ) |
450 { |
477 { |
451 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove unknown item %d", item.iItemId); |
478 TN_DEBUG2( "CThumbAGProcessor::HandleQueryCompleted() remove unknown item %d", item.iItemId); |
479 OstTrace1( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - remove unknown item;item.iItemId=%u", item.iItemId ); |
|
452 iGenerationQueue.Remove(itemIndex); |
480 iGenerationQueue.Remove(itemIndex); |
453 continue; |
481 continue; |
454 } |
482 } |
455 |
483 |
456 item.iPlaceholder = object->Placeholder(); |
484 item.iPlaceholder = object->Placeholder(); |
474 else |
502 else |
475 { |
503 { |
476 //Delete and cancel query, do not return items back to original queue |
504 //Delete and cancel query, do not return items back to original queue |
477 DeleteAndCancelQuery( EFalse ); |
505 DeleteAndCancelQuery( EFalse ); |
478 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() Query FAILED!"); |
506 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() Query FAILED!"); |
507 OstTrace0( TRACE_NORMAL, DUP13_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - Query FAILED!" ); |
|
479 } |
508 } |
480 } |
509 } |
481 else |
510 else |
482 { |
511 { |
483 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() - NO QUERY ACTIVE"); |
512 TN_DEBUG1( "CThumbAGProcessor::HandleQueryCompleted() - NO QUERY ACTIVE"); |
513 OstTrace0( TRACE_NORMAL, DUP14_CTHUMBAGPROCESSOR_HANDLEQUERYCOMPLETED, "CThumbAGProcessor::HandleQueryCompleted - NO QUERY ACTIVE" ); |
|
484 __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbAGProcessor::HandleQueryCompleted()"), -1)); |
514 __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbAGProcessor::HandleQueryCompleted()"), -1)); |
485 } |
515 } |
486 |
516 |
487 ActivateAO(); |
517 ActivateAO(); |
488 } |
518 } |
493 // |
523 // |
494 void CThumbAGProcessor::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/, |
524 void CThumbAGProcessor::ThumbnailPreviewReady( MThumbnailData& /*aThumbnail*/, |
495 TThumbnailRequestId /*aId*/) |
525 TThumbnailRequestId /*aId*/) |
496 { |
526 { |
497 TN_DEBUG1( "CThumbAGProcessor::ThumbnailPreviewReady()"); |
527 TN_DEBUG1( "CThumbAGProcessor::ThumbnailPreviewReady()"); |
528 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_THUMBNAILPREVIEWREADY, "CThumbAGProcessor::ThumbnailPreviewReady" ); |
|
498 // No implementation required |
529 // No implementation required |
499 } |
530 } |
500 |
531 |
501 // ----------------------------------------------------------------------------- |
532 // ----------------------------------------------------------------------------- |
502 // CThumbAGProcessor::ThumbnailReady()d |
533 // CThumbAGProcessor::ThumbnailReady()d |
504 // |
535 // |
505 void CThumbAGProcessor::ThumbnailReady( TInt aError, MThumbnailData& /*aThumbnail*/, |
536 void CThumbAGProcessor::ThumbnailReady( TInt aError, MThumbnailData& /*aThumbnail*/, |
506 TThumbnailRequestId /*aId*/ ) |
537 TThumbnailRequestId /*aId*/ ) |
507 { |
538 { |
508 TN_DEBUG2( "CThumbAGProcessor::ThumbnailReady() aError == %d", aError ); |
539 TN_DEBUG2( "CThumbAGProcessor::ThumbnailReady() aError == %d", aError ); |
540 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady;aError=%d", aError ); |
|
509 |
541 |
510 iActiveCount--; |
542 iActiveCount--; |
511 |
543 |
512 // TNM server died, delete session |
544 // TNM server died, delete session |
513 if( aError == KErrServerTerminated ) |
545 if( aError == KErrServerTerminated ) |
514 { |
546 { |
515 TN_DEBUG1( "CThumbAGProcessor::ThumbnailReady() - **** THUMBNAIL SERVER DIED ****" ); |
547 TN_DEBUG1( "CThumbAGProcessor::ThumbnailReady() - **** THUMBNAIL SERVER DIED ****" ); |
548 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady - **** THUMBNAIL SERVER DIED ****" ); |
|
516 |
549 |
517 iSessionDied = ETrue; |
550 iSessionDied = ETrue; |
518 |
551 |
519 if( !iPeriodicTimer->IsActive()) |
552 if( !iPeriodicTimer->IsActive()) |
520 { |
553 { |
522 } |
555 } |
523 |
556 |
524 //reset PS idle so that RunL() can startup reopen TNM session and proceed |
557 //reset PS idle so that RunL() can startup reopen TNM session and proceed |
525 TInt ret = RProperty::Set(KServerIdle, KIdle, ETrue); |
558 TInt ret = RProperty::Set(KServerIdle, KIdle, ETrue); |
526 TN_DEBUG2( "CThumbAGProcessor::ThumbnailReady() set Idle ret = %d", ret ); |
559 TN_DEBUG2( "CThumbAGProcessor::ThumbnailReady() set Idle ret = %d", ret ); |
527 |
560 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady - set Idle ret;ret=%d", ret ); |
528 return; |
561 return; |
529 } |
562 } |
530 |
563 |
531 ActivateAO(); |
564 ActivateAO(); |
532 |
565 |
533 TN_DEBUG1( "CThumbAGProcessor::ThumbnailReady() - end" ); |
566 TN_DEBUG1( "CThumbAGProcessor::ThumbnailReady() - end" ); |
567 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_THUMBNAILREADY, "CThumbAGProcessor::ThumbnailReady - end" ); |
|
534 } |
568 } |
535 |
569 |
536 // ----------------------------------------------------------------------------- |
570 // ----------------------------------------------------------------------------- |
537 // CThumbAGProcessor::ThumbnailRequestReady() |
571 // CThumbAGProcessor::ThumbnailRequestReady() |
538 // ----------------------------------------------------------------------------- |
572 // ----------------------------------------------------------------------------- |
541 TThumbnailRequestId /*aId*/ ) |
575 TThumbnailRequestId /*aId*/ ) |
542 { |
576 { |
543 if (aRequestType == ERequestDeleteThumbnails) |
577 if (aRequestType == ERequestDeleteThumbnails) |
544 { |
578 { |
545 TN_DEBUG1( "CThumbAGProcessor::ThumbnailRequestReady() - delete" ); |
579 TN_DEBUG1( "CThumbAGProcessor::ThumbnailRequestReady() - delete" ); |
580 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_THUMBNAILREQUESTREADY, "CThumbAGProcessor::ThumbnailRequestReady - delete" ); |
|
546 |
581 |
547 iActiveCount--; |
582 iActiveCount--; |
548 |
583 |
549 ActivateAO(); |
584 ActivateAO(); |
550 } |
585 } |
555 // --------------------------------------------------------------------------- |
590 // --------------------------------------------------------------------------- |
556 // |
591 // |
557 void CThumbAGProcessor::SetMdESessionL( CMdESession* aMdESession ) |
592 void CThumbAGProcessor::SetMdESessionL( CMdESession* aMdESession ) |
558 { |
593 { |
559 TN_DEBUG1( "CThumbAGProcessor::SetMdESession() - begin" ); |
594 TN_DEBUG1( "CThumbAGProcessor::SetMdESession() - begin" ); |
595 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_SETMDESESSIONL, "CThumbAGProcessor::SetMdESessionL - begin" ); |
|
560 |
596 |
561 iMdESession = aMdESession; |
597 iMdESession = aMdESession; |
562 |
598 |
563 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::SetMdESession() !iMdESession "), KErrBadHandle)); |
599 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::SetMdESession() !iMdESession "), KErrBadHandle)); |
564 |
600 |
565 TRAPD( err, iDefNamespace = &iMdESession->GetDefaultNamespaceDefL() ); |
601 TRAPD( err, iDefNamespace = &iMdESession->GetDefaultNamespaceDefL() ); |
566 if (err != KErrNone) |
602 if (err != KErrNone) |
567 { |
603 { |
568 TN_DEBUG2( "CThumbAGProcessor::SetMdESession() GetDefaultNamespaceDefL() err = %d", err ); |
604 TN_DEBUG2( "CThumbAGProcessor::SetMdESession() GetDefaultNamespaceDefL() err = %d", err ); |
605 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_SETMDESESSIONL, "CThumbAGProcessor::SetMdESessionL;err=%d", err ); |
|
569 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::SetMdESession() !iDefNamespace "), KErrBadHandle)); |
606 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::SetMdESession() !iDefNamespace "), KErrBadHandle)); |
570 } |
607 } |
571 else |
608 else |
572 { |
609 { |
573 iImageObjectDef = &iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject ); |
610 iImageObjectDef = &iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject ); |
593 const RArray<TItemId>& aIDArray, |
630 const RArray<TItemId>& aIDArray, |
594 const RPointerArray<HBufC>& aObjectUriArray, |
631 const RPointerArray<HBufC>& aObjectUriArray, |
595 TBool /*aPresent*/ ) |
632 TBool /*aPresent*/ ) |
596 { |
633 { |
597 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - begin" ); |
634 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - begin" ); |
598 |
635 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - begin" ); |
599 |
636 |
600 // update queues |
637 // update queues |
601 if (aType == ENotifyAdd) |
638 if (aType == ENotifyAdd) |
602 { |
639 { |
603 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyAdd" ); |
640 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyAdd" ); |
619 } |
656 } |
620 } |
657 } |
621 else if (aType == ENotifyModify) |
658 else if (aType == ENotifyModify) |
622 { |
659 { |
623 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyModify" ); |
660 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyModify" ); |
661 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - ENotifyModify" ); |
|
624 |
662 |
625 if(iPHHarvesting) |
663 if(iPHHarvesting) |
626 { |
664 { |
627 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - PH harvesting active, treat like add" ); |
665 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - PH harvesting active, treat like add" ); |
666 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - PH harvesting active, treat like add" ); |
|
628 for (int i=0; i<aIDArray.Count(); i++) |
667 for (int i=0; i<aIDArray.Count(); i++) |
629 { |
668 { |
630 TThumbnailGenerationItem item; |
669 TThumbnailGenerationItem item; |
631 item.iItemId = aIDArray[i]; |
670 item.iItemId = aIDArray[i]; |
632 item.iItemType = aItemType; |
671 item.iItemType = aItemType; |
634 TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
673 TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
635 |
674 |
636 if (itemIndex >= 0) |
675 if (itemIndex >= 0) |
637 { |
676 { |
638 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - set as non-placeholder"); |
677 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - set as non-placeholder"); |
678 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - set as non-placeholder" ); |
|
639 iGenerationQueue[itemIndex].iPlaceholder = EFalse; |
679 iGenerationQueue[itemIndex].iPlaceholder = EFalse; |
640 } |
680 } |
641 else |
681 else |
642 { |
682 { |
643 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append"); |
683 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append"); |
644 |
684 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - append" ); |
645 item.iPlaceholder = EFalse; |
685 item.iPlaceholder = EFalse; |
646 SetGenerationItemAction( item, aItemType ); |
686 SetGenerationItemAction( item, aItemType ); |
647 AppendProcessingQueue( item ); |
687 AppendProcessingQueue( item ); |
648 } |
688 } |
649 } |
689 } |
650 } |
690 } |
651 else |
691 else |
652 { |
692 { |
653 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - PH harvesting finished, check is real modify!" ); |
693 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - PH harvesting finished, check is real modify!" ); |
694 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - PH harvesting finished, check is real modify!" ); |
|
654 |
695 |
655 TInt itemIndex(KErrNotFound); |
696 TInt itemIndex(KErrNotFound); |
656 |
697 |
657 for (int i=0; i<aIDArray.Count(); i++) |
698 for (int i=0; i<aIDArray.Count(); i++) |
658 { |
699 { |
665 if (itemIndex >= 0) |
706 if (itemIndex >= 0) |
666 { |
707 { |
667 if( iGenerationQueue[itemIndex].iPlaceholder ) |
708 if( iGenerationQueue[itemIndex].iPlaceholder ) |
668 { |
709 { |
669 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - placeholder modify"); |
710 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - placeholder modify"); |
711 OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - placeholder modify" ); |
|
670 iGenerationQueue[itemIndex].iPlaceholder = EFalse; |
712 iGenerationQueue[itemIndex].iPlaceholder = EFalse; |
671 } |
713 } |
672 else |
714 else |
673 { |
715 { |
674 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - real modify"); |
716 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - real modify"); |
717 OstTrace0( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - real modify" ); |
|
675 iGenerationQueue[itemIndex].iItemAction = EGenerationItemActionModify; |
718 iGenerationQueue[itemIndex].iItemAction = EGenerationItemActionModify; |
676 SetForceRun( ETrue ); |
719 SetForceRun( ETrue ); |
677 } |
720 } |
678 } |
721 } |
679 else |
722 else |
680 { |
723 { |
681 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append"); |
724 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append"); |
725 OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - append" ); |
|
682 SetGenerationItemAction( item, aItemType); |
726 SetGenerationItemAction( item, aItemType); |
683 item.iPlaceholder = EFalse; |
727 item.iPlaceholder = EFalse; |
684 AppendProcessingQueue( item ); |
728 AppendProcessingQueue( item ); |
685 } |
729 } |
686 } |
730 } |
687 } |
731 } |
688 } |
732 } |
689 else if (aType == ENotifyRemove && aItemType == EGenerationItemTypeAny) |
733 else if (aType == ENotifyRemove && aItemType == EGenerationItemTypeAny) |
690 { |
734 { |
691 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyRemove, remove IDs from all queues"); |
735 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - ENotifyRemove, remove IDs from all queues"); |
736 OstTrace0( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - ENotifyRemove, remove IDs from all queues" ); |
|
692 |
737 |
693 for (int i=0; i<aIDArray.Count(); i++) |
738 for (int i=0; i<aIDArray.Count(); i++) |
694 { |
739 { |
695 TThumbnailGenerationItem item; |
740 TThumbnailGenerationItem item; |
696 item.iItemId = aIDArray[i]; |
741 item.iItemId = aIDArray[i]; |
715 } |
760 } |
716 } |
761 } |
717 else |
762 else |
718 { |
763 { |
719 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append"); |
764 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - append"); |
765 OstTrace0( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - append" ); |
|
720 item.iItemAction = EGenerationItemActionDelete; |
766 item.iItemAction = EGenerationItemActionDelete; |
721 delete item.iUri; |
767 delete item.iUri; |
722 item.iUri = NULL; |
768 item.iUri = NULL; |
723 |
769 |
724 if( aObjectUriArray[i]) |
770 if( aObjectUriArray[i]) |
732 //owned by item |
778 //owned by item |
733 item.iUri = NULL; |
779 item.iUri = NULL; |
734 } |
780 } |
735 |
781 |
736 TN_DEBUG2( "CThumbAGProcessor::AddToQueueL() - %S", aObjectUriArray[i]); |
782 TN_DEBUG2( "CThumbAGProcessor::AddToQueueL() - %S", aObjectUriArray[i]); |
783 OstTraceExt1( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL;aObjectUriArray[i]=%S", *aObjectUriArray[i] ); |
|
737 } |
784 } |
738 } |
785 } |
739 #ifdef _DEBUG |
786 #ifdef _DEBUG |
740 else |
787 else |
741 { |
788 { |
742 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - should not come here" ); |
789 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - should not come here" ); |
790 OstTrace0( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - should not come here" ); |
|
743 __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbAGProcessor::AddToQueueL()"), KErrArgument)); |
791 __ASSERT_DEBUG((EFalse), User::Panic(_L("CThumbAGProcessor::AddToQueueL()"), KErrArgument)); |
744 User::Leave( KErrArgument ); |
792 User::Leave( KErrArgument ); |
745 } |
793 } |
746 #endif |
794 #endif |
747 |
795 |
748 ActivateAO(); |
796 ActivateAO(); |
749 |
797 |
750 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - end" ); |
798 TN_DEBUG1( "CThumbAGProcessor::AddToQueueL() - end" ); |
799 OstTrace0( TRACE_NORMAL, DUP13_CTHUMBAGPROCESSOR_ADDTOQUEUEL, "CThumbAGProcessor::AddToQueueL - end" ); |
|
751 } |
800 } |
752 |
801 |
753 // --------------------------------------------------------------------------- |
802 // --------------------------------------------------------------------------- |
754 // CThumbAGProcessor::CreateThumbnailsL() |
803 // CThumbAGProcessor::CreateThumbnailsL() |
755 // --------------------------------------------------------------------------- |
804 // --------------------------------------------------------------------------- |
756 // |
805 // |
757 void CThumbAGProcessor::CreateThumbnailsL( const CMdEObject* aObject ) |
806 void CThumbAGProcessor::CreateThumbnailsL( const CMdEObject* aObject ) |
758 { |
807 { |
759 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() - begin" ); |
808 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() - begin" ); |
809 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - begin" ); |
|
760 |
810 |
761 __ASSERT_DEBUG((iTMSession), User::Panic(_L("CThumbAGProcessor::CreateThumbnailsL() !iTMSession "), KErrBadHandle)); |
811 __ASSERT_DEBUG((iTMSession), User::Panic(_L("CThumbAGProcessor::CreateThumbnailsL() !iTMSession "), KErrBadHandle)); |
762 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::CreateThumbnailsL() !iDefNamespace "), KErrBadHandle)); |
812 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::CreateThumbnailsL() !iDefNamespace "), KErrBadHandle)); |
763 |
813 |
764 if(!iTMSession || !iDefNamespace) |
814 if(!iTMSession || !iDefNamespace) |
793 // 2nd round and modify updates both sizes if needed |
843 // 2nd round and modify updates both sizes if needed |
794 if( i2ndRound ) |
844 if( i2ndRound ) |
795 { |
845 { |
796 //generate both if needed |
846 //generate both if needed |
797 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() EOptimizeForQuality "); |
847 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() EOptimizeForQuality "); |
848 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - EOptimizeForQuality" ); |
|
798 iTMSession->SetQualityPreferenceL( CThumbnailManager::EOptimizeForQuality ); |
849 iTMSession->SetQualityPreferenceL( CThumbnailManager::EOptimizeForQuality ); |
799 |
850 |
800 TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL() - 2nd round add remove from queue", aObject->Id() ); |
851 TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL() - 2nd round add remove from queue", aObject->Id() ); |
852 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - 2nd round add remove from queue;aObject->Id()=%u", aObject->Id() ); |
|
801 |
853 |
802 TThumbnailGenerationItem item; |
854 TThumbnailGenerationItem item; |
803 item.iItemId = aObject->Id(); |
855 item.iItemId = aObject->Id(); |
804 TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
856 TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
805 |
857 |
814 // 1st roung generation |
866 // 1st roung generation |
815 else |
867 else |
816 { |
868 { |
817 //1st round |
869 //1st round |
818 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() EOptimizeForQualityWithPreview"); |
870 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() EOptimizeForQualityWithPreview"); |
871 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - EOptimizeForQualityWithPreview" ); |
|
819 iTMSession->SetQualityPreferenceL( CThumbnailManager::EOptimizeForQualityWithPreview ); |
872 iTMSession->SetQualityPreferenceL( CThumbnailManager::EOptimizeForQualityWithPreview ); |
820 |
873 |
821 // add item to 2nd round queue |
874 // add item to 2nd round queue |
822 TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL() - 1st round add/modify, append to 2nd round queue", aObject->Id() ); |
875 TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL() - 1st round add/modify, append to 2nd round queue", aObject->Id() ); |
876 OstTrace1( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - 1st round add/modify, append to 2nd round queue;aObject->Id()=%u", aObject->Id() ); |
|
823 |
877 |
824 TThumbnailGenerationItem item; |
878 TThumbnailGenerationItem item; |
825 item.iItemId = aObject->Id(); |
879 item.iItemId = aObject->Id(); |
826 TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
880 TInt itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
827 |
881 |
848 TRAPD(err, iTMSession->UpdateThumbnailsL(KNoId, aObject->Uri(), orientationVal, modifiedVal, CActive::EPriorityIdle )); |
902 TRAPD(err, iTMSession->UpdateThumbnailsL(KNoId, aObject->Uri(), orientationVal, modifiedVal, CActive::EPriorityIdle )); |
849 |
903 |
850 if ( err != KErrNone ) |
904 if ( err != KErrNone ) |
851 { |
905 { |
852 TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL, iTMSession error == %d", err ); |
906 TN_DEBUG2( "CThumbAGProcessor::CreateThumbnailsL, iTMSession error == %d", err ); |
907 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL" ); |
|
853 |
908 |
854 iSessionDied = ETrue; |
909 iSessionDied = ETrue; |
855 ActivateAO(); |
910 ActivateAO(); |
856 } |
911 } |
857 else |
912 else |
863 { |
918 { |
864 ActivateAO(); |
919 ActivateAO(); |
865 } |
920 } |
866 |
921 |
867 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() - end" ); |
922 TN_DEBUG1( "CThumbAGProcessor::CreateThumbnailsL() - end" ); |
923 OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_CREATETHUMBNAILSL, "CThumbAGProcessor::CreateThumbnailsL - end" ); |
|
868 } |
924 } |
869 |
925 |
870 // --------------------------------------------------------------------------- |
926 // --------------------------------------------------------------------------- |
871 // CThumbAGProcessor::QueryL() |
927 // CThumbAGProcessor::QueryL() |
872 // --------------------------------------------------------------------------- |
928 // --------------------------------------------------------------------------- |
873 // |
929 // |
874 void CThumbAGProcessor::QueryL(/*RArray<TItemId>& aIDArray*/TThumbnailGenerationItemAction aAction ) |
930 void CThumbAGProcessor::QueryL(/*RArray<TItemId>& aIDArray*/TThumbnailGenerationItemAction aAction ) |
875 { |
931 { |
876 TN_DEBUG1( "CThumbAGProcessor::QueryL() - begin" ); |
932 TN_DEBUG1( "CThumbAGProcessor::QueryL() - begin" ); |
933 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - begin" ); |
|
877 |
934 |
878 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryL() !iMdeSession "), KErrBadHandle)); |
935 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryL() !iMdeSession "), KErrBadHandle)); |
879 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::QueryL() !iDefNamespace "), KErrBadHandle)); |
936 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::QueryL() !iDefNamespace "), KErrBadHandle)); |
880 |
937 |
881 if(!iMdESession || !iDefNamespace || iShutdown) |
938 if(!iMdESession || !iDefNamespace || iShutdown) |
898 |
955 |
899 //move ID from source queue to Query queue |
956 //move ID from source queue to Query queue |
900 TInt maxCount = iGenerationQueue.Count(); |
957 TInt maxCount = iGenerationQueue.Count(); |
901 |
958 |
902 TN_DEBUG3( "CThumbAGProcessor::QueryL() - fill begin iGenerationQueue == %d, iQueryQueue == %d", iGenerationQueue.Count(), iQueryQueue.Count() ); |
959 TN_DEBUG3( "CThumbAGProcessor::QueryL() - fill begin iGenerationQueue == %d, iQueryQueue == %d", iGenerationQueue.Count(), iQueryQueue.Count() ); |
903 |
960 OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - - fill begin iGenerationQueue, iQueryQueue;iGenerationQueue.Count()=%d;iQueryQueue.Count()=%d", iGenerationQueue.Count(), iQueryQueue.Count() ); |
904 |
961 |
905 TInt itemCount(0); |
962 TInt itemCount(0); |
906 for(TInt i=0; itemCount < KMaxQueryItems && i < maxCount; i++) |
963 for(TInt i=0; itemCount < KMaxQueryItems && i < maxCount; i++) |
907 { |
964 { |
908 TInt itemIndex(KErrNotFound); |
965 TInt itemIndex(KErrNotFound); |
939 }; |
996 }; |
940 |
997 |
941 if( itemIndex >= 0 ) |
998 if( itemIndex >= 0 ) |
942 { |
999 { |
943 TN_DEBUG2( "CThumbAGProcessor::QueryL() - fill %d", iGenerationQueue[itemIndex].iItemId ); |
1000 TN_DEBUG2( "CThumbAGProcessor::QueryL() - fill %d", iGenerationQueue[itemIndex].iItemId ); |
1001 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - fill;iGenerationQueue[itemIndex].iItemId=%u", iGenerationQueue[itemIndex].iItemId ); |
|
944 iQueryQueue.InsertInOrder(iGenerationQueue[itemIndex].iItemId, CompareId); |
1002 iQueryQueue.InsertInOrder(iGenerationQueue[itemIndex].iItemId, CompareId); |
945 itemCount++; |
1003 itemCount++; |
946 } |
1004 } |
947 } |
1005 } |
948 |
1006 |
949 if(!itemCount) |
1007 if(!itemCount) |
950 { |
1008 { |
951 TN_DEBUG1( "CThumbAGProcessor::QueryL() - empty query, cancel?!"); |
1009 TN_DEBUG1( "CThumbAGProcessor::QueryL() - empty query, cancel?!"); |
1010 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - empty query, cancel?!" ); |
|
952 iQueryActive = EFalse; |
1011 iQueryActive = EFalse; |
953 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryL() empty! "), KErrNotFound)); |
1012 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryL() empty! "), KErrNotFound)); |
954 return; |
1013 return; |
955 } |
1014 } |
956 |
1015 |
957 TN_DEBUG3( "CThumbAGProcessor::QueryL() - fill end iGenerationQueue == %d, iQueryQueue == %d", iGenerationQueue.Count(), iQueryQueue.Count() ); |
1016 TN_DEBUG3( "CThumbAGProcessor::QueryL() - fill end iGenerationQueue == %d, iQueryQueue == %d", iGenerationQueue.Count(), iQueryQueue.Count() ); |
1017 OstTraceExt2( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL;iGenerationQueue.Count()=%d;iQueryQueue.Count()=%d", iGenerationQueue.Count(), iQueryQueue.Count() ); |
|
958 |
1018 |
959 CMdEObjectDef& objDef = iDefNamespace->GetObjectDefL( MdeConstants::Object::KBaseObject ); |
1019 CMdEObjectDef& objDef = iDefNamespace->GetObjectDefL( MdeConstants::Object::KBaseObject ); |
960 iQuery = iMdESession->NewObjectQueryL( *iDefNamespace, objDef, this ); |
1020 iQuery = iMdESession->NewObjectQueryL( *iDefNamespace, objDef, this ); |
961 |
1021 |
962 if(iQuery) |
1022 if(iQuery) |
993 } |
1053 } |
994 } |
1054 } |
995 |
1055 |
996 iQuery->FindL(); |
1056 iQuery->FindL(); |
997 } |
1057 } |
1058 else |
|
1059 { |
|
1060 iQueryActive = EFalse; |
|
1061 } |
|
998 |
1062 |
999 TN_DEBUG1( "CThumbAGProcessor::QueryL() - end" ); |
1063 TN_DEBUG1( "CThumbAGProcessor::QueryL() - end" ); |
1064 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_QUERYL, "CThumbAGProcessor::QueryL - end" ); |
|
1000 } |
1065 } |
1001 |
1066 |
1002 |
1067 |
1003 // --------------------------------------------------------------------------- |
1068 // --------------------------------------------------------------------------- |
1004 // CThumbAGProcessor::QueryForPlaceholders() |
1069 // CThumbAGProcessor::QueryForPlaceholders() |
1006 // |
1071 // |
1007 |
1072 |
1008 void CThumbAGProcessor::QueryPlaceholdersL(TBool aPresent) |
1073 void CThumbAGProcessor::QueryPlaceholdersL(TBool aPresent) |
1009 { |
1074 { |
1010 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL" ); |
1075 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL" ); |
1076 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL" ); |
|
1011 |
1077 |
1012 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryPlaceholdersL() !iMdeSession "), KErrBadHandle)); |
1078 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryPlaceholdersL() !iMdeSession "), KErrBadHandle)); |
1013 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::QueryPlaceholdersL() !iDefNamespace "), KErrBadHandle)); |
1079 __ASSERT_DEBUG((iDefNamespace), User::Panic(_L("CThumbAGProcessor::QueryPlaceholdersL() !iDefNamespace "), KErrBadHandle)); |
1014 |
1080 |
1015 if(!iMdESession || !iDefNamespace || iShutdown) |
1081 if(!iMdESession || !iDefNamespace || iShutdown) |
1020 if( iQueryPlaceholders ) |
1086 if( iQueryPlaceholders ) |
1021 { |
1087 { |
1022 if( !iQueryPlaceholders->IsComplete() ) |
1088 if( !iQueryPlaceholders->IsComplete() ) |
1023 { |
1089 { |
1024 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL active- skip" ); |
1090 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL active- skip" ); |
1091 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL - skip" ); |
|
1025 return; |
1092 return; |
1026 } |
1093 } |
1027 |
1094 |
1028 // delete old query |
1095 // delete old query |
1029 iQueryPlaceholders->Cancel(); |
1096 iQueryPlaceholders->Cancel(); |
1030 delete iQueryPlaceholders; |
1097 delete iQueryPlaceholders; |
1031 iQueryPlaceholders = NULL; |
1098 iQueryPlaceholders = NULL; |
1032 } |
1099 } |
1033 |
1100 |
1034 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL - start" ); |
1101 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL - start" ); |
1102 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL - start" ); |
|
1035 |
1103 |
1036 CMdEObjectDef& imageObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject ); |
1104 CMdEObjectDef& imageObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject ); |
1037 CMdEObjectDef& videoObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Video::KVideoObject ); |
1105 CMdEObjectDef& videoObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Video::KVideoObject ); |
1038 CMdEObjectDef& audioObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Audio::KAudioObject ); |
1106 CMdEObjectDef& audioObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Audio::KAudioObject ); |
1039 |
1107 |
1060 CMdEObjectCondition& audioPHObjectCondition = rootCondition.AddObjectConditionL(audioObjDef); |
1128 CMdEObjectCondition& audioPHObjectCondition = rootCondition.AddObjectConditionL(audioObjDef); |
1061 CleanupStack::PushL( &audioPHObjectCondition ); |
1129 CleanupStack::PushL( &audioPHObjectCondition ); |
1062 audioPHObjectCondition.SetPlaceholderOnly( ETrue ); |
1130 audioPHObjectCondition.SetPlaceholderOnly( ETrue ); |
1063 audioPHObjectCondition.SetNotPresent( aPresent ); |
1131 audioPHObjectCondition.SetNotPresent( aPresent ); |
1064 |
1132 |
1065 iQueryPlaceholders->FindL(KMaxTInt, KMaxQueryBatchSize); |
1133 iQueryPlaceholders->FindL(KMdEQueryDefaultMaxCount, KMaxQueryBatchSize); |
1066 |
1134 |
1067 CleanupStack::Pop(3, &imagePHObjectCondition ); |
1135 CleanupStack::Pop(3, &imagePHObjectCondition ); |
1068 } |
1136 } |
1069 |
1137 |
1070 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL - end" ); |
1138 TN_DEBUG1( "CThumbAGProcessor::QueryPlaceholdersL - end" ); |
1139 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_QUERYPLACEHOLDERSL, "CThumbAGProcessor::QueryPlaceholdersL - end" ); |
|
1071 } |
1140 } |
1072 |
1141 |
1073 |
1142 |
1074 // --------------------------------------------------------------------------- |
1143 // --------------------------------------------------------------------------- |
1075 // CThumbAGProcessor::RunL() |
1144 // CThumbAGProcessor::RunL() |
1076 // --------------------------------------------------------------------------- |
1145 // --------------------------------------------------------------------------- |
1077 // |
1146 // |
1078 void CThumbAGProcessor::RunL() |
1147 void CThumbAGProcessor::RunL() |
1079 { |
1148 { |
1080 TN_DEBUG1( "CThumbAGProcessor::RunL() - begin" ); |
1149 TN_DEBUG1( "CThumbAGProcessor::RunL() - begin" ); |
1150 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - begin" ); |
|
1081 |
1151 |
1082 if(iShutdown) |
1152 if(iShutdown) |
1083 { |
1153 { |
1084 TN_DEBUG1( "CThumbAGProcessor::RunL() - shutdown" ); |
1154 TN_DEBUG1( "CThumbAGProcessor::RunL() - shutdown" ); |
1155 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - shutdown" ); |
|
1085 return; |
1156 return; |
1086 } |
1157 } |
1087 |
1158 |
1088 if (iSessionDied) |
1159 if (iSessionDied) |
1089 { |
1160 { |
1090 TN_DEBUG1( "CThumbAGProcessor::RunL() - iSessionDied" ); |
1161 TN_DEBUG1( "CThumbAGProcessor::RunL() - iSessionDied" ); |
1162 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iSessionDied" ); |
|
1091 delete iTMSession; |
1163 delete iTMSession; |
1092 iTMSession = NULL; |
1164 iTMSession = NULL; |
1093 } |
1165 } |
1094 |
1166 |
1095 if (iInit) |
1167 if (iInit) |
1096 { |
1168 { |
1097 TN_DEBUG1( "CThumbAGProcessor::RunL() - Do Initialisation 1" ); |
1169 TN_DEBUG1( "CThumbAGProcessor::RunL() - Do Initialisation 1" ); |
1170 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Do Initialisation 1" ); |
|
1098 |
1171 |
1099 iInit = EFalse; |
1172 iInit = EFalse; |
1100 iInit2 = ETrue; |
1173 iInit2 = ETrue; |
1101 |
1174 |
1102 iGenerationQueue.Reset(); |
1175 iGenerationQueue.Reset(); |
1105 //query all not present placeholders |
1178 //query all not present placeholders |
1106 TRAP_IGNORE(QueryPlaceholdersL( ETrue )); |
1179 TRAP_IGNORE(QueryPlaceholdersL( ETrue )); |
1107 //query all items after PH query |
1180 //query all items after PH query |
1108 iDoQueryAllItems = ETrue; |
1181 iDoQueryAllItems = ETrue; |
1109 TN_DEBUG1( "CThumbAGProcessor::RunL() - Initialisation 1 done" ); |
1182 TN_DEBUG1( "CThumbAGProcessor::RunL() - Initialisation 1 done" ); |
1183 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Initialisation 1 done" ); |
|
1110 ActivateAO(); |
1184 ActivateAO(); |
1111 return; |
1185 return; |
1112 } |
1186 } |
1113 |
1187 |
1114 if(iInit2) |
1188 if(iInit2) |
1115 { |
1189 { |
1116 TN_DEBUG1( "CThumbAGProcessor::RunL() - Do Initialisation 2" ); |
1190 TN_DEBUG1( "CThumbAGProcessor::RunL() - Do Initialisation 2" ); |
1191 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Do Initialisation 2" ); |
|
1117 |
1192 |
1118 iInit2 = EFalse; |
1193 iInit2 = EFalse; |
1119 TInt err(KErrNone); |
1194 TInt err(KErrNone); |
1120 |
1195 |
1121 #ifdef MDS_MODIFY_OBSERVER |
1196 #ifdef MDS_MODIFY_OBSERVER |
1122 TN_DEBUG1( "CThumbAGProcessor::RunL() do iHarvesterClient connect"); |
1197 TN_DEBUG1( "CThumbAGProcessor::RunL() do iHarvesterClient connect"); |
1198 OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - do iHarvesterClient connect" ); |
|
1123 err = iHarvesterClient.Connect(); |
1199 err = iHarvesterClient.Connect(); |
1124 TN_DEBUG2( "CThumbAGProcessor::RunL() iHarvesterClient connect err = %d", err); |
1200 TN_DEBUG2( "CThumbAGProcessor::RunL() iHarvesterClient connect err = %d", err); |
1201 OstTrace1( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iHarvesterClient connect;err=%d", err ); |
|
1125 |
1202 |
1126 __ASSERT_DEBUG((err == KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), !iHarvesterClient "), err)); |
1203 __ASSERT_DEBUG((err == KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), !iHarvesterClient "), err)); |
1127 |
1204 |
1128 if( err == KErrNone ) |
1205 if( err == KErrNone ) |
1129 { |
1206 { |
1130 TN_DEBUG1( "CThumbAGProcessor::RunL() add iHarvesterClient observer"); |
1207 TN_DEBUG1( "CThumbAGProcessor::RunL() add iHarvesterClient observer"); |
1208 OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - add iHarvesterClient observer" ); |
|
1131 err = iHarvesterClient.AddHarvesterEventObserver( *this, EHEObserverTypeOverall | EHEObserverTypeMMC | EHEObserverTypePlaceholder, 20 ); |
1209 err = iHarvesterClient.AddHarvesterEventObserver( *this, EHEObserverTypeOverall | EHEObserverTypeMMC | EHEObserverTypePlaceholder, 20 ); |
1132 TN_DEBUG2( "CThumbAGProcessor::RunL() iHarvesterClient observer err = %d", err); |
1210 TN_DEBUG2( "CThumbAGProcessor::RunL() iHarvesterClient observer err = %d", err); |
1211 OstTrace1( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iHarvesterClient observer;err=%d", err ); |
|
1133 |
1212 |
1134 if( !err ) |
1213 if( !err ) |
1135 { |
1214 { |
1136 TN_DEBUG1( "CThumbAGProcessor::RunL() add iHarvesterClient observer failed"); |
1215 TN_DEBUG1( "CThumbAGProcessor::RunL() add iHarvesterClient observer failed"); |
1216 OstTrace0( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - add iHarvesterClient observer failed" ); |
|
1137 // if we fail observer harvester, fake it |
1217 // if we fail observer harvester, fake it |
1138 iHarvesterActivated = ETrue; |
1218 iHarvesterActivated = ETrue; |
1139 } |
1219 } |
1140 __ASSERT_DEBUG((err==KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), !iHarvesterClient "), err)); |
1220 __ASSERT_DEBUG((err==KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), !iHarvesterClient "), err)); |
1141 } |
1221 } |
1142 #endif |
1222 #endif |
1143 |
1223 |
1144 TN_DEBUG1( "CThumbAGProcessor::RunL() MMPXCollectionUtility"); |
1224 TN_DEBUG1( "CThumbAGProcessor::RunL() MMPXCollectionUtility"); |
1225 OstTrace0( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - MMPXCollectionUtility"); |
|
1145 TRAP( err, iCollectionUtility = MMPXCollectionUtility::NewL( this, KMcModeIsolated )); |
1226 TRAP( err, iCollectionUtility = MMPXCollectionUtility::NewL( this, KMcModeIsolated )); |
1146 TN_DEBUG2( "CThumbAGProcessor::RunL() create MMPXCollectionUtility err = %d", err); |
1227 TN_DEBUG2( "CThumbAGProcessor::RunL() create MMPXCollectionUtility err = %d", err); |
1228 OstTrace1( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - create MMPXCollectionUtility err;err=%d", err ); |
|
1147 __ASSERT_DEBUG((iCollectionUtility), User::Panic(_L("CThumbAGProcessor::RunL(), !iCollectionUtility "), err)); |
1229 __ASSERT_DEBUG((iCollectionUtility), User::Panic(_L("CThumbAGProcessor::RunL(), !iCollectionUtility "), err)); |
1148 |
1230 |
1149 __ASSERT_DEBUG((iActivityManager), User::Panic(_L("CThumbAGProcessor::RunL(), !iActivityManager "), KErrBadHandle)); |
1231 __ASSERT_DEBUG((iActivityManager), User::Panic(_L("CThumbAGProcessor::RunL(), !iActivityManager "), KErrBadHandle)); |
1150 if(iActivityManager) |
1232 if(iActivityManager) |
1151 { |
1233 { |
1152 iActivityManager->Start(); |
1234 iActivityManager->Start(); |
1153 } |
1235 } |
1154 |
1236 |
1155 TN_DEBUG1( "CThumbAGProcessor::RunL() - Initialisation 2 done" ); |
1237 TN_DEBUG1( "CThumbAGProcessor::RunL() - Initialisation 2 done" ); |
1238 OstTrace0( TRACE_NORMAL, DUP13_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Initialisation 2 done" ); |
|
1156 return; |
1239 return; |
1157 } |
1240 } |
1158 |
1241 |
1159 // restart session if died |
1242 // restart session if died |
1160 if (!iTMSession) |
1243 if (!iTMSession) |
1161 { |
1244 { |
1162 TN_DEBUG1( "CThumbAGProcessor::RunL() - open TNM session"); |
1245 TN_DEBUG1( "CThumbAGProcessor::RunL() - open TNM session"); |
1246 OstTrace0( TRACE_NORMAL, DUP14_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL" ); |
|
1163 TRAPD( err, iTMSession = CThumbnailManager::NewL( *this ) ); |
1247 TRAPD( err, iTMSession = CThumbnailManager::NewL( *this ) ); |
1164 |
1248 |
1165 if (err != KErrNone) |
1249 if (err != KErrNone) |
1166 { |
1250 { |
1167 iTMSession = NULL; |
1251 iTMSession = NULL; |
1168 ActivateAO(); |
1252 ActivateAO(); |
1169 TN_DEBUG2( "CThumbAGProcessor::RunL() - Session restart failed, error == %d", err ); |
1253 TN_DEBUG2( "CThumbAGProcessor::RunL() - Session restart failed, error == %d", err ); |
1254 OstTrace1( TRACE_NORMAL, DUP15_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - Session restart failed, error;err=%d", err ); |
|
1170 } |
1255 } |
1171 else |
1256 else |
1172 { |
1257 { |
1173 iTMSession->SetRequestObserver(*this); |
1258 iTMSession->SetRequestObserver(*this); |
1174 iSessionDied = EFalse; |
1259 iSessionDied = EFalse; |
1177 |
1262 |
1178 // do not run if request is already issued to TNM server even if forced |
1263 // do not run if request is already issued to TNM server even if forced |
1179 if(iActiveCount >= KMaxDaemonRequests) |
1264 if(iActiveCount >= KMaxDaemonRequests) |
1180 { |
1265 { |
1181 TN_DEBUG1( "CThumbAGProcessor::RunL() - waiting for previous to complete, abort..." ); |
1266 TN_DEBUG1( "CThumbAGProcessor::RunL() - waiting for previous to complete, abort..." ); |
1267 OstTrace0( TRACE_NORMAL, DUP16_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - waiting for previous to complete, abort..." ); |
|
1182 return; |
1268 return; |
1183 } |
1269 } |
1184 |
1270 |
1185 //force run can proceed from this point |
1271 //force run can proceed from this point |
1186 #ifdef _DEBUG |
1272 #ifdef _DEBUG |
1187 if( iForegroundRun ) |
1273 if( iForegroundRun ) |
1188 { |
1274 { |
1189 TN_DEBUG1( "void CThumbAGProcessor::RunL() KForceBackgroundGeneration enabled"); |
1275 TN_DEBUG1( "void CThumbAGProcessor::RunL() KForceBackgroundGeneration enabled"); |
1276 OstTrace0( TRACE_NORMAL, DUP17_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - KForceBackgroundGeneration enabled" ); |
|
1190 } |
1277 } |
1191 |
1278 |
1192 if( iForceRun ) |
1279 if( iForceRun ) |
1193 { |
1280 { |
1194 TN_DEBUG1( "CThumbAGProcessor::RunL() - *** FORCED RUN ***"); |
1281 TN_DEBUG1( "CThumbAGProcessor::RunL() - *** FORCED RUN ***"); |
1282 OstTrace0( TRACE_NORMAL, DUP18_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - *** FORCED RUN ***" ); |
|
1195 } |
1283 } |
1196 #endif |
1284 #endif |
1197 |
1285 |
1198 if( (iForceRun || iForegroundRun ) && !iMountTimer->IsActive() ) |
1286 if( (iForceRun || iForegroundRun ) && !iMountTimer->IsActive() ) |
1199 { |
1287 { |
1200 TN_DEBUG1( "void CThumbAGProcessor::RunL() skip idle detection!"); |
1288 TN_DEBUG1( "void CThumbAGProcessor::RunL() skip idle detection!"); |
1289 OstTrace0( TRACE_NORMAL, DUP19_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - skip idle detection!" ); |
|
1201 CancelTimeout(); |
1290 CancelTimeout(); |
1202 } |
1291 } |
1203 else |
1292 else |
1204 { |
1293 { |
1205 if( !iIdle || iHarvesting || iMPXHarvesting || iPeriodicTimer->IsActive() ) |
1294 if( !iIdle || iHarvesting || iMPXHarvesting || iPeriodicTimer->IsActive() ) |
1206 { |
1295 { |
1207 TN_DEBUG1( "void CThumbAGProcessor::RunL() device not idle"); |
1296 TN_DEBUG1( "void CThumbAGProcessor::RunL() device not idle"); |
1297 OstTrace0( TRACE_NORMAL, DUP20_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - device not idle" ); |
|
1208 return; |
1298 return; |
1209 } |
1299 } |
1210 else |
1300 else |
1211 { |
1301 { |
1212 //check is server idle |
1302 //check is server idle |
1215 |
1305 |
1216 if(ret != KErrNone || !serveIdle ) |
1306 if(ret != KErrNone || !serveIdle ) |
1217 { |
1307 { |
1218 //start inactivity timer and retry on after callback |
1308 //start inactivity timer and retry on after callback |
1219 TN_DEBUG1( "void CThumbAGProcessor::RunL() server not idle"); |
1309 TN_DEBUG1( "void CThumbAGProcessor::RunL() server not idle"); |
1310 OstTrace0( TRACE_NORMAL, DUP21_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - server not idle" ); |
|
1220 StartTimeout(); |
1311 StartTimeout(); |
1221 return; |
1312 return; |
1222 } |
1313 } |
1223 TN_DEBUG1( "void CThumbAGProcessor::RunL() device and server idle, process"); |
1314 TN_DEBUG1( "void CThumbAGProcessor::RunL() device and server idle, process"); |
1315 OstTrace0( TRACE_NORMAL, DUP22_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - device and server idle, process" ); |
|
1224 } |
1316 } |
1225 } |
1317 } |
1226 |
1318 |
1227 //Handle completed MDS Query |
1319 //Handle completed MDS Query |
1228 if( iQueryReady && iProcessingCount) |
1320 if( iQueryReady && iProcessingCount) |
1232 //if unknown items or mount timer is active, abort processing |
1324 //if unknown items or mount timer is active, abort processing |
1233 |
1325 |
1234 if(((iForceRun && iModify ) || (!iForceRun && !iModify )) && !iUnknownItemCount && !iMountTimer->IsActive()) |
1326 if(((iForceRun && iModify ) || (!iForceRun && !iModify )) && !iUnknownItemCount && !iMountTimer->IsActive()) |
1235 { |
1327 { |
1236 TN_DEBUG1( "CThumbAGProcessor::RunL() - iQueryReady START" ); |
1328 TN_DEBUG1( "CThumbAGProcessor::RunL() - iQueryReady START" ); |
1329 OstTrace0( TRACE_NORMAL, DUP23_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iQueryReady START" ); |
|
1237 |
1330 |
1238 const CMdEObject* object = &iQuery->Result( iProcessingCount-1 ); |
1331 const CMdEObject* object = &iQuery->Result( iProcessingCount-1 ); |
1239 iProcessingCount--; |
1332 iProcessingCount--; |
1240 |
1333 |
1241 if ( object ) |
1334 if ( object ) |
1249 iQueryQueue.Remove(itemIndex); |
1342 iQueryQueue.Remove(itemIndex); |
1250 } |
1343 } |
1251 |
1344 |
1252 TRAP( err, CreateThumbnailsL( object ) ); |
1345 TRAP( err, CreateThumbnailsL( object ) ); |
1253 TN_DEBUG2( "CThumbAGProcessor::RunL(), CreateThumbnailsL error == %d", err ); |
1346 TN_DEBUG2( "CThumbAGProcessor::RunL(), CreateThumbnailsL error == %d", err ); |
1347 OstTrace1( TRACE_NORMAL, DUP24_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - CreateThumbnailsL error;err=%d", err ); |
|
1254 __ASSERT_DEBUG((err==KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), CreateThumbnailsL() "), err)); |
1348 __ASSERT_DEBUG((err==KErrNone), User::Panic(_L("CThumbAGProcessor::RunL(), CreateThumbnailsL() "), err)); |
1255 } |
1349 } |
1256 } |
1350 } |
1257 //force is coming, but executing non-forced query complete-> cancel old |
1351 //force is coming, but executing non-forced query complete-> cancel old |
1258 else |
1352 else |
1259 { |
1353 { |
1260 //cancel query |
1354 //cancel query |
1261 TN_DEBUG1( "CThumbAGProcessor::RunL() - cancel processing query" ); |
1355 TN_DEBUG1( "CThumbAGProcessor::RunL() - cancel processing query" ); |
1356 OstTrace0( TRACE_NORMAL, DUP25_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - cancel processing query" ); |
|
1262 DeleteAndCancelQuery( ETrue ); |
1357 DeleteAndCancelQuery( ETrue ); |
1263 ActivateAO(); |
1358 ActivateAO(); |
1264 return; |
1359 return; |
1265 } |
1360 } |
1266 |
1361 |
1267 //is last query item |
1362 //is last query item |
1268 if( iProcessingCount <= 0 ) |
1363 if( iProcessingCount <= 0 ) |
1269 { |
1364 { |
1270 TN_DEBUG1( "CThumbAGProcessor::RunL() - iQueryReady FINISH" ); |
1365 TN_DEBUG1( "CThumbAGProcessor::RunL() - iQueryReady FINISH" ); |
1366 OstTrace0( TRACE_NORMAL, DUP26_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - iQueryReady FINISH" ); |
|
1271 iQueryReady = EFalse; |
1367 iQueryReady = EFalse; |
1272 iQueryActive = EFalse; |
1368 iQueryActive = EFalse; |
1273 } |
1369 } |
1274 |
1370 |
1275 ActivateAO(); |
1371 ActivateAO(); |
1285 ActivateAO(); |
1381 ActivateAO(); |
1286 } |
1382 } |
1287 else |
1383 else |
1288 { |
1384 { |
1289 TN_DEBUG1( "CThumbAGProcessor::RunL() - waiting for query to complete, abort..." ); |
1385 TN_DEBUG1( "CThumbAGProcessor::RunL() - waiting for query to complete, abort..." ); |
1386 OstTrace0( TRACE_NORMAL, DUP27_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - waiting for query to complete, abort..." ); |
|
1290 } |
1387 } |
1291 } |
1388 } |
1292 else if ( iUnknownItemCount > 0 ) |
1389 else if ( iUnknownItemCount > 0 ) |
1293 { |
1390 { |
1294 TN_DEBUG1( "void CThumbAGProcessor::RunL() unknown items in queue"); |
1391 TN_DEBUG1( "void CThumbAGProcessor::RunL() unknown items in queue"); |
1392 OstTrace0( TRACE_NORMAL, DUP28_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - unknown items in queue" ); |
|
1295 |
1393 |
1296 i2ndRound = EFalse; |
1394 i2ndRound = EFalse; |
1297 iModify = EFalse; |
1395 iModify = EFalse; |
1298 iUnknown = ETrue; |
1396 iUnknown = ETrue; |
1299 iQueryActive = ETrue; |
1397 iQueryActive = ETrue; |
1301 QueryL( EGenerationItemActionResolveType ); |
1399 QueryL( EGenerationItemActionResolveType ); |
1302 } |
1400 } |
1303 else if ( iDeleteItemCount > 0 ) |
1401 else if ( iDeleteItemCount > 0 ) |
1304 { |
1402 { |
1305 TN_DEBUG1( "void CThumbAGProcessor::RunL() delete thumbnails"); |
1403 TN_DEBUG1( "void CThumbAGProcessor::RunL() delete thumbnails"); |
1404 OstTrace0( TRACE_NORMAL, DUP29_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - delete thumbnails" ); |
|
1306 // delete thumbs by URI |
1405 // delete thumbs by URI |
1307 __ASSERT_DEBUG((iTMSession), User::Panic(_L("CThumbAGProcessor::RunL() !iTMSession "), KErrBadHandle)); |
1406 __ASSERT_DEBUG((iTMSession), User::Panic(_L("CThumbAGProcessor::RunL() !iTMSession "), KErrBadHandle)); |
1308 if(iTMSession) |
1407 if(iTMSession) |
1309 { |
1408 { |
1310 TInt itemIndex(KErrNotFound); |
1409 TInt itemIndex(KErrNotFound); |
1321 { |
1420 { |
1322 if(!iGenerationQueue[itemIndex].iUri) |
1421 if(!iGenerationQueue[itemIndex].iUri) |
1323 { |
1422 { |
1324 //URI is invalid |
1423 //URI is invalid |
1325 TN_DEBUG1( "void CThumbAGProcessor::RunL() unable to delete URI inbalid"); |
1424 TN_DEBUG1( "void CThumbAGProcessor::RunL() unable to delete URI inbalid"); |
1425 OstTrace0( TRACE_NORMAL, DUP30_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - unable to delete URI inbalid" ); |
|
1326 iGenerationQueue.Remove( itemIndex ); |
1426 iGenerationQueue.Remove( itemIndex ); |
1327 ActivateAO(); |
1427 ActivateAO(); |
1328 return; |
1428 return; |
1329 } |
1429 } |
1330 |
1430 |
1331 TN_DEBUG2( "void CThumbAGProcessor::RunL() delete %S", iGenerationQueue[itemIndex].iUri); |
1431 TN_DEBUG2( "void CThumbAGProcessor::RunL() delete %S", iGenerationQueue[itemIndex].iUri); |
1432 OstTraceExt1( TRACE_NORMAL, DUP31_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL;iGenerationQueue[itemIndex].iUri=%S", *iGenerationQueue[itemIndex].iUri ); |
|
1332 CThumbnailObjectSource* source = NULL; |
1433 CThumbnailObjectSource* source = NULL; |
1333 TRAPD(err, source = CThumbnailObjectSource::NewL( *iGenerationQueue[itemIndex].iUri, KNullDesC)); |
1434 TRAPD(err, source = CThumbnailObjectSource::NewL( *iGenerationQueue[itemIndex].iUri, KNullDesC)); |
1334 |
1435 |
1335 if(err == KErrNone) |
1436 if(err == KErrNone) |
1336 { |
1437 { |
1349 // no items in query queue, start new |
1450 // no items in query queue, start new |
1350 // select queue to process, priority by type |
1451 // select queue to process, priority by type |
1351 else if ( iModifyItemCount > 0 ) |
1452 else if ( iModifyItemCount > 0 ) |
1352 { |
1453 { |
1353 TN_DEBUG1( "void CThumbAGProcessor::RunL() update thumbnails"); |
1454 TN_DEBUG1( "void CThumbAGProcessor::RunL() update thumbnails"); |
1455 OstTrace0( TRACE_NORMAL, DUP32_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - update thumbnails" ); |
|
1354 |
1456 |
1355 i2ndRound = EFalse; |
1457 i2ndRound = EFalse; |
1356 |
1458 |
1357 // query for object info |
1459 // query for object info |
1358 iQueryActive = ETrue; |
1460 iQueryActive = ETrue; |
1361 QueryL( EGenerationItemActionModify ); |
1463 QueryL( EGenerationItemActionModify ); |
1362 } |
1464 } |
1363 else if ( iAddItemCount > 0 ) |
1465 else if ( iAddItemCount > 0 ) |
1364 { |
1466 { |
1365 TN_DEBUG1( "void CThumbAGProcessor::RunL() update 1st round thumbnails"); |
1467 TN_DEBUG1( "void CThumbAGProcessor::RunL() update 1st round thumbnails"); |
1468 OstTrace0( TRACE_NORMAL, DUP33_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - update 1st round thumbnails" ); |
|
1366 |
1469 |
1367 i2ndRound = EFalse; |
1470 i2ndRound = EFalse; |
1368 iUnknown = EFalse; |
1471 iUnknown = EFalse; |
1369 // query for object info |
1472 // query for object info |
1370 iQueryActive = ETrue; |
1473 iQueryActive = ETrue; |
1372 QueryL( EGenerationItemActionAdd ); |
1475 QueryL( EGenerationItemActionAdd ); |
1373 } |
1476 } |
1374 else if( i2ndAddItemCount > 0) |
1477 else if( i2ndAddItemCount > 0) |
1375 { |
1478 { |
1376 TN_DEBUG1( "void CThumbAGProcessor::RunL() update 2nd round thumbnails"); |
1479 TN_DEBUG1( "void CThumbAGProcessor::RunL() update 2nd round thumbnails"); |
1480 OstTrace0( TRACE_NORMAL, DUP34_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - update 2nd round thumbnails" ); |
|
1377 |
1481 |
1378 // query for object info |
1482 // query for object info |
1379 iQueryActive = ETrue; |
1483 iQueryActive = ETrue; |
1380 i2ndRound = ETrue; |
1484 i2ndRound = ETrue; |
1381 iUnknown = EFalse; |
1485 iUnknown = EFalse; |
1382 QueryL( EGenerationItemAction2ndAdd ); |
1486 QueryL( EGenerationItemAction2ndAdd ); |
1383 } |
1487 } |
1384 |
1488 |
1385 TN_DEBUG1( "CThumbAGProcessor::RunL() - end" ); |
1489 TN_DEBUG1( "CThumbAGProcessor::RunL() - end" ); |
1490 OstTrace0( TRACE_NORMAL, DUP35_CTHUMBAGPROCESSOR_RUNL, "CThumbAGProcessor::RunL - end" ); |
|
1386 } |
1491 } |
1387 |
1492 |
1388 // --------------------------------------------------------------------------- |
1493 // --------------------------------------------------------------------------- |
1389 // CThumbAGProcessor::DeleteAndCancelQuery() |
1494 // CThumbAGProcessor::DeleteAndCancelQuery() |
1390 // --------------------------------------------------------------------------- |
1495 // --------------------------------------------------------------------------- |
1391 // |
1496 // |
1392 void CThumbAGProcessor::DeleteAndCancelQuery(TBool aRestoreItems) |
1497 void CThumbAGProcessor::DeleteAndCancelQuery(TBool aRestoreItems) |
1393 { |
1498 { |
1394 TN_DEBUG2( "CThumbAGProcessor::DeleteAndCancelQuery(aRestoreItems = %d) in", aRestoreItems ); |
1499 TN_DEBUG2( "CThumbAGProcessor::DeleteAndCancelQuery(aRestoreItems = %d) in", aRestoreItems ); |
1500 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_DELETEANDCANCELQUERY, "CThumbAGProcessor::DeleteAndCancelQuery;aRestoreItems=%d", aRestoreItems ); |
|
1395 |
1501 |
1396 if(iQuery) |
1502 if(iQuery) |
1397 { |
1503 { |
1398 TN_DEBUG1( "CThumbAGProcessor::DeleteAndCancelQuery() - deleting query" ); |
1504 TN_DEBUG1( "CThumbAGProcessor::DeleteAndCancelQuery() - deleting query" ); |
1505 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_DELETEANDCANCELQUERY, "CThumbAGProcessor::DeleteAndCancelQuery - deleting query" ); |
|
1399 iQuery->Cancel(); |
1506 iQuery->Cancel(); |
1400 delete iQuery; |
1507 delete iQuery; |
1401 iQuery = NULL; |
1508 iQuery = NULL; |
1402 } |
1509 } |
1403 |
1510 |
1423 } |
1530 } |
1424 iQueryQueue.Remove(0); |
1531 iQueryQueue.Remove(0); |
1425 } |
1532 } |
1426 |
1533 |
1427 TN_DEBUG1( "CThumbAGProcessor::DeleteAndCancelQuery() out" ); |
1534 TN_DEBUG1( "CThumbAGProcessor::DeleteAndCancelQuery() out" ); |
1535 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_DELETEANDCANCELQUERY, "CThumbAGProcessor::DeleteAndCancelQuery - out" ); |
|
1428 } |
1536 } |
1429 |
1537 |
1430 // --------------------------------------------------------------------------- |
1538 // --------------------------------------------------------------------------- |
1431 // CThumbAGProcessor::DoCancel() |
1539 // CThumbAGProcessor::DoCancel() |
1432 // --------------------------------------------------------------------------- |
1540 // --------------------------------------------------------------------------- |
1440 HarvesterEventObserverType aHEObserverType, |
1548 HarvesterEventObserverType aHEObserverType, |
1441 HarvesterEventState aHarvesterEventState, |
1549 HarvesterEventState aHarvesterEventState, |
1442 TInt aItemsLeft ) |
1550 TInt aItemsLeft ) |
1443 { |
1551 { |
1444 TN_DEBUG4( "CThumbAGProcessor::HarvestingUpdated -- start() aHEObserverType = %d, aHarvesterEventState = %d, aItemsLeft = %d", aHEObserverType, aHarvesterEventState, aItemsLeft ); |
1552 TN_DEBUG4( "CThumbAGProcessor::HarvestingUpdated -- start() aHEObserverType = %d, aHarvesterEventState = %d, aItemsLeft = %d", aHEObserverType, aHarvesterEventState, aItemsLeft ); |
1553 OstTraceExt3( TRACE_NORMAL, CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated;aHEObserverType=%u;aHarvesterEventState=%u;aItemsLeft=%d", aHEObserverType, aHarvesterEventState, aItemsLeft ); |
|
1445 |
1554 |
1446 if(iShutdown) |
1555 if(iShutdown) |
1447 { |
1556 { |
1448 return; |
1557 return; |
1449 } |
1558 } |
1455 |
1564 |
1456 #ifdef _DEBUG |
1565 #ifdef _DEBUG |
1457 if( aHEObserverType == EHEObserverTypePlaceholder) |
1566 if( aHEObserverType == EHEObserverTypePlaceholder) |
1458 { |
1567 { |
1459 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypePlaceholder"); |
1568 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypePlaceholder"); |
1569 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypePlaceholder" ); |
|
1460 } |
1570 } |
1461 else if( aHEObserverType == EHEObserverTypeOverall) |
1571 else if( aHEObserverType == EHEObserverTypeOverall) |
1462 { |
1572 { |
1463 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeOverall"); |
1573 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeOverall"); |
1574 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeOverall" ); |
|
1464 } |
1575 } |
1465 else if( aHEObserverType == EHEObserverTypeMMC) |
1576 else if( aHEObserverType == EHEObserverTypeMMC) |
1466 { |
1577 { |
1467 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeMMC"); |
1578 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeMMC"); |
1579 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- type EHEObserverTypeMMC" ); |
|
1468 } |
1580 } |
1469 #endif |
1581 #endif |
1470 |
1582 |
1471 //placeholder harvesting |
1583 //placeholder harvesting |
1472 if( aHEObserverType == EHEObserverTypePlaceholder) |
1584 if( aHEObserverType == EHEObserverTypePlaceholder) |
1494 iPHHarvesting = iPHHarvestingTemp; |
1606 iPHHarvesting = iPHHarvestingTemp; |
1495 |
1607 |
1496 if( iPHHarvesting ) |
1608 if( iPHHarvesting ) |
1497 { |
1609 { |
1498 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesterin started"); |
1610 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesterin started"); |
1611 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesterin starteds" ); |
|
1499 } |
1612 } |
1500 else |
1613 else |
1501 { |
1614 { |
1502 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesting finished"); |
1615 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesting finished"); |
1616 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS placeholder harvesting finished" ); |
|
1503 //query present placeholders |
1617 //query present placeholders |
1504 TRAP_IGNORE(QueryPlaceholdersL( EFalse )); |
1618 TRAP_IGNORE(QueryPlaceholdersL( EFalse )); |
1505 iDoQueryAllItems = EFalse; |
1619 iDoQueryAllItems = EFalse; |
1506 iPHHarvestingItemsLeftTemp = 0; |
1620 iPHHarvestingItemsLeftTemp = 0; |
1507 } |
1621 } |
1510 //restart mount timout if PH item count is increasing durin MMC harvesting |
1624 //restart mount timout if PH item count is increasing durin MMC harvesting |
1511 if(iMMCHarvesting && iPHHarvesting && aItemsLeft > iPHHarvestingItemsLeftTemp) |
1625 if(iMMCHarvesting && iPHHarvesting && aItemsLeft > iPHHarvestingItemsLeftTemp) |
1512 { |
1626 { |
1513 //if items count increasing, restart mount timeout |
1627 //if items count increasing, restart mount timeout |
1514 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- PH count increasing, restart mount timeout"); |
1628 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- PH count increasing, restart mount timeout"); |
1629 OstTrace0( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- PH count increasing, restart mount timeout" ); |
|
1515 |
1630 |
1516 if(iMountTimer->IsActive()) |
1631 if(iMountTimer->IsActive()) |
1517 { |
1632 { |
1518 iMountTimer->Cancel(); |
1633 iMountTimer->Cancel(); |
1519 } |
1634 } |
1553 iHarvesting = iHarvestingTemp; |
1668 iHarvesting = iHarvestingTemp; |
1554 |
1669 |
1555 if( iHarvesting ) |
1670 if( iHarvesting ) |
1556 { |
1671 { |
1557 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting started"); |
1672 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting started"); |
1673 OstTrace0( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting started" ); |
|
1558 CancelTimeout(); |
1674 CancelTimeout(); |
1559 } |
1675 } |
1560 else |
1676 else |
1561 { |
1677 { |
1562 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting finished "); |
1678 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting finished "); |
1679 OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS harvesting finished" ); |
|
1563 // continue processing if needed |
1680 // continue processing if needed |
1564 StartTimeout(); |
1681 StartTimeout(); |
1565 |
1682 |
1566 if(iMountTimer->IsActive()) |
1683 if(iMountTimer->IsActive()) |
1567 { |
1684 { |
1596 iMMCHarvesting = iMMCHarvestingTemp; |
1713 iMMCHarvesting = iMMCHarvestingTemp; |
1597 |
1714 |
1598 if( iMMCHarvesting ) |
1715 if( iMMCHarvesting ) |
1599 { |
1716 { |
1600 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesterin started"); |
1717 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesterin started"); |
1718 OstTrace0( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesterin started" ); |
|
1601 UpdatePSValues(EFalse, ETrue); |
1719 UpdatePSValues(EFalse, ETrue); |
1602 iMMCHarvestingItemsLeftTemp = 0; |
1720 iMMCHarvestingItemsLeftTemp = 0; |
1603 } |
1721 } |
1604 else |
1722 else |
1605 { |
1723 { |
1607 if(!iHarvesting) |
1725 if(!iHarvesting) |
1608 { |
1726 { |
1609 StartTimeout(); |
1727 StartTimeout(); |
1610 } |
1728 } |
1611 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesting finished "); |
1729 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesting finished "); |
1730 OstTrace0( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MDS MMC harvesting finished" ); |
|
1612 } |
1731 } |
1613 } |
1732 } |
1614 |
1733 |
1615 //restart mount timout if MMC item count is still increasing |
1734 //restart mount timout if MMC item count is still increasing |
1616 if(iMMCHarvesting && aItemsLeft > iMMCHarvestingItemsLeftTemp) |
1735 if(iMMCHarvesting && aItemsLeft > iMMCHarvestingItemsLeftTemp) |
1617 { |
1736 { |
1618 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MMC count increasing, restart mount timeout"); |
1737 TN_DEBUG1( "CThumbAGProcessor::HarvestingUpdated -- MMC count increasing, restart mount timeout"); |
1738 OstTrace0( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated -- MMC count increasing, restart mount timeout" ); |
|
1619 |
1739 |
1620 if(iMountTimer->IsActive()) |
1740 if(iMountTimer->IsActive()) |
1621 { |
1741 { |
1622 iMountTimer->Cancel(); |
1742 iMountTimer->Cancel(); |
1623 } |
1743 } |
1627 |
1747 |
1628 iMMCHarvestingItemsLeftTemp = aItemsLeft; |
1748 iMMCHarvestingItemsLeftTemp = aItemsLeft; |
1629 } |
1749 } |
1630 |
1750 |
1631 TN_DEBUG4( "CThumbAGProcessor::HarvestingUpdated -- end() iHarvesting == %d, iPHHarvesting == %d iMMCHarvesting == %d ", iHarvesting, iPHHarvesting, iMMCHarvesting); |
1751 TN_DEBUG4( "CThumbAGProcessor::HarvestingUpdated -- end() iHarvesting == %d, iPHHarvesting == %d iMMCHarvesting == %d ", iHarvesting, iPHHarvesting, iMMCHarvesting); |
1752 OstTraceExt3( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_HARVESTINGUPDATED, "CThumbAGProcessor::HarvestingUpdated;iHarvesting=%u;iPHHarvesting=%u;iMMCHarvesting=%u", iHarvesting, iPHHarvesting, iMMCHarvesting ); |
|
1632 } |
1753 } |
1633 |
1754 |
1634 // --------------------------------------------------------------------------- |
1755 // --------------------------------------------------------------------------- |
1635 // CThumbAGProcessor::StartTimeout() |
1756 // CThumbAGProcessor::StartTimeout() |
1636 // --------------------------------------------------------------------------- |
1757 // --------------------------------------------------------------------------- |
1637 // |
1758 // |
1638 void CThumbAGProcessor::StartTimeout() |
1759 void CThumbAGProcessor::StartTimeout() |
1639 { |
1760 { |
1640 TN_DEBUG1( "CThumbAGProcessor::StartTimeout()"); |
1761 TN_DEBUG1( "CThumbAGProcessor::StartTimeout()"); |
1762 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_STARTTIMEOUT, "CThumbAGProcessor::StartTimeout" ); |
|
1641 CancelTimeout(); |
1763 CancelTimeout(); |
1642 |
1764 |
1643 if(!iHarvesting && !iMPXHarvesting && !iPeriodicTimer->IsActive() && !iShutdown) |
1765 if(!iHarvesting && !iMPXHarvesting && !iPeriodicTimer->IsActive() && !iShutdown) |
1644 { |
1766 { |
1645 iPeriodicTimer->Start( KHarvestingCompleteTimeout, KHarvestingCompleteTimeout, |
1767 iPeriodicTimer->Start( KHarvestingCompleteTimeout, KHarvestingCompleteTimeout, |
1652 // --------------------------------------------------------------------------- |
1774 // --------------------------------------------------------------------------- |
1653 // |
1775 // |
1654 void CThumbAGProcessor::CancelTimeout() |
1776 void CThumbAGProcessor::CancelTimeout() |
1655 { |
1777 { |
1656 TN_DEBUG1( "CThumbAGProcessor::CancelTimeout()"); |
1778 TN_DEBUG1( "CThumbAGProcessor::CancelTimeout()"); |
1779 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_CANCELTIMEOUT, "CThumbAGProcessor::CancelTimeout" ); |
|
1657 if(iPeriodicTimer->IsActive()) |
1780 if(iPeriodicTimer->IsActive()) |
1658 { |
1781 { |
1659 iPeriodicTimer->Cancel(); |
1782 iPeriodicTimer->Cancel(); |
1660 } |
1783 } |
1661 } |
1784 } |
1669 #else |
1792 #else |
1670 TInt CThumbAGProcessor::RunError(TInt /*aError*/) |
1793 TInt CThumbAGProcessor::RunError(TInt /*aError*/) |
1671 #endif |
1794 #endif |
1672 { |
1795 { |
1673 TN_DEBUG2( "CThumbAGrocessor::RunError() %d", aError); |
1796 TN_DEBUG2( "CThumbAGrocessor::RunError() %d", aError); |
1674 |
1797 #ifdef _DEBUG |
1798 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_RUNERROR, "CThumbAGProcessor::RunError;aError=%d", aError ); |
|
1799 #else |
|
1800 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_RUNERROR, "CThumbAGProcessor::RunError"); |
|
1801 #endif |
|
1675 UpdatePSValues(EFalse, EFalse); |
1802 UpdatePSValues(EFalse, EFalse); |
1676 |
1803 |
1677 iActiveCount--; |
1804 iActiveCount--; |
1678 |
1805 |
1679 ActivateAO(); |
1806 ActivateAO(); |
1691 UpdateItemCounts(); |
1818 UpdateItemCounts(); |
1692 |
1819 |
1693 if(iFormatting) |
1820 if(iFormatting) |
1694 { |
1821 { |
1695 TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - FORMATTING - DAEMON ON PAUSE"); |
1822 TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - FORMATTING - DAEMON ON PAUSE"); |
1823 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_ACTIVATEAO, "CThumbAGProcessor::ActivateAO - FORMATTING - DAEMON ON PAUSE" ); |
|
1696 return; |
1824 return; |
1697 } |
1825 } |
1698 |
1826 |
1699 //check if forced run needs to continue |
1827 //check if forced run needs to continue |
1700 if ( (iModifyItemCount > 0 || iDeleteItemCount > 0 || iUnknownItemCount > 0) && !iMountTimer->IsActive()) |
1828 if ( (iModifyItemCount > 0 || iDeleteItemCount > 0 || iUnknownItemCount > 0) && !iMountTimer->IsActive()) |
1701 { |
1829 { |
1702 TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - forced run"); |
1830 TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - forced run"); |
1831 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_ACTIVATEAO, "CThumbAGProcessor::ActivateAO - iModifyItemCount > 0 || iUnknownItemCount > 0 || iDeleteItemCount > 0" ); |
|
1703 SetForceRun( ETrue ); |
1832 SetForceRun( ETrue ); |
1704 } |
1833 } |
1705 else |
1834 else |
1706 { |
1835 { |
1707 iModify = EFalse; |
1836 iModify = EFalse; |
1709 } |
1838 } |
1710 |
1839 |
1711 if( !IsActive() && !iShutdown && ((iActiveCount < KMaxDaemonRequests && !iQueryActive) || iForceRun )) |
1840 if( !IsActive() && !iShutdown && ((iActiveCount < KMaxDaemonRequests && !iQueryActive) || iForceRun )) |
1712 { |
1841 { |
1713 TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - Activated"); |
1842 TN_DEBUG1( "CThumbAGProcessor::ActivateAO() - Activated"); |
1843 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_ACTIVATEAO, "CThumbAGProcessor::ActivateAO - Activated" ); |
|
1714 SetActive(); |
1844 SetActive(); |
1715 TRequestStatus* statusPtr = &iStatus; |
1845 TRequestStatus* statusPtr = &iStatus; |
1716 User::RequestComplete( statusPtr, KErrNone ); |
1846 User::RequestComplete( statusPtr, KErrNone ); |
1717 } |
1847 } |
1718 |
1848 |
1724 // --------------------------------------------------------------------------- |
1854 // --------------------------------------------------------------------------- |
1725 // |
1855 // |
1726 TInt CThumbAGProcessor::PeriodicTimerCallBack(TAny* aAny) |
1856 TInt CThumbAGProcessor::PeriodicTimerCallBack(TAny* aAny) |
1727 { |
1857 { |
1728 TN_DEBUG1( "CThumbAGProcessor::PeriodicTimerCallBack()"); |
1858 TN_DEBUG1( "CThumbAGProcessor::PeriodicTimerCallBack()"); |
1859 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_PERIODICTIMERCALLBACK, "CThumbAGProcessor::PeriodicTimerCallBack" ); |
|
1729 CThumbAGProcessor* self = static_cast<CThumbAGProcessor*>( aAny ); |
1860 CThumbAGProcessor* self = static_cast<CThumbAGProcessor*>( aAny ); |
1730 |
1861 |
1731 self->CancelTimeout(); |
1862 self->CancelTimeout(); |
1732 self->ActivateAO(); |
1863 self->ActivateAO(); |
1733 |
1864 |
1753 TBool audioFull( EFalse ); |
1884 TBool audioFull( EFalse ); |
1754 |
1885 |
1755 // get cenrep values |
1886 // get cenrep values |
1756 TInt ret = rep->Get( KAutoCreateImageGrid, imageGrid ); |
1887 TInt ret = rep->Get( KAutoCreateImageGrid, imageGrid ); |
1757 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageGrid %d", ret); |
1888 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageGrid %d", ret); |
1889 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateImageGrid;ret=%d", ret ); |
|
1758 ret = rep->Get( KAutoCreateImageList, imageList ); |
1890 ret = rep->Get( KAutoCreateImageList, imageList ); |
1759 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageList %d", ret); |
1891 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageList %d", ret); |
1892 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateImageList;ret=%d", ret ); |
|
1760 ret = rep->Get( KAutoCreateImageFullscreen, imageFull ); |
1893 ret = rep->Get( KAutoCreateImageFullscreen, imageFull ); |
1761 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageFullscreen %d", ret); |
1894 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateImageFullscreen %d", ret); |
1895 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL;ret=%d", ret ); |
|
1762 ret = rep->Get( KAutoCreateVideoGrid, videoGrid ); |
1896 ret = rep->Get( KAutoCreateVideoGrid, videoGrid ); |
1763 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoGrid %d", ret); |
1897 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoGrid %d", ret); |
1898 OstTrace1( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateVideoGrid;ret=%d", ret ); |
|
1764 ret = rep->Get( KAutoCreateVideoList, videoList ); |
1899 ret = rep->Get( KAutoCreateVideoList, videoList ); |
1765 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoList %d", ret); |
1900 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoList %d", ret); |
1901 OstTrace1( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateVideoList;ret=%d", ret ); |
|
1766 ret = rep->Get( KAutoCreateVideoFullscreen, videoFull ); |
1902 ret = rep->Get( KAutoCreateVideoFullscreen, videoFull ); |
1767 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoFullscreen %d", ret); |
1903 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateVideoFullscreen %d", ret); |
1904 OstTrace1( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateVideoFullscreen;ret=%d", ret ); |
|
1768 ret = rep->Get( KAutoCreateAudioGrid, audioGrid ); |
1905 ret = rep->Get( KAutoCreateAudioGrid, audioGrid ); |
1769 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioGrid %d", ret); |
1906 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioGrid %d", ret); |
1907 OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateAudioGrid;ret=%d", ret ); |
|
1770 ret = rep->Get( KAutoCreateAudioList, audioList ); |
1908 ret = rep->Get( KAutoCreateAudioList, audioList ); |
1771 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioList %d", ret); |
1909 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioList %d", ret); |
1910 OstTrace1( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateAudioList;ret=%d", ret ); |
|
1772 ret = rep->Get( KAutoCreateAudioFullscreen, audioFull ); |
1911 ret = rep->Get( KAutoCreateAudioFullscreen, audioFull ); |
1773 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioFullscreen %d", ret); |
1912 TN_DEBUG2( "CThumbAGProcessor::CheckAutoCreateValuesL() KAutoCreateAudioFullscreen %d", ret); |
1913 OstTrace1( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_CHECKAUTOCREATEVALUESL, "CThumbAGProcessor::CheckAutoCreateValuesL - KAutoCreateAudioFullscreen;ret=%d", ret ); |
|
1774 |
1914 |
1775 iAutoImage = EFalse; |
1915 iAutoImage = EFalse; |
1776 iAutoVideo = EFalse; |
1916 iAutoVideo = EFalse; |
1777 iAutoAudio = EFalse; |
1917 iAutoAudio = EFalse; |
1778 |
1918 |
1802 #else |
1942 #else |
1803 void CThumbAGProcessor::RemoveFromQueues( const RArray<TItemId>& aIDArray, const TBool /*aRemoveFromDelete*/ ) |
1943 void CThumbAGProcessor::RemoveFromQueues( const RArray<TItemId>& aIDArray, const TBool /*aRemoveFromDelete*/ ) |
1804 #endif |
1944 #endif |
1805 { |
1945 { |
1806 TN_DEBUG2( "CThumbAGProcessor::RemoveFromQueues() aRemoveFromDelete == %d - begin", aRemoveFromDelete ); |
1946 TN_DEBUG2( "CThumbAGProcessor::RemoveFromQueues() aRemoveFromDelete == %d - begin", aRemoveFromDelete ); |
1947 #ifdef _DEBUG |
|
1948 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - aRemoveFromDelete;aRemoveFromDelete=%d", aRemoveFromDelete ); |
|
1949 #else |
|
1950 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - aRemoveFromDelete" ); |
|
1951 #endif |
|
1807 |
1952 |
1808 TInt itemIndex(KErrNotFound); |
1953 TInt itemIndex(KErrNotFound); |
1809 |
1954 |
1810 for (int i=0; i< aIDArray.Count(); i++) |
1955 for (int i=0; i< aIDArray.Count(); i++) |
1811 { |
1956 { |
1812 TThumbnailGenerationItem item; |
1957 TThumbnailGenerationItem item; |
1813 item.iItemId = aIDArray[i]; |
1958 item.iItemId = aIDArray[i]; |
1814 TN_DEBUG2( "CThumbAGProcessor::RemoveFromQueues() - %d", aIDArray[i]); |
1959 TN_DEBUG2( "CThumbAGProcessor::RemoveFromQueues() - %d", aIDArray[i]); |
1960 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues;aIDArray[i]=%u", aIDArray[i] ); |
|
1815 |
1961 |
1816 itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
1962 itemIndex = iGenerationQueue.FindInOrder(item, Compare); |
1817 if(itemIndex >= 0) |
1963 if(itemIndex >= 0) |
1818 { |
1964 { |
1819 delete iGenerationQueue[itemIndex].iUri; |
1965 delete iGenerationQueue[itemIndex].iUri; |
1820 iGenerationQueue[itemIndex].iUri = NULL; |
1966 iGenerationQueue[itemIndex].iUri = NULL; |
1821 iGenerationQueue.Remove(itemIndex); |
1967 iGenerationQueue.Remove(itemIndex); |
1822 TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iGenerationQueue" ); |
1968 TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iGenerationQueue" ); |
1969 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - iGenerationQueue" ); |
|
1823 } |
1970 } |
1824 |
1971 |
1825 itemIndex = iQueryQueue.FindInOrder(aIDArray[i], CompareId); |
1972 itemIndex = iQueryQueue.FindInOrder(aIDArray[i], CompareId); |
1826 if(itemIndex >= 0) |
1973 if(itemIndex >= 0) |
1827 { |
1974 { |
1828 iQueryQueue.Remove(itemIndex); |
1975 iQueryQueue.Remove(itemIndex); |
1829 TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iQueryQueue" ); |
1976 TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - iQueryQueue" ); |
1977 OstTrace0( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - iQueryQueue" ); |
|
1830 } |
1978 } |
1831 } |
1979 } |
1832 |
1980 |
1833 ActivateAO(); |
1981 ActivateAO(); |
1834 |
1982 |
1835 TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - end" ); |
1983 TN_DEBUG1( "CThumbAGProcessor::RemoveFromQueues() - end" ); |
1984 OstTrace0( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_REMOVEFROMQUEUES, "CThumbAGProcessor::RemoveFromQueues - end" ); |
|
1836 } |
1985 } |
1837 |
1986 |
1838 // --------------------------------------------------------------------------- |
1987 // --------------------------------------------------------------------------- |
1839 // CThumbAGProcessor::SetForceRun() |
1988 // CThumbAGProcessor::SetForceRun() |
1840 // --------------------------------------------------------------------------- |
1989 // --------------------------------------------------------------------------- |
1841 // |
1990 // |
1842 void CThumbAGProcessor::SetForceRun( const TBool aForceRun) |
1991 void CThumbAGProcessor::SetForceRun( const TBool aForceRun) |
1843 { |
1992 { |
1844 TN_DEBUG2( "CThumbAGProcessor::SetForceRun(%d) - end", aForceRun ); |
1993 TN_DEBUG2( "CThumbAGProcessor::SetForceRun(%d) - end", aForceRun ); |
1994 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_SETFORCERUN, "CThumbAGProcessor::SetForceRun - end;aForceRun=%u", aForceRun ); |
|
1845 |
1995 |
1846 // enable forced run |
1996 // enable forced run |
1847 iForceRun = aForceRun; |
1997 iForceRun = aForceRun; |
1848 } |
1998 } |
1849 |
1999 |
1852 // --------------------------------------------------------------------------- |
2002 // --------------------------------------------------------------------------- |
1853 // |
2003 // |
1854 void CThumbAGProcessor::QueryAllItemsL() |
2004 void CThumbAGProcessor::QueryAllItemsL() |
1855 { |
2005 { |
1856 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL" ); |
2006 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL" ); |
2007 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL" ); |
|
1857 |
2008 |
1858 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryAllItemsL() !iMdeSession "), KErrBadHandle)); |
2009 __ASSERT_DEBUG((iMdESession), User::Panic(_L("CThumbAGProcessor::QueryAllItemsL() !iMdeSession "), KErrBadHandle)); |
1859 |
2010 |
1860 if(!iMdESession) |
2011 if(!iMdESession) |
1861 { |
2012 { |
1865 if( iQueryAllItems ) |
2016 if( iQueryAllItems ) |
1866 { |
2017 { |
1867 if( !iQueryAllItems->IsComplete() ) |
2018 if( !iQueryAllItems->IsComplete() ) |
1868 { |
2019 { |
1869 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL active- skip" ); |
2020 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL active- skip" ); |
2021 OstTrace0( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL - active- skip" ); |
|
1870 return; |
2022 return; |
1871 } |
2023 } |
1872 |
2024 |
1873 // delete old query |
2025 // delete old query |
1874 iQueryAllItems->Cancel(); |
2026 iQueryAllItems->Cancel(); |
1875 delete iQueryAllItems; |
2027 delete iQueryAllItems; |
1876 iQueryAllItems = NULL; |
2028 iQueryAllItems = NULL; |
1877 } |
2029 } |
1878 |
2030 |
1879 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL - start" ); |
2031 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL - start" ); |
2032 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL -start" ); |
|
1880 |
2033 |
1881 CMdEObjectDef& imageObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject ); |
2034 CMdEObjectDef& imageObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Image::KImageObject ); |
1882 CMdEObjectDef& videoObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Video::KVideoObject ); |
2035 CMdEObjectDef& videoObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Video::KVideoObject ); |
1883 CMdEObjectDef& audioObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Audio::KAudioObject ); |
2036 CMdEObjectDef& audioObjDef = iDefNamespace->GetObjectDefL( MdeConstants::Audio::KAudioObject ); |
1884 |
2037 |
1897 CleanupStack::PushL( &videoObjectCondition ); |
2050 CleanupStack::PushL( &videoObjectCondition ); |
1898 |
2051 |
1899 CMdEObjectCondition& audioObjectCondition = rootCondition.AddObjectConditionL(audioObjDef); |
2052 CMdEObjectCondition& audioObjectCondition = rootCondition.AddObjectConditionL(audioObjDef); |
1900 CleanupStack::PushL( &audioObjectCondition ); |
2053 CleanupStack::PushL( &audioObjectCondition ); |
1901 |
2054 |
1902 iQueryAllItems->FindL(KMaxTInt, KMaxQueryBatchSize); |
2055 iQueryAllItems->FindL(KMdEQueryDefaultMaxCount, KMaxQueryBatchSize); |
1903 |
2056 |
1904 CleanupStack::Pop(3, &imageObjectCondition); |
2057 CleanupStack::Pop(3, &imageObjectCondition); |
1905 |
2058 |
1906 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL - end" ); |
2059 TN_DEBUG1( "CThumbAGProcessor::QueryAllItemsL - end" ); |
2060 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_QUERYALLITEMSL, "CThumbAGProcessor::QueryAllItemsL" ); |
|
1907 } |
2061 } |
1908 |
2062 |
1909 // ----------------------------------------------------------------------------- |
2063 // ----------------------------------------------------------------------------- |
1910 // CThumbAGProcessor::HandleCollectionMessage |
2064 // CThumbAGProcessor::HandleCollectionMessage |
1911 // From MMPXCollectionObserver |
2065 // From MMPXCollectionObserver |
1920 } |
2074 } |
1921 |
2075 |
1922 TMPXMessageId generalId( *aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ) ); |
2076 TMPXMessageId generalId( *aMessage->Value<TMPXMessageId>( KMPXMessageGeneralId ) ); |
1923 |
2077 |
1924 TN_DEBUG2( "CThumbAGProcessor::HandleCollectionMessage KMPXMessageGeneralId=%d", generalId); |
2078 TN_DEBUG2( "CThumbAGProcessor::HandleCollectionMessage KMPXMessageGeneralId=%d", generalId); |
2079 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - KMPXMessageGeneralId;generalId=%u", generalId ); |
|
1925 |
2080 |
1926 //we are interestead of only general system events |
2081 //we are interestead of only general system events |
1927 if ( generalId == KMPXMessageGeneral ) |
2082 if ( generalId == KMPXMessageGeneral ) |
1928 { |
2083 { |
1929 TInt event( *aMessage->Value<TInt>( KMPXMessageGeneralEvent ) ); |
2084 TInt event( *aMessage->Value<TInt>( KMPXMessageGeneralEvent ) ); |
1930 TInt op( *aMessage->Value<TInt>( KMPXMessageGeneralType ) ); |
2085 TInt op( *aMessage->Value<TInt>( KMPXMessageGeneralType ) ); |
1931 TN_DEBUG3( "CThumbAGProcessor::HandleCollectionMessage KMPXMessageGeneralEvent=%d", event, op); |
2086 TN_DEBUG3( "CThumbAGProcessor::HandleCollectionMessage KMPXMessageGeneralEvent=%d", event, op); |
2087 OstTraceExt2( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - KMPXMessageGeneralEvent;event=%d;op=%d", event, op ); |
|
1932 if ( event == TMPXCollectionMessage::EBroadcastEvent ) |
2088 if ( event == TMPXCollectionMessage::EBroadcastEvent ) |
1933 { |
2089 { |
1934 switch( op ) |
2090 switch( op ) |
1935 { |
2091 { |
1936 //when MTP sync or music collection is started then pause processing |
2092 //when MTP sync or music collection is started then pause processing |
1937 case EMcMsgRefreshStart: |
2093 case EMcMsgRefreshStart: |
1938 case EMcMsgUSBMTPStart: |
2094 case EMcMsgUSBMTPStart: |
1939 TN_DEBUG1("CThumbAGProcessor::HandleCollectionMessage MPX refresh started" ); |
2095 TN_DEBUG1("CThumbAGProcessor::HandleCollectionMessage MPX refresh started" ); |
2096 OstTrace0( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - MPX refresh started" ); |
|
1940 iMPXHarvesting = ETrue; |
2097 iMPXHarvesting = ETrue; |
1941 CancelTimeout(); |
2098 CancelTimeout(); |
1942 break; |
2099 break; |
1943 //when MTP sync or music collection refresh is complete then resume processing |
2100 //when MTP sync or music collection refresh is complete then resume processing |
1944 case EMcMsgRefreshEnd: |
2101 case EMcMsgRefreshEnd: |
1945 case EMcMsgUSBMTPEnd: |
2102 case EMcMsgUSBMTPEnd: |
1946 case EMcMsgUSBMTPNotActive: |
2103 case EMcMsgUSBMTPNotActive: |
1947 TN_DEBUG1("CThumbAGProcessor::HandleCollectionMessage MPX refresh finished/not active" ); |
2104 TN_DEBUG1("CThumbAGProcessor::HandleCollectionMessage MPX refresh finished/not active" ); |
2105 OstTrace0( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - MPX refresh finished/not active" ); |
|
1948 iMPXHarvesting = EFalse; |
2106 iMPXHarvesting = EFalse; |
1949 StartTimeout(); |
2107 StartTimeout(); |
1950 break; |
2108 break; |
1951 default: |
2109 default: |
1952 break; |
2110 break; |
1961 { |
2119 { |
1962 RProperty::Set(KTAGDPSNotification, KMPXHarvesting, EFalse); |
2120 RProperty::Set(KTAGDPSNotification, KMPXHarvesting, EFalse); |
1963 } |
2121 } |
1964 |
2122 |
1965 TN_DEBUG3( "CThumbAGProcessor::HandleCollectionMessage -- end() iHarvesting == %d, iMPXHarvesting == %d", iHarvesting, iMPXHarvesting); |
2123 TN_DEBUG3( "CThumbAGProcessor::HandleCollectionMessage -- end() iHarvesting == %d, iMPXHarvesting == %d", iHarvesting, iMPXHarvesting); |
2124 OstTraceExt2( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_HANDLECOLLECTIONMESSAGE, "CThumbAGProcessor::HandleCollectionMessage - end;iHarvesting=%u;iMPXHarvesting=%u", iHarvesting, iMPXHarvesting ); |
|
1966 } |
2125 } |
1967 } |
2126 } |
1968 } |
2127 } |
1969 |
2128 |
1970 // ----------------------------------------------------------------------------- |
2129 // ----------------------------------------------------------------------------- |
2006 // ----------------------------------------------------------------------------- |
2165 // ----------------------------------------------------------------------------- |
2007 // |
2166 // |
2008 void CThumbAGProcessor::ActivityChanged(const TBool aActive) |
2167 void CThumbAGProcessor::ActivityChanged(const TBool aActive) |
2009 { |
2168 { |
2010 TN_DEBUG2( "void CThumbAGProcessor::ActivityChanged() aActive == %d", aActive); |
2169 TN_DEBUG2( "void CThumbAGProcessor::ActivityChanged() aActive == %d", aActive); |
2170 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_ACTIVITYCHANGED, "CThumbAGProcessor::ActivityChanged" ); |
|
2011 if(aActive) |
2171 if(aActive) |
2012 { |
2172 { |
2013 iIdle = EFalse; |
2173 iIdle = EFalse; |
2014 } |
2174 } |
2015 else |
2175 else |
2030 // --------------------------------------------------------------------------- |
2190 // --------------------------------------------------------------------------- |
2031 // |
2191 // |
2032 void CThumbAGProcessor::FormatNotification( TBool aFormat ) |
2192 void CThumbAGProcessor::FormatNotification( TBool aFormat ) |
2033 { |
2193 { |
2034 TN_DEBUG2( "CThumbAGProcessor::FormatNotification(%d)", aFormat ); |
2194 TN_DEBUG2( "CThumbAGProcessor::FormatNotification(%d)", aFormat ); |
2195 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_FORMATNOTIFICATION, "CThumbAGProcessor::FormatNotification;aFormat=%u", aFormat ); |
|
2035 |
2196 |
2036 iFormatting = aFormat; |
2197 iFormatting = aFormat; |
2037 |
2198 |
2038 if(!aFormat) |
2199 if(!aFormat) |
2039 { |
2200 { |
2049 // --------------------------------------------------------------------------- |
2210 // --------------------------------------------------------------------------- |
2050 // |
2211 // |
2051 void CThumbAGProcessor::RPropertyNotification(const TInt aError, const TUid aKeyCategory, const TUint aPropertyKey, const TInt aValue) |
2212 void CThumbAGProcessor::RPropertyNotification(const TInt aError, const TUid aKeyCategory, const TUint aPropertyKey, const TInt aValue) |
2052 { |
2213 { |
2053 TN_DEBUG5( "CThumbAGProcessor::RPropertyNotification() aError = %d, aPropertyKey = %d, aKeyCategory = %d, aValue = %d", aError, aPropertyKey, aKeyCategory, aValue ); |
2214 TN_DEBUG5( "CThumbAGProcessor::RPropertyNotification() aError = %d, aPropertyKey = %d, aKeyCategory = %d, aValue = %d", aError, aPropertyKey, aKeyCategory, aValue ); |
2215 OstTraceExt2( TRACE_NORMAL, CTHUMBAGPROCESSOR_RPROPERTYNOTIFICATION, "CThumbAGProcessor::RPropertyNotification;aPropertyKey=%u;aValue=%d", aPropertyKey, aValue ); |
|
2054 |
2216 |
2055 if(aPropertyKey == KForceBackgroundGeneration && aKeyCategory == KTAGDPSNotification ) |
2217 if(aPropertyKey == KForceBackgroundGeneration && aKeyCategory == KTAGDPSNotification ) |
2056 { |
2218 { |
2057 if( aValue == 1 && aError == KErrNone ) |
2219 if( aValue == 1 && aError == KErrNone ) |
2058 { |
2220 { |
2088 TInt ret = RProperty::Define(KTAGDPSNotification, KDaemonProcessing, RProperty::EInt); |
2250 TInt ret = RProperty::Define(KTAGDPSNotification, KDaemonProcessing, RProperty::EInt); |
2089 |
2251 |
2090 if( ret != KErrNone ) |
2252 if( ret != KErrNone ) |
2091 { |
2253 { |
2092 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() define KDaemonProcessing ret = %d", ret); |
2254 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() define KDaemonProcessing ret = %d", ret); |
2255 OstTrace1( TRACE_NORMAL, CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - define KDaemonProcessing;ret=%d", ret ); |
|
2093 } |
2256 } |
2094 |
2257 |
2095 ret = RProperty::Define(KTAGDPSNotification, KItemsleft, RProperty::EInt); |
2258 ret = RProperty::Define(KTAGDPSNotification, KItemsleft, RProperty::EInt); |
2096 |
2259 |
2097 if( ret != KErrNone ) |
2260 if( ret != KErrNone ) |
2098 { |
2261 { |
2099 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() define KItemsleft ret = %d", ret); |
2262 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() define KItemsleft ret = %d", ret); |
2263 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - define KItemsleft;ret=%d", ret ); |
|
2100 } |
2264 } |
2101 } |
2265 } |
2102 |
2266 |
2103 // set itemsleft = KErrNotReady (-18) and daemonProcessing = ETrue if |
2267 // set itemsleft = KErrNotReady (-18) and daemonProcessing = ETrue if |
2104 // - key is initalized |
2268 // - key is initalized |
2116 { |
2280 { |
2117 itemsLeft = iAddItemCount + iModifyItemCount; |
2281 itemsLeft = iAddItemCount + iModifyItemCount; |
2118 } |
2282 } |
2119 |
2283 |
2120 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() KItemsleft == %d", itemsLeft); |
2284 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() KItemsleft == %d", itemsLeft); |
2285 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues;itemsLeft=%d", itemsLeft ); |
|
2121 |
2286 |
2122 //cancel 2nd round generarion when there is items in 1st round queues |
2287 //cancel 2nd round generarion when there is items in 1st round queues |
2123 if(iAddItemCount && i2ndRound) |
2288 if(iAddItemCount && i2ndRound) |
2124 { |
2289 { |
2125 DeleteAndCancelQuery(ETrue); |
2290 DeleteAndCancelQuery(ETrue); |
2136 } |
2301 } |
2137 |
2302 |
2138 if( daemonProcessing != iPreviousDaemonProcessing) |
2303 if( daemonProcessing != iPreviousDaemonProcessing) |
2139 { |
2304 { |
2140 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() update KDaemonProcessing == %d", daemonProcessing); |
2305 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() update KDaemonProcessing == %d", daemonProcessing); |
2306 OstTrace1( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - update KDaemonProcessing;daemonProcessing=%u", daemonProcessing ); |
|
2141 iPreviousDaemonProcessing = daemonProcessing; |
2307 iPreviousDaemonProcessing = daemonProcessing; |
2142 TInt ret = RProperty::Set(KTAGDPSNotification, KDaemonProcessing, daemonProcessing); |
2308 TInt ret = RProperty::Set(KTAGDPSNotification, KDaemonProcessing, daemonProcessing); |
2143 |
2309 |
2144 if(ret != KErrNone ) |
2310 if(ret != KErrNone ) |
2145 { |
2311 { |
2146 TN_DEBUG3( "CThumbAGProcessor::UpdatePSValues() set KDaemonProcessing %d failed %d", daemonProcessing, ret); |
2312 TN_DEBUG3( "CThumbAGProcessor::UpdatePSValues() set KDaemonProcessing %d failed %d", daemonProcessing, ret); |
2147 } |
2313 OstTraceExt2( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - set KDaemonProcessing;daemonProcessing=%u;ret=%d", daemonProcessing, ret ); |
2148 } |
2314 } |
2149 |
2315 } |
2316 |
|
2317 TInt ret = RProperty::Get(KTAGDPSNotification, KItemsleft, iPreviousItemsLeft ); |
|
2150 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() iPreviousItemsLeft == %d", iPreviousItemsLeft); |
2318 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() iPreviousItemsLeft == %d", iPreviousItemsLeft); |
2319 OstTrace1( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues;iPreviousItemsLeft=%d", iPreviousItemsLeft ); |
|
2151 |
2320 |
2152 if( itemsLeft != iPreviousItemsLeft) |
2321 if( itemsLeft != iPreviousItemsLeft) |
2153 { |
2322 { |
2154 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() Set KItemsleft == %d", itemsLeft); |
2323 TN_DEBUG2( "CThumbAGProcessor::UpdatePSValues() Set KItemsleft == %d", itemsLeft); |
2324 OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - Set KItemsleft;itemsLeft=%d", itemsLeft ); |
|
2155 iPreviousItemsLeft = itemsLeft; |
2325 iPreviousItemsLeft = itemsLeft; |
2156 TInt ret = RProperty::Set(KTAGDPSNotification, KItemsleft, itemsLeft ); |
2326 TInt ret = RProperty::Set(KTAGDPSNotification, KItemsleft, itemsLeft ); |
2157 |
2327 |
2158 if(ret != KErrNone ) |
2328 if(ret != KErrNone ) |
2159 { |
2329 { |
2160 TN_DEBUG3( "CThumbAGProcessor::UpdatePSValues() set KItemsleft %d failed %d", itemsLeft, ret); |
2330 TN_DEBUG3( "CThumbAGProcessor::UpdatePSValues() set KItemsleft %d failed %d", itemsLeft, ret); |
2331 OstTraceExt2( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_UPDATEPSVALUES, "CThumbAGProcessor::UpdatePSValues - set KItemsleft failed;itemsLeft=%d;ret=%d", itemsLeft, ret ); |
|
2161 } |
2332 } |
2162 } |
2333 } |
2163 |
2334 |
2164 } |
2335 } |
2165 |
2336 |
2180 } |
2351 } |
2181 |
2352 |
2182 void CThumbAGProcessor::UpdateItemCounts() |
2353 void CThumbAGProcessor::UpdateItemCounts() |
2183 { |
2354 { |
2184 TN_DEBUG1( "CThumbAGProcessor::UpdateItemCounts()"); |
2355 TN_DEBUG1( "CThumbAGProcessor::UpdateItemCounts()"); |
2356 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts" ); |
|
2185 iModifyItemCount = 0; |
2357 iModifyItemCount = 0; |
2186 iDeleteItemCount = 0; |
2358 iDeleteItemCount = 0; |
2187 iAddItemCount = 0; |
2359 iAddItemCount = 0; |
2188 iUnknownItemCount = 0; |
2360 iUnknownItemCount = 0; |
2189 i2ndAddItemCount = 0; |
2361 i2ndAddItemCount = 0; |
2241 } |
2413 } |
2242 } |
2414 } |
2243 |
2415 |
2244 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iActiveCount = %d", |
2416 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iActiveCount = %d", |
2245 iActiveCount); |
2417 iActiveCount); |
2418 OstTrace1( TRACE_NORMAL, DUP1_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts - iActiveCount;iActiveCount=%u", iActiveCount ); |
|
2246 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iPreviousItemsLeft = %d", |
2419 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iPreviousItemsLeft = %d", |
2247 iPreviousItemsLeft); |
2420 iPreviousItemsLeft); |
2421 OstTrace1( TRACE_NORMAL, DUP2_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iPreviousItemsLeft=%d", iPreviousItemsLeft ); |
|
2248 TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iHarvesting == %d, iMMCHarvesting == %d, iPHHarvesting == %d, iMPXHarvesting == %d", |
2422 TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iHarvesting == %d, iMMCHarvesting == %d, iPHHarvesting == %d, iMPXHarvesting == %d", |
2249 iHarvesting, iMMCHarvesting, iPHHarvesting, iMPXHarvesting); |
2423 iHarvesting, iMMCHarvesting, iPHHarvesting, iMPXHarvesting); |
2424 OstTraceExt4( TRACE_NORMAL, DUP3_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iHarvesting=%d;iMMCHarvesting=%d;iPHHarvesting=%d;iMPXHarvesting=%d", |
|
2425 iHarvesting, iMMCHarvesting, iPHHarvesting, iMPXHarvesting ); |
|
2426 |
|
2250 TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iIdle = %d, iForegroundRun = %d, timer = %d, iForceRun = %d", |
2427 TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iIdle = %d, iForegroundRun = %d, timer = %d, iForceRun = %d", |
2251 iIdle, iForegroundRun, iPeriodicTimer->IsActive(), iForceRun); |
2428 iIdle, iForegroundRun, iPeriodicTimer->IsActive(), iForceRun); |
2429 OstTraceExt4( TRACE_NORMAL, DUP4_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iIdle=%d;iForegroundRun=%d;iPeriodicTimer->IsActive()=%d;iForceRun=%d", |
|
2430 iIdle, iForegroundRun, iPeriodicTimer->IsActive(), iForceRun ); |
|
2431 |
|
2252 TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iModify = %d, iQueryReady = %d, iProcessingCount = %d", |
2432 TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iModify = %d, iQueryReady = %d, iProcessingCount = %d", |
2253 iModify, iQueryReady, iProcessingCount); |
2433 iModify, iQueryReady, iProcessingCount); |
2434 OstTraceExt2( TRACE_NORMAL, DUP5_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iModify=%u;iQueryReady=%u", |
|
2435 iModify, iQueryReady ); |
|
2436 OstTrace1( TRACE_NORMAL, DUP12_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iProcessingCount=%u", iProcessingCount ); |
|
2254 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iMountTimer = %d", iMountTimer->IsActive()); |
2437 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iMountTimer = %d", iMountTimer->IsActive()); |
2438 OstTrace1( TRACE_NORMAL, DUP6_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iMountTimer->IsActive()=%u", iMountTimer->IsActive() ); |
|
2255 TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() iGenerationQueue = %d, iQueryQueue = %d", |
2439 TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() iGenerationQueue = %d, iQueryQueue = %d", |
2256 iGenerationQueue.Count(), iQueryQueue.Count()); |
2440 iGenerationQueue.Count(), iQueryQueue.Count()); |
2441 OstTraceExt2( TRACE_NORMAL, DUP7_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iGenerationQueue.Count()=%d;iQueryQueue.Count()=%d", iGenerationQueue.Count(), iQueryQueue.Count() ); |
|
2257 TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iAddItemCount=%d, i2ndAddItemCount=%d, iModifyItemCount=%d, iDeleteItemCount=%d", |
2442 TN_DEBUG5( "CThumbAGProcessor::UpdateItemCounts() iAddItemCount=%d, i2ndAddItemCount=%d, iModifyItemCount=%d, iDeleteItemCount=%d", |
2258 iAddItemCount, i2ndAddItemCount, iModifyItemCount, iDeleteItemCount ); |
2443 iAddItemCount, i2ndAddItemCount, iModifyItemCount, iDeleteItemCount ); |
2444 OstTrace0( TRACE_NORMAL, DUP8_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts" ); |
|
2259 TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() iUnknownItemCount=%d, iPlaceholderItemCount=%d", |
2445 TN_DEBUG3( "CThumbAGProcessor::UpdateItemCounts() iUnknownItemCount=%d, iPlaceholderItemCount=%d", |
2260 iUnknownItemCount, iPlaceholderItemCount); |
2446 iUnknownItemCount, iPlaceholderItemCount); |
2447 OstTraceExt2( TRACE_NORMAL, DUP9_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iUnknownItemCount=%d;iPlaceholderItemCount=%d", iUnknownItemCount, iPlaceholderItemCount ); |
|
2261 TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iAudioItemCount=%d, iVideoItemCount=%d, iImageItemCount=%d", |
2448 TN_DEBUG4( "CThumbAGProcessor::UpdateItemCounts() iAudioItemCount=%d, iVideoItemCount=%d, iImageItemCount=%d", |
2262 iAudioItemCount, iVideoItemCount, iImageItemCount); |
2449 iAudioItemCount, iVideoItemCount, iImageItemCount); |
2450 OstTraceExt3( TRACE_NORMAL, DUP10_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iAudioItemCount=%u;iVideoItemCount=%d;iImageItemCount=%d", |
|
2451 iAudioItemCount, iVideoItemCount, iImageItemCount ); |
|
2452 |
|
2263 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iCameraItemCount=%d", iCameraItemCount); |
2453 TN_DEBUG2( "CThumbAGProcessor::UpdateItemCounts() iCameraItemCount=%d", iCameraItemCount); |
2454 OstTrace1( TRACE_NORMAL, DUP11_CTHUMBAGPROCESSOR_UPDATEITEMCOUNTS, "CThumbAGProcessor::UpdateItemCounts;iCameraItemCount=%d", iCameraItemCount ); |
|
2264 |
2455 |
2265 //compress queues when empty |
2456 //compress queues when empty |
2266 if(!iGenerationQueue.Count()) |
2457 if(!iGenerationQueue.Count()) |
2267 { |
2458 { |
2268 iGenerationQueue.Compress(); |
2459 iGenerationQueue.Compress(); |
2280 // --------------------------------------------------------------------------- |
2471 // --------------------------------------------------------------------------- |
2281 // |
2472 // |
2282 TInt CThumbAGProcessor::MountTimerCallBack(TAny* aAny) |
2473 TInt CThumbAGProcessor::MountTimerCallBack(TAny* aAny) |
2283 { |
2474 { |
2284 TN_DEBUG1( "CThumbAGProcessor::MountTimerCallBack()"); |
2475 TN_DEBUG1( "CThumbAGProcessor::MountTimerCallBack()"); |
2476 OstTrace0( TRACE_NORMAL, CTHUMBAGPROCESSOR_MOUNTTIMERCALLBACK, "CThumbAGProcessor::MountTimerCallBack" ); |
|
2285 CThumbAGProcessor* self = static_cast<CThumbAGProcessor*>( aAny ); |
2477 CThumbAGProcessor* self = static_cast<CThumbAGProcessor*>( aAny ); |
2286 |
2478 |
2287 self->iMountTimer->Cancel(); |
2479 self->iMountTimer->Cancel(); |
2288 |
2480 |
2289 //activate timeout if overall or mmc harvestig is not active |
2481 //activate timeout if overall or mmc harvestig is not active |
2314 aGenerationItem.iItemAction = EGenerationItemActionAdd; |
2506 aGenerationItem.iItemAction = EGenerationItemActionAdd; |
2315 break; |
2507 break; |
2316 case EGenerationItemTypeVideo: |
2508 case EGenerationItemTypeVideo: |
2317 //S^3 EGenerationItemActionAdd |
2509 //S^3 EGenerationItemActionAdd |
2318 //S^4 EGenerationItemAction2ndAdd |
2510 //S^4 EGenerationItemAction2ndAdd |
2319 aGenerationItem.iItemAction = EGenerationItemActionAdd; |
2511 aGenerationItem.iItemAction = EGenerationItemAction2ndAdd; |
2320 break; |
2512 break; |
2321 default: |
2513 default: |
2322 aGenerationItem.iItemAction = EGenerationItemActionResolveType; |
2514 aGenerationItem.iItemAction = EGenerationItemActionResolveType; |
2323 } |
2515 } |
2324 } |
2516 } |