android.hardware.CameraDevice
The CameraDevice class is used to open/release the camera driver,
set image parameters and capture a preview frame (320*240 pixels) or a
full-resolution image (1280*1024 pixels).
This class does not have any public constructors. However, calling the
static method open() will return a CameraDevice object.
To get a frame/picture, follow these steps:
Nested Classes
Summary
Public Methods
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Methods
public
boolean
capture(Canvas canvas)
Method to capture an image/frame onto the canvas.
Parameters
| canvas
| The canvas onto which the image should be captured. |
Returns
- True if successful. False if image could not be captured.
public
final
void
close()
Method to release to the camera driver
public
static
final
CameraDevice
open()
Static method to open the camera driver for exclusive use.
Returns
- A CameraDevice object if driver could be opened
for exclusive use. Else, null is returned.
public
boolean
setCaptureParams(CaptureParams captParams)
Method to set the parameters for image capture.
Parameters
| captParams
| The parameters that need to be set for the capture.
Refer to CaptureParams class for details. |
Returns
- True if succcessful. False if parameters could not be set.