92 iIsColorConversionNeeded(EFalse), |
92 iIsColorConversionNeeded(EFalse), |
93 iSurfaceCreatedEventPublished(EFalse), |
93 iSurfaceCreatedEventPublished(EFalse), |
94 iOverflowPictureCounter(0), |
94 iOverflowPictureCounter(0), |
95 iVideoFrameBufSize(0), |
95 iVideoFrameBufSize(0), |
96 iResourceLost(EFalse), |
96 iResourceLost(EFalse), |
|
97 iRedrawDone(EFalse), |
97 iVBMObserver(NULL), |
98 iVBMObserver(NULL), |
98 count(0), |
99 count(0), |
99 iSurfaceMask(surfaceHints::EAllowAllExternals), |
100 iSurfaceMask(surfaceHints::EAllowAllExternals), |
100 iSurfaceKey(TUid::Uid(surfaceHints::KSurfaceProtection)), |
101 iSurfaceKey(TUid::Uid(surfaceHints::KSurfaceProtection)), |
101 iVideoSurfaceObserver(NULL), |
102 iVideoSurfaceObserver(NULL), |
824 |
825 |
825 void CNGAPostProcHwDevice::Redraw() |
826 void CNGAPostProcHwDevice::Redraw() |
826 { |
827 { |
827 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw ++"), this); |
828 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw ++"), this); |
828 TInt err = KErrNone; |
829 TInt err = KErrNone; |
829 if(iResourceLost) |
830 if(iResourceLost && !iRedrawDone) |
830 { |
831 { |
831 err = AddHints(); |
832 err = AddHints(); |
832 if (err != KErrNone) |
833 if (err != KErrNone) |
833 { |
834 { |
834 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost -- failed to AddHints %d"), |
835 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost -- failed to AddHints %d"), |
835 this, err); |
836 this, err); |
836 iProxy->MdvppFatalError(this, err); |
837 iProxy->MdvppFatalError(this, err); |
837 return; |
838 return; |
838 } |
839 } |
|
840 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw registering the temp surface"), this); |
839 err = RegisterSurface(iSurfaceId); |
841 err = RegisterSurface(iSurfaceId); |
840 if (err != KErrNone) |
842 if (err != KErrNone) |
841 { |
843 { |
842 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost -- failed to Register Surface %d"), |
844 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost -- failed to Register Surface %d"), |
843 this, err); |
845 this, err); |
844 iSurfaceHandler->DestroySurface(iSurfaceId); |
846 iSurfaceHandler->DestroySurface(iSurfaceId); |
845 iSurfaceId = TSurfaceId::CreateNullId(); |
847 iSurfaceId = TSurfaceId::CreateNullId(); |
846 iProxy->MdvppFatalError(this, err); |
848 iProxy->MdvppFatalError(this, err); |
847 return; |
849 return; |
848 } |
850 } |
849 |
851 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw registering the temp surface done"), this); |
850 iSessionManager->PostPicture(iSurfaceId, 0, 1, EFalse); |
852 iSessionManager->PostPicture(iSurfaceId, 0, 1, EFalse); |
851 PublishSurfaceCreated(); |
853 PublishSurfaceCreated(); |
852 iResourceLost = EFalse; |
854 iRedrawDone = ETrue; |
853 } |
855 } |
854 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw --"), this); |
856 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:Redraw --"), this); |
855 } |
857 } |
856 |
858 |
857 void CNGAPostProcHwDevice::Start() |
859 void CNGAPostProcHwDevice::Start() |
1324 // === MMmfVideoResourceObserver === |
1326 // === MMmfVideoResourceObserver === |
1325 |
1327 |
1326 void CNGAPostProcHwDevice::MmvroResourcesLost(TUid ) |
1328 void CNGAPostProcHwDevice::MmvroResourcesLost(TUid ) |
1327 { |
1329 { |
1328 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost ++"), this); |
1330 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost ++"), this); |
1329 iResourceLost = ETrue; |
1331 if(!iResourceLost) |
1330 Pause(); |
1332 { |
1331 ReleaseInputQ(); |
1333 iResourceLost = ETrue; |
1332 iSessionManager->CancelUpdate(); |
1334 iRedrawDone = EFalse; |
1333 ReleaseProcessQ(); |
1335 Pause(); |
1334 iVideoSurfaceObserver->MmvsoRemoveSurface(); |
1336 ReleaseInputQ(); |
|
1337 iSessionManager->CancelUpdate(); |
|
1338 ReleaseProcessQ(); |
|
1339 iVideoSurfaceObserver->MmvsoRemoveSurface(); |
|
1340 } |
|
1341 else if(iResourceLost && iRedrawDone) |
|
1342 { |
|
1343 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost ResourceLost happening \ |
|
1344 while Postprocessor is already in ResourceLoss state"), |
|
1345 this); |
|
1346 iProxy->MdvppFatalError(this, KErrHardwareNotAvailable); |
|
1347 return; |
|
1348 } |
|
1349 else |
|
1350 { |
|
1351 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost Ignoring the \ |
|
1352 duplicate ResourceLoss call"), |
|
1353 this); |
|
1354 } |
1335 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost --"), this); |
1355 PP_DEBUG(_L("CNGAPostProcHwDevice[%x]:MmvroResourcesLost --"), this); |
1336 } |
1356 } |
1337 |
1357 |
1338 // === MMmfVideoPropertiesNotifier === |
1358 // === MMmfVideoPropertiesNotifier === |
1339 |
1359 |