×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    CameraWrapper Prepare Error -5

    Hi,
    I am using the CameraWrapper example with only one addition where i check if there are more than one cameras and if yes then i want to use the front camera.
    Code:
     if(CCameraEngine::CamerasAvailable() > 0)
          {
    		  TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(1,0,this));
          }else{
    		  TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(0,0,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
          
            }
    I get an error "Camera prepare error -5"
    -5 according to my knowledge is Feature not supported.
    My guess is
    TRAPD(err,iCameraWrapper->PrepareL(iCaptureSize));

    Here iCaptureSize value is not supported for the front camera.
    I also tried iCaptureSize = TSize(320,240);
    But same error.
    Experts any Ideas???

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: CameraWrapper Prepare Error -5

    Check the specifications of your device, and try that resolution. The front camera is not a high-res one.

  3. #3
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: CameraWrapper Prepare Error -5

    The specification says 240x320 for the front camera.Tried that also but get error.
    On debugging further i see there is a CameraEngineError happening
    Code:
    void CCamProfileContainer::MceoHandleError( TCameraEngineError aErrorType, TInt aError )
        {
        // NOTE: CameraEngine state seems to go into CCameraEngine::EEngineIdle state
        
        if (aErrorType == EErrReserve)
            {
            return; //-18 comes on application startup, but everything works ok
            }
    
        switch (aErrorType)
            {
            case EErrReserve:
                {
                SetError(_L("Camera reserved error  (%d)"), aError);
                break;
                }
            case EErrPowerOn:
                {
                SetError(_L("Camera power on error  (%d)"), aError);
                break;
                }
            case EErrViewFinderReady:
                {
                SetError(_L("Camera viewfinder error  (%d)"), aError);
                break;
                }
            case EErrImageReady:
                {
                SetError(_L("Camera image ready error  (%d)"), aError);
                break;
                }
            case EErrAutoFocusInit:
            	{
    			SetError(_L("Auto Focus Init error (%d)"), aError);
    			break;
    			}
            case EErrAutoFocusMode:
            	{
    			SetError(_L("Auto Focus Mode error (%d)"), aError);
    			break;
    			}
            case EErrAutoFocusArea:
            	{
    			SetError(_L("Auto Focus Area error (%d)"), aError);
    			break;
    			}
            case EErrAutoFocusRange:
            	{
    			SetError(_L("Auto Focus Range error (%d)"), aError);
    			break;
    			}
            case EErrAutoFocusType:
            	{
    			SetError(_L("Auto Focus Type error (%d)"), aError);
    			break;
    			}
            case EErrOptimisedFocusComplete:
                /*{
                SetTitle(_L("Try focusing again"));
                break;
                }*/
                {
    			SetError(_L("Optimised Focus Complete error (%d)"), aError);
    			break;
    			}
            default:
                {
                SetError(_L("Error %d (%d)"), aErrorType, aError);
                break;
                }
            };
        
        // Try handle error
        CancelCapturedPicture(EFalse);
        UseCaptureBackCbaL();
        }
    I get EErrAutoFocusMode error.
    Can someone please help me to tune the CameraWrapper to work for the front camera and at the same time i would not want to hardcode the resolutions.Is there an access to an enumerator with supported resolutions for the device.

    Regards
    Biju Chandran

  4. #4
    Registered User
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    260

    Re: CameraWrapper Prepare Error -5

    Quote Originally Posted by chandran.biju007 View Post
    Hi,
    I am using the CameraWrapper example with only one addition where i check if there are more than one cameras and if yes then i want to use the front camera.
    Code:
     if(CCameraEngine::CamerasAvailable() > 0)
          {
    		  TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(1,0,this));
          }else{
    		  TRAP(camErr, iCameraWrapper = CCameraEngine::NewL(0,0,this));
          }
    Hi,

    If CCameraEngine::CamerasAvailable() works same way as CCamera's function, it will return 1 if only back camera is supported and 2 if also front camera is available. So, the comparison value for using front camera in the if should be 1, not 0.

    As for getting supported resolutions, depending on CCameraEngine's internal implementation (whether CCamera is instantiated in NewL), it might be possible to get a pointer to its CCamera instance (iCameraWrapper->Camera()) after calling NewL, and calling the its EnumerateCaptureSizes function. The number of resolutions supported is specified by iNumImageSizesSupported field of the instance's TCameraInfo, available via CameraInfo function.

    -TongMuan

  5. #5
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: CameraWrapper Prepare Error -5

    Hi,
    I did this
    Code:
    iCameraWrapper->Camera()->CameraInfo(camInfo);
    iCameraWrapper->Camera()->EnumerateCaptureSizes(iCaptureSize,camInfo.iNumImageSizesSupported,iCameraWrapper->Camera()->EFormatJpeg);
     TRAPD(err,iCameraWrapper->PrepareL(iCaptureSize));
    But still the same error..No change

  6. #6
    Registered User
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    260

    Re: CameraWrapper Prepare Error -5

    Quote Originally Posted by chandran.biju007 View Post
    Hi,
    I did this
    Code:
    iCameraWrapper->Camera()->CameraInfo(camInfo);
    iCameraWrapper->Camera()->EnumerateCaptureSizes(iCaptureSize,camInfo.iNumImageSizesSupported,iCameraWrapper->Camera()->EFormatJpeg);
     TRAPD(err,iCameraWrapper->PrepareL(iCaptureSize));
    But still the same error..No change
    Hi,

    Index iNumImageSizesSupported is out of range, valid values are 0 .. iNumImageSizesSupported-1. The amount of sizes actually available also depends on the format (usually less sizes are available for bitmaps, due to memory limitations), so the safest choice would be using index 0, which is the highest resolution available.

    Also, now that I think of it, the front camera usually doesn't support JPEG or EXIF at all, you may need to capture the images as bitmaps. Check camInfo.iImageFormatsSupported.

    -TongMuan

  7. #7
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: CameraWrapper Prepare Error -5

    Ok..Shall check and let you know about it

  8. #8
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: CameraWrapper Prepare Error -5

    Ok..Now i checked the supported image format and then the size for that.
    As follows:-
    Code:
      iCameraWrapper->Camera()->CameraInfo(camInfo);
        CCamera::TFormat format = ImageFormatMax(camInfo);
          
          for (TUint index = 0; index < camInfo.iNumImageSizesSupported; index++)
      	{
    		iCameraWrapper->Camera()->EnumerateCaptureSizes(iCaptureSize, index, format);
      	    TBuf<50> buffer;
      	    buffer.Append(_L("Res"));
      	    buffer.AppendNum(index);
      	    buffer.Append(_L(": "));
      	    buffer.AppendNum(iCaptureSize.iHeight);
      	    buffer.Append(_L("x"));
      	    buffer.AppendNum(iCaptureSize.iWidth);
      	    CEikonEnv::Static()->InfoWinL(buffer,buffer);
      	}
    where the method is
    Code:
     CCamera::TFormat CCamProfileContainer::ImageFormatMax(TCameraInfo &aInfo)
         {
         if ( aInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor16M )
             {
             return CCamera::EFormatFbsBitmapColor16M;
             }
         else if ( aInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor64K)
             {
             return CCamera::EFormatFbsBitmapColor64K;
             }
         else if ( aInfo.iImageFormatsSupported & CCamera::EFormatFbsBitmapColor4K)
             {
             return CCamera::EFormatFbsBitmapColor4K;
             }
         else if ( aInfo.iImageFormatsSupported & CCamera::EFormatMonochrome)
             {
             return CCamera::EFormatMonochrome;
             }
         else return CCamera::EFormatMonochrome;
         }
    for the front camera
    i Get EFormatFbsBitmapColor16M as the format supported and the capture size as
    240x320 on N78

    But on PrepareLC i get the same error..
    Has anyone tried the front Camera with wrapper.
    Is this a bug by any chance???

  9. #9
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: CameraWrapper Prepare Error -5

    Has no one tried the Wrapper with front camera??
    Champions can you please help me with this

  10. #10
    Registered User
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    260

    Re: CameraWrapper Prepare Error -5

    Quote Originally Posted by chandran.biju007 View Post
    for the front camera
    i Get EFormatFbsBitmapColor16M as the format supported and the capture size as
    240x320 on N78

    But on PrepareLC i get the same error..
    So PrepareL with size hard-coded to 320x240 and format hardcoded to bitmap still gives the same error?

    Code:
    TSize size(320,240);
    iCameraWrapper->PrepareL(size, CCamera::EFormatFbsBitmapColor16M);
    -TongMuan

  11. #11
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: CameraWrapper Prepare Error -5

    Auto Focus Mode Error(-5)

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,684

    Re: CameraWrapper Prepare Error -5

    I do not use this wrapper that is why I have not really followed this discussion. However it can easily happen that the front side camera has no support for advanced features, including any kind focusing.

  13. #13
    Super Contributor
    Join Date
    Nov 2008
    Posts
    675

    Re: CameraWrapper Prepare Error -5

    Hi Wizard,
    The error happens on PrepareL and the focus has not yet reached.
    The viewfinder starts and i can see the images but the error is trapped.

    Regards
    Biju Chandran

Similar Threads

  1. Using CameraWrapper on 5th edition
    By Legendus in forum Symbian
    Replies: 11
    Last Post: 2009-11-08, 00:27
  2. CameraWrapper and Viewfinder Buffering
    By NevenS in forum Symbian Media (Closed)
    Replies: 1
    Last Post: 2009-11-06, 13:06
  3. Camerawrapper: how to get the full resolution of camera?
    By markus_sunela in forum Symbian Media (Closed)
    Replies: 6
    Last Post: 2009-09-18, 04:11
  4. Installation problem of CameraWrapper embedded sis file
    By djscorpion83 in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2009-08-20, 08:23
  5. Replies: 2
    Last Post: 2009-07-13, 09:45

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×