Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor slinx's Avatar
    Join Date
    Dec 2009
    Posts
    336
    In my application, I uses camera switching ( between front and back camera ). My sample code pseudo-code is like

    Code:
    void SwitchCamera()
    	{
    	iCam->ReleaseCam();		// calls PowerOff() and Release() of CCamera
    	iCam->AlterCamera();	// here construct CCamera changing camera index from current selection	
    	iCam->ReserveCam();		// calls Reserve() of CCamera
    	}
    
    	
    void ReserveComplete( TInt aError )			// From MCameraObserver 
    {
    	// I got (-14) KErrInUse here 
    }

    So Is there any other necessary step to follow in SwitchCamera() method? Thanks

  2. #2
    Nokia Developer Expert symbianyucca's Avatar
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    28,673
    its likely that the releasing takes time, so, you should wait that it is free before trying to reserve it again.

  3. #3
    Regular Contributor slinx's Avatar
    Join Date
    Dec 2009
    Posts
    336
    Quote Originally Posted by symbianyucca View Post
    its likely that the releasing takes time, so, you should wait that it is free before trying to reserve it again.
    thanks symbianyucca for replying. yes I have checked that possiblity and uses timer to wait sometime after calling iCam->ReleaseCam(). But seems no effect on waiting before calling AlterCamera(), as getting same (-14, KErrInUse) error.

  4. #4
    Registered User TongMuan's Avatar
    Join Date
    May 2008
    Location
    Surat Thani
    Posts
    166
    Quote Originally Posted by slinx View Post
    thanks symbianyucca for replying. yes I have checked that possiblity and uses timer to wait sometime after calling iCam->ReleaseCam(). But seems no effect on waiting before calling AlterCamera(), as getting same (-14, KErrInUse) error.
    Hi,

    You are using a proper asynchronous active object timer with a callback, right? User::After or similar is probably not good enough, because it might be that some camera related communication or active object completions need to happen in the UI thread before the previously used camera is really released and the other one can be reserved.

  5. #5
    Regular Contributor slinx's Avatar
    Join Date
    Dec 2009
    Posts
    336
    Quote Originally Posted by TongMuan View Post
    Hi,

    You are using a proper asynchronous active object timer with a callback, right? User::After or similar is probably not good enough, because it might be that some camera related communication or active object completions need to happen in the UI thread before the previously used camera is really released and the other one can be reserved.
    Thanks for your reply. The problem is already solved . Actually previous camera was using by some other resource and I was forgotten that part which causes the problem.

Similar Threads

  1. Orientation Switching problem
    By sukriti.sym in forum Symbian C++
    Replies: 1
    Last Post: 2009-09-15, 14:07
  2. Problem switching views
    By doesitmatter in forum Symbian C++
    Replies: 2
    Last Post: 2008-01-16, 18:31
  3. switching problem
    By sunny_singh in forum Symbian C++
    Replies: 1
    Last Post: 2005-09-11, 06:58
  4. View Switching Problem
    By flipflop82 in forum Symbian C++
    Replies: 1
    Last Post: 2005-03-10, 15:04
  5. switching views problem
    By _dennisr in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-05-21, 10:57

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