×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    View Finder error, if original camera app opened

    i have a problem,
    this is happen when my app run the class ccamera, when the my view finder running
    then the original camera application from the device opened -> error happened
    KERN-EXEC 3 on my app.

    How to solved the problem?

    Thx

  2. #2
    Regular Contributor
    Join Date
    Dec 2008
    Posts
    227

    Re: View Finder error, if original camera app opened

    o yah this problem occured in n93 and sometimes happen in n92

    but in e63, this problem not occur. The device camera application can show a message :
    "camera already in use by other application"


    please help

    Thx

  3. #3
    Super Contributor
    Join Date
    May 2004
    Posts
    2,265

    Re: View Finder error, if original camera app opened

    Quote Originally Posted by Kaz32 View Post
    i have a problem,
    this is happen when my app run the class ccamera, when the my view finder running
    then the original camera application from the device opened -> error happened
    KERN-EXEC 3 on my app.

    How to solved the problem?

    Thx
    Hi,

    Let me 'repeat' what you said in a step-by-step way:

    0. You app will use CCamera (to start viewfinder and capture images for example).
    1. Start your app
    2. Start the built-in Camera application
    3. Your app will then panic (KERN-EXEC 3)

    If this is the case then your should check if your app handles the KUidECamEventCameraNoLongerReserved event properly.

    As you know the camera (hardware) is shared by all the ECam clients but only one of them can use it at a time. If it has been reserved (CCamera::Reserve) by app A, then when app B is asking the system for it (also by CCamera::Reserve) the system will check the priorities of the two apps and:

    1. If priority(app A)>priority(app B) then the system will reject the request. The app B will receive an MCameraObserver2::HandleEvent() callback with event UID KUidECamEventReserveComplete and error code KErrAccessDenied

    2. else the system will take the camera away from the app A and then give it to app B. The app A will receive an MCameraObserver2::HandleEvent() callback with event UID KUidECamEventCameraNoLongerReserved, means the client has lost control of the camera.

    Bad things can happen if your code still tries to operate the CCamera object after the camera is taken away.

    My suggestion:

    (1) Handle the KUidECamEventCameraNoLongerReserved event properly.

    (2) Release the CCamera object when your app goes to background to save power, and re-reserve it when it is switched to foreground, remember to handle the KErrAccessDenied error, for example when that happens you can give user a prompt (just like the built-in Camera application shows the "Camera already in use by other application").

    Regards

    Ziteng Chen

  4. #4
    Registered User
    Join Date
    Jun 2008
    Posts
    7

    Re: View Finder error, if original camera app opened

    Hi Ziteng Chen,

    I am using Camera-wrapper code in my application.

    On Nokia classic 6220 device, if I open camera-lid, it opens main camera application; taking away camera control from my application.
    I want to get control of Camera again, without restarting my application.

    Here is my try:
    Once I receiver “KUidECamEventCameraNoLongerReserved” event
    1. CameraEngine->ReleaseAndPowerOff();
    2. CameraEngine->ReserveAndPowerOn();
    But I’m not able to get in call back function “MceoCameraReady()”.
    Hence I’m unable to get Camera-view for my application.

    Question: How to re-initialize camera once we receiver “KUidECamEventCameraNoLongerReserved” event.

    Any suggestion, hint most welcome.

    Thanks in advance.
    Shekhar

  5. #5
    Super Contributor
    Join Date
    May 2004
    Posts
    2,265

    Re: View Finder error, if original camera app opened

    Hi,

    As I said if your CCamera object is of higher priority than any other running ECam client then your program can reserve the camera.

    See the documentation of CCamera::NewL() for how to specify the priority.

    Code:
    ...
    Capability:  UserEnvironment An application that creates a CCamera object must have the UserEnvironment capability. 
    
    Capability:  MultimediaDD The priority values (aPriority) of two clients are only compared if they both have the same MultimediaDD capability value. If one client has MultimediaDD capability and other does not, then the client with MultimediaDD capability will always be given greater priority, irrespective of the aPriority value. 
    
    static IMPORT_C CCamera *NewL(MCameraObserver2 &aObserver, TInt aCameraIndex, TInt aPriority);
    ...
    Regards

    Ziteng Chen

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

    Re: View Finder error, if original camera app opened

    Quote Originally Posted by chenziteng View Post
    If this is the case then your should check if your app handles the KUidECamEventCameraNoLongerReserved event properly.
    Hi,

    The devices that the application crashes on (N92, N93) have the original S60 3rd Edition, which does not support MCameraObserver2, so I guess we won't even be getting the KUidECamEventCameraNoLongerReserved event on those. I'm wondering if ECam notifies about this situation in any way through the old MCameraObserver - ViewFinderFrameReady might have been a good candidate, but the bitmap parameter is a reference (=> cannot be NULL) and there's no error/status code, unlike the function in MCameraObserver2. Or the viewfinder frames just stop coming?

    -TongMuan

  7. #7
    Nokia Developer Expert
    Join Date
    Dec 2003
    Posts
    148

    Re: View Finder error, if original camera app opened

    Quote Originally Posted by TongMuan View Post
    Hi,
    the old MCameraObserver - ViewFinderFrameReady might have been a good candidate, but the bitmap parameter is a reference (=> cannot be NULL) and there's no error/status code, unlike the function in MCameraObserver2. Or the viewfinder frames just stop coming?

    -TongMuan
    You are quite right - there is no way to communicate an error using the old interface. Hence the view finder just stops and unfortunately there is no way for the application to know what is going on. This is known problem in the API and therefore the new API should be used wherever it is available.
    janza

Similar Threads

  1. Problem switching app to foreground and activating view just after
    By juannoguera in forum Symbian User Interface
    Replies: 4
    Last Post: 2009-05-31, 10:24
  2. Camera app?
    By chris_taylor92 in forum Streaming and Video
    Replies: 1
    Last Post: 2008-11-08, 23:52
  3. Replies: 2
    Last Post: 2008-09-26, 18:40
  4. capturing image without view finder.
    By sajindra in forum Symbian C++
    Replies: 4
    Last Post: 2006-01-09, 21:43
  5. camera error : App closed.... ViewSrv 11
    By sumn79 in forum Symbian C++
    Replies: 2
    Last Post: 2004-02-16, 07:03

Posting Permissions

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