Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900
My Carrier: Bell
Accepted Solution

Setting camera focus mode

[ Edited ]

G'Day,

 

I am trying to set the camera focus mode and have run into a problem.  The modes return from camera_get_focus_modes(*) indicate that six focus modes are now supported.  But when I try to set one of these modes via a call to camera_set_focus_mode(*) the call returns

 

  CAMERA_EOPNOTSUPP  

 

which is documented to mean:"The function call failed because the requested operation is not supported."

 

Is this simply an artifact of the DevAlpha?  That is, the focus modes returned by camera_get_focus_modes(*) *will* be implemented by the real hardware but not on the DevAlpha?  Or am I doing something blindingly stupid?

 

EDIT: Using DevAlpha B.

 

Thanking you in advance...  -Sam.

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Setting camera focus mode

The viewfinder needs to be running first.

There is a sample here which runs through the various focus modes:

https://github.com/blackberry/Presentations/tree/master/2012-BlackBerryJam-Americas/JAM15/Focus

 

Cheers,

Sean

Please use plain text.
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900
My Carrier: Bell

Re: Setting camera focus mode

Thank-you for this. Fwiw, this was not clear from the documentation nor the return code, at least to someone like me. Regards and thanks again -Sam.
Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Setting camera focus mode

I will see about changing the behaviour.. it sounds like a bug that we reported a non-empty list of focus modes when the camera had not been started yet.

Please use plain text.
Contributor
SammyBGoode
Posts: 22
Registered: ‎11-12-2012
My Device: Bold 9900
My Carrier: Bell

Re: Setting camera focus mode

Yes, the focus modes query should fail if they cannot be set or effected.

 

Thanks for your help.  And thanks much for the reference to all those Jam demos.  Very helpful.  Are there any other sample caches that are not explicitely referenced in either the community section or the official section?

Please use plain text.
BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer
My Carrier: other

Re: Setting camera focus mode

all camera-related samples are linked to from the camera community wiki page here:

http://blackberry.github.com/Community/Camera.html

 

I just checked the implementation, and yes, it looks like the camera_get_focus_modes() API is hooked up in a state-independent way.  I will look at getting this fixed.  This list should not likely be queryable without a viewfinder running, because the list may vary based on which mode is currently selected.  It doesn't presently, but in the future it may.

 

 

 

Please use plain text.