09-18-2012 01:14 PM
I've looked at the camera native sample app and I am adjusting it, just having a newbie play really.
I'm trying to get the flash to always be on but am not having any luck, any ideas?
hasFlash is a bool.
camera_error_t err;
// open the specified camera
err = camera_open(unit,
CAMERA_MODE_RW | CAMERA_MODE_ROLL,
&handle);
if (err != CAMERA_EOK) {
fprintf(stderr, "camera_open() failed: %d\n", err);
return err;
}
hasFlash = camera_can_feature(handle, CAMERA_FEATURE_FLASH);
if(hasFlash){
camera_config_flash(handle,CAMERA_FLASH_ON);
}
09-24-2012 02:53 PM
Hi JeffLemon,
take a look at the HelloVideoCamera Sample App, available under https://github.com/blackberry/Cascades-Community-S
Try to add
camera_config_videolight(mCameraHandle, CAMERA_VIDEOLIGHT_ON);
into void HelloVideoCameraApp:
nStartRear(), such as:
void HelloVideoCameraApp::onStartRear()
{
qDebug() << "onStartRear";
if (mViewfinderWindow) {
if (createViewfinder(CAMERA_UNIT_REAR,
mViewfinderWindow->windowGroup().toStdString().c_s tr(),
mViewfinderWindow->windowId().toStdString().c_str( )) == EOK) {
qDebug() << "created viewfinder";
camera_config_videolight(mCameraHandle, CAMERA_VIDEOLIGHT_ON);
}
}
}
Hope this helps.
09-27-2012 03:05 PM
Are you trying to turn the LED on? Or do you want the flash to fire each time you take a picture?
If all you want is the LED with no camera, then you should be able to:
camera_open(....); camera_config_videolight(handle, CAMERA_VIDEOLIGHT_ON);
If you are actully trying to force the flash to fire on each photo you take, then you would use camera_config_flash(). I have sample code coming for this....
Cheers,
Sean