Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User pcsxk's Avatar
    Join Date
    Dec 2010
    Posts
    9
    hi, all
    i want to detect whether having camera flash on board or not on my device. i use the following codes:
    Code:
     
    if( iCameraInfo.iFlashModesSupported & CCamera::EFlashAuto )
        iCamera->SetFlashL(CCamera::EFlashAuto);
    to my surprise, the above will run on 5230 without error, but the viewfinder frame will not show up.
    but it works perfectly on 5800, so i printed the iCameraInfo.iFlashModesSupported integer on 5230 and 5800 respectively, and i got the same integer 139 in decimal. based on that, i guess this apporach could not meet my needs.

    plz tell me how can i know if there is a flash for camera.

  2. #2
    Regular Contributor TongMuan's Avatar
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    166
    Quote Originally Posted by pcsxk View Post
    Code:
     
    if( iCameraInfo.iFlashModesSupported & CCamera::EFlashAuto )
        iCamera->SetFlashL(CCamera::EFlashAuto);
    to my surprise, the above will run on 5230 without error, but the viewfinder frame will not show up.
    but it works perfectly on 5800, so i printed the iCameraInfo.iFlashModesSupported integer on 5230 and 5800 respectively, and i got the same integer 139 in decimal. based on that, i guess this apporach could not meet my needs.
    Hi,

    It sounds like TCameraInfo::iFlashModesSupported is not working correctly. However, have you tried simply TRAPping the call to SetFlashL? SetFlashL leaving with code KErrNotSupported might well be the reason of viewfinder not working, if you request start viewfinder after the call...

    If the TRAP doesn't help, or you really need to know supported flash modes (other than whether EFlashAuto works), you could try handling the flash setting through CCameraAdvancedSettings (FlashModesSupported() and SetFlashMode()). In that case, CCamera needs to be instantited using New2L.

  3. #3
    Registered User pcsxk's Avatar
    Join Date
    Dec 2010
    Posts
    9
    first of all, thank u, TongMuan.
    however, unfortunately, i have to tell you honestly, the hints you metioned were still not working.
    when i
    TRAPping the call to SetFlashL
    on 5230, the phone would become very slow(no response to end user) but without errors occured. it seemed like the phone was doing a great deal of calculate on ui thread.

    as for CCameraAdvancedSettings::FlashModesSupported() and CCameraAdvancedSettings::SetFlashMode, i found they worked the same as TCameraInfo::iFlashModesSupported and CCamera::SetFlashL() respectively. besides, i tested the value of CCameraAdvancedSettings::GetSupportedAFAssistantLightL() on 5230 and 5800, but both of them shown the same integer 3 in decimal. hence, they did mean the current camera supported EAFAssistantLightManualOn(0x01) and EAFAssistantLightAuto(0x02).

    p.s.
    i instantited CCamera using New2L.

    anyone got a better idea?
    Last edited by pcsxk; 2011-01-12 at 07:03.

  4. #4
    Registered User pcsxk's Avatar
    Join Date
    Dec 2010
    Posts
    9
    somebody help me, please
    Last edited by pcsxk; 2011-01-14 at 06:36.

  5. #5
    Regular Contributor TongMuan's Avatar
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    166
    Quote Originally Posted by pcsxk View Post
    As for CCameraAdvancedSettings::FlashModesSupported() and CCameraAdvancedSettings::SetFlashMode, i found they worked the same as TCameraInfo::iFlashModesSupported and CCamera::SetFlashL() respectively.
    It sounds like the flash related functionality in camera API is seriously broken on 5230. You could create a bug report for Nokia, and maybe a moderator can move this thread to Media (Graphics & Sounds). In the Media board you might get confirmation or suggestions from someone "inside" - at least janza seems knowledgeable about camera issues.

    If you really need to get the app working right now on 5230 in addition to devices where correct data is returned for supported flash modes, you could make an ugly hack where you check the device's machine id, and if matches 5230's id, you'll simply skip the detection and assume no flash support.

  6. #6
    Registered User pcsxk's Avatar
    Join Date
    Dec 2010
    Posts
    9
    Quote Originally Posted by TongMuan View Post
    If you really need to get the app working right now on 5230 in addition to devices where correct data is returned for supported flash modes, you could make an ugly hack where you check the device's machine id, and if matches 5230's id, you'll simply skip the detection and assume no flash support.
    right now, i have to achieve my goal via ur suggestion.
    but thanx a lot

Similar Threads

  1. How to detect camera orientation
    By murk in forum Symbian C++
    Replies: 7
    Last Post: 2009-09-03, 08:28
  2. Detect an incoming call or SMS with Flash Lite???
    By loboman56 in forum [Archived] Flash Lite on Nokia Devices
    Replies: 1
    Last Post: 2009-07-04, 14:47
  3. How to detect camera running in background
    By gaurav C in forum Symbian C++
    Replies: 1
    Last Post: 2008-05-16, 06:29
  4. How can I detect the orientation for camera
    By Mixes in forum Symbian C++
    Replies: 1
    Last Post: 2007-08-16, 03:46
  5. Can I detect camera motion
    By iamphan in forum Symbian Media (Closed)
    Replies: 5
    Last Post: 2007-06-06, 14:42

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