Thank You wizard_hu_
I include MultimediaDD capability and set 63 priority, using this getting -1 error.
My code
Code:
void CCameraWrapperExampleAppView::SizeChanged()
{
// Create camera wrapper class here because
// whole camera wrapper and all handles have to reset
// while orientatio of the application changes.
if (iCameraWrapper)
{
// Power off camera if it is on
iCameraWrapper->StopViewFinder();
iCameraWrapper->ReleaseAndPowerOff();
delete iCameraWrapper; iCameraWrapper = NULL;
}
TInt camErr(KErrNotSupported);
if(CCameraEngine::CamerasAvailable() > 0)
{
//TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(0,0,this));
TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(1,63,this));
}
// iViewFinderSize is picture size for viewfinder.
// iCaptureSize is picture size for capturing picture.
// We want fill whole screen
if (Rect().Size().iWidth > Rect().Size().iHeight)
{
iViewFinderSize = TSize(Rect().Size().iWidth,Rect().Size().iWidth);
iCaptureSize = TSize(1280,960); // Captured picture size
}
else
{
iViewFinderSize = TSize(Rect().Size().iHeight,Rect().Size().iHeight);
iCaptureSize = TSize(1280,960); // Captured picture size
}
// Focus rectangle
iFocusRect = Rect();
iFocusRect.Shrink(Rect().Size().iWidth/4, Rect().Size().iHeight/4);
// Create back buffer where recieved camera pictures are copied
ReleaseBackBuffer();
CreateBackBufferL();
// Power on camera, start viewfinder when MceoCameraReady() received
if(camErr == KErrNone)
{
iCameraWrapper->ReserveAndPowerOn();
SetTitle(_L("Camera power on"));
}
else
{
SetTitle(_L("no camera found"));
}
}
Regards,
SymbianTH