Discussion Board

Results 1 to 12 of 12
  1. #1
    Registered User alexeystoyanov's Avatar
    Join Date
    Oct 2008
    Posts
    19
    I have a camera application which works fine on a 5MP phone, but not at 3MP phone.
    Can you give me any ideas about how to take unique information of different phone platforms especially their sensor info. I know that I cannot get the exact sensor height and width. This will be done probably with one switch deciding which height and width to use according to that unique sensor info.
    I tried with MACRO somedefine in my MMP but then i have to build using different MMP's for different phone platform which is not
    reasonable for me. Compatibility!!!
    Any suggestions?

    Thank you in advance.

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Do you use CCamera::CameraInfo and CCamera::EnumerateCaptureSizes?

  3. #3
    Registered User alexeystoyanov's Avatar
    Join Date
    Oct 2008
    Posts
    19
    I've just tried it but everytime resSizes have resSizes.iHeight = resSizes.iWidth = 0 and can't figure out why is it happening.
    index counts from 0 to 5.
    Code:
    Code:
        TSize resSizes(0, 0);
        Observer observer;
        TCameraInfo info = observer.GetCameraInfo();
        
        for (TUint index = 0; index < info.iNumImageSizesSupported; index++)
    	{
    	    observer.GetCameraC()->EnumerateCaptureSizes(resSizes, index, CCamera::EFormatYUV422);
    	    TBuf<50> buffer;
    	    buffer.Append(_L("Res"));
    	    buffer.AppendNum(index);
    	    buffer.Append(_L(": "));
    	    buffer.AppendNum(resSizes.iHeight);
    	    buffer.Append(_L("x"));
    	    buffer.AppendNum(resSizes.iWidth);
    	    CEikonEnv::Static()->InfoWinL(buffer,buffer);
    	}

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Also check TCamerInfo::iImageFormatsSupported. YUV formats are supported for video recording. For capturing images, you should rather experiment with EFormatFbsBitmapColorXy-s and Jpeg/Exif.

  5. #5
    Registered User alexeystoyanov's Avatar
    Join Date
    Oct 2008
    Posts
    19
    Okay, I've tried something like this:
    Code:
    CCamera::TFormat 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;
        }
    
    ...
    
        CCamera::TFormat format = ImageFormatMax(info);
        
        for (TUint index = 0; index < info.iNumImageSizesSupported; index++)
    	{
    	    observer.GetCameraC()->EnumerateCaptureSizes(resSizes, index, format);
    	    TBuf<50> buffer;
    	    buffer.Append(_L("Res"));
    	    buffer.AppendNum(index);
    	    buffer.Append(_L(": "));
    	    buffer.AppendNum(resSizes.iHeight);
    	    buffer.Append(_L("x"));
    	    buffer.AppendNum(resSizes.iWidth);
    	    CEikonEnv::Static()->InfoWinL(buffer,buffer);
    	}
    ...
    CCamera::EFormatFbsBitmapColor16M is supported. The resolutions suported are :
    Induction on index:
    0: 0x0
    1: 0x0
    2: 0x0
    3: 960x1280
    4: 768x1024
    5: 480x640

    Where is my 2592x1944 ?!?! What's happening?

  6. #6
    Nokia Developer Expert janza's Avatar
    Join Date
    Dec 2003
    Posts
    148
    You should always prefer JPEG/Exif data format for still images. Only subset of image resolutions are normally supported in bitmap format since the memory requirement for example for 5 MPix bitmap would be huge (something like 20 MB with 32-bit bitmap). Also compressed images are normally produced faster by the underlying camera HW, getting a bitmap would take longer. In case you really need the bitmap you should use the smaller resolutions or then decode the higher resolution JPEG (you may easily run out of memory though...)
    janza

  7. #7
    Registered User alexeystoyanov's Avatar
    Join Date
    Oct 2008
    Posts
    19
    You meen I have to use EFormatJpeg ?! Just tried it - all results are 0x0 ?

  8. #8
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Quote Originally Posted by alexeystoyanov View Post
    You meen I have to use EFormatJpeg ?! Just tried it - all results are 0x0 ?
    You have probably forgotten to check TCameraInfo::iImageFormatsSupported first...
    Anyway, you can still try EFormatExif.

  9. #9
    Registered User alexeystoyanov's Avatar
    Join Date
    Oct 2008
    Posts
    19
    Thank you!!! Problem solved!
    Last question: "Is the first resolution: "EnumerateCaptureSizes(resSizes, 0, format);" always the max resolution for still?"
    Last edited by alexeystoyanov; 2009-01-14 at 13:49.

  10. #10
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    According to some resources, yes.

  11. #11
    Nokia Developer Expert janza's Avatar
    Join Date
    Dec 2003
    Posts
    148
    According to Symbian spec EnumerateCaptureSizes() should return supported resolutions ordered by size, biggest first. So index 0 always returns the resolution of biggest image size OR (0,0) in case the biggest size is not supported for that format.
    janza

  12. #12
    Registered User alexeystoyanov's Avatar
    Join Date
    Oct 2008
    Posts
    19
    Thank you! Lock.

Similar Threads

  1. Nokia Gamer (GamR) - concept phone
    By tgm91 in forum General Development Questions
    Replies: 4
    Last Post: 2008-10-01, 21:34
  2. OMA DRM media transfer using PC to Phone using USB
    By venky123 in forum Digital Rights Management & Content Downloading
    Replies: 1
    Last Post: 2008-08-13, 03:02
  3. Replies: 2
    Last Post: 2008-05-17, 23:29
  4. 7610 Contacts - Formatted Phone Numbers
    By padlon in forum General Development Questions
    Replies: 2
    Last Post: 2004-11-12, 18:02

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved