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
strgezer
Posts: 11
Registered: ‎12-20-2012
My Device: blackberry playbook
My Carrier: none
Accepted Solution

camera wont open

 

i'm trying to get the camera to work.  followed sample camera code located in github, referenced from BB developer site.   the sample code works fine.   this is BB10 on an alpha device.

 

when i call this:

if (camera_open(mCameraUnit, CAMERA_MODE_RW | CAMERA_MODE_ROLL,
                    &mCameraHandle) != CAMERA_EOK)

 

it fails!  works in the sample code. so, by way of investigation, i ran this code:

 

unsigned int numAsk = 3;
unsigned int numCamsSupported = 0;
camera_unit_t cameras[numAsk];
camera_get_supported_cameras(numAsk, &numCamsSupported, cameras);

 

on my app, the numCamsSupported variable comes back with 0.  on the sample app, it comes back with 2, as expected. 

 

i have the camera libraries in my .pro file, and have the include statement

#include <camera/camera_api.h>

 

in my .cpp file. 

 

i'm sure i'm missing something, but i dont know what....

 

Please use plain text.
Developer
Zmey
Posts: 1,512
Registered: ‎12-18-2012
My Device: PlayBook, Z10, DAC

Re: camera wont open

[ Edited ]

Is the permission set in bar-descriptor.xml file?

 

<permission>use_camera</permission>

 


Andrey Fidrya, @zmeyc on twitter
Please use plain text.
Contributor
strgezer
Posts: 11
Registered: ‎12-20-2012
My Device: blackberry playbook
My Carrier: none

Re: camera wont open

thanks! that did it. 

Please use plain text.