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
Developer
testinz
Posts: 175
Registered: ‎09-03-2012
My Device: Blackberry 10
Accepted Solution

Camera error

Hello,

 

Just wondering if anyone could help with the error I'm getting for camera capture:

 

Debug: viewfinderStartFailed signal received with error 2
Debug: photoCaptureFailed signal received with error 4
Debug: photoCaptureFailed signal received with error 4
Debug: photoCaptureFailed signal received with error 4
Debug: photoCaptureFailed signal received with error 4
Debug: photoCaptureFailed signal received with error 4
Debug: photoCaptureFailed signal received with error 4

 

Thanks!

 

This is the code that container the Camera:

 

Camera {
                id: camera
                preferredWidth: 550
                preferredHeight: 450
                objectName: "myCamera"
                property bool photoBeingTaken   
                onTouch: {
                    if (photoBeingTaken == false) {
                        photoBeingTaken = true;
                        // Take a photo, and automatically
                        // save it to the file system.
                        camera.capturePhoto();
                    }
                }
                /*             
                onTouch: {
                    if (event.isDown()) {
                        // Take photo
                        capturePhoto();
                        //setting.visible = true;
                    }
                }
                */
            
                
                // When the camera is opened we want to start the viewfinder
                onCameraOpened:{
                    camera.startViewfinder();
                }
                onViewfinderStarted: {
                    console.debug("Viewfinder has been started");
                    photoBeingTaken = false;
                }
               // There are loads of messages we could listen to here.
               // onPhotoSaved and onShutterFired are taken care of in the C++ code.
               onCameraOpenFailed: {
                    console.log("onCameraOpenFailed signal received with error " + error);
                }
                onViewfinderStartFailed: {
                    console.log("viewfinderStartFailed signal received with error " + error);
                }
                onViewfinderStopFailed: {
                    console.log("viewfinderStopFailed signal received with error " + error);
                }
                onPhotoCaptureFailed: {
                    console.log("photoCaptureFailed signal received with error " + error);
                    photoBeingTaken = false;
                }
                onPhotoSaveFailed: {
                    console.log("photoSaveFailed signal received with error " + error);
                    photoBeingTaken = false;
                }
                onPhotoSaved: {
                    console.log("File name: " + fileName);
                    photoBeingTaken = false;                  
                }

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

Re: Camera error

[ Edited ]

do you have "access_shared" capability in your bar file?  files are saved to shared/camera by the Cascades Camera API, and if you don't have access, it will fail to save the photo there.

 

also, it looks like you failed to get the viewfinder started.  do you have "use_camera" capability in your bar file?

Please use plain text.
Developer
testinz
Posts: 175
Registered: ‎09-03-2012
My Device: Blackberry 10

Re: Camera error

I fixed it...

CameraUnit.Rear doesn't work. Change to .Front work!!!

if (camera.allCamerasAccessible) {
camera.open(CameraUnit.Front);
}
Please use plain text.
New Member
vhoyneg11
Posts: 1
Registered: ‎02-14-2013
My Device: BlackBerry Playbook
My Carrier: Smart

Re: Camera error

I try all different sollution,but still I'm always find same problem on my playbook...

 

Camera error 4003

 

Camera error 4003 

 

Still the same big problem.developers says blackberry is built for long years of service?????

 

 

I don't know if I'll believed that blackberry is different from others brand????  

 

Can someone. There to help me......  

 

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

Re: Camera error

Your playbook does not run Cascades and has nothing to do with this thread.

 

it sounds like you have an issue with your device that you need to discuss with the RMA team.  Please contact returns and warranty people, and not the Cascades developer forum.

 

Please use plain text.