|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.hardware.Camera
public class Camera
The Camera class is used to connect/disconnect with the camera service, set capture settings, start/stop preview, snap a picture, and retrieve frames for encoding for video.
There is no default constructor for this class. Use open() to
get a Camera object.
| Nested Class Summary | |
|---|---|
static interface |
Camera.AutoFocusCallback
Handles the callback for the camera auto focus. |
static interface |
Camera.ErrorCallback
Handles the camera error callback. |
class |
Camera.Parameters
Handles the parameters for pictures created by a Camera service. |
static interface |
Camera.PictureCallback
Handles the callback for when a picture is taken. |
static interface |
Camera.PreviewCallback
Used to get a copy of each preview frame. |
static interface |
Camera.ShutterCallback
An interface which contains a callback for the shutter closing after taking a picture. |
class |
Camera.Size
Handles the picture size (dimensions). |
| Field Summary | |
|---|---|
static int |
CAMERA_ERROR_SERVER_DIED
Media server died. |
static int |
CAMERA_ERROR_UNKNOWN
Unspecified camerar error. |
| Constructor Summary | |
|---|---|
Camera()
|
|
| Method Summary | |
|---|---|
void |
autoFocus(Camera.AutoFocusCallback cb)
Registers a callback to be invoked when the auto focus responds. |
protected void |
finalize()
Called by the virtual machine when there are no longer any (non-weak) references to the receiver. |
Camera.Parameters |
getParameters()
Returns the picture Parameters for this Camera service. |
static Camera |
open()
Returns a new Camera object. |
void |
release()
Disconnects and releases the Camera object resources. |
void |
setErrorCallback(Camera.ErrorCallback cb)
Registers a callback to be invoked when an error occurs. |
void |
setParameters(Camera.Parameters params)
Sets the Parameters for pictures from this Camera service. |
void |
setPreviewCallback(Camera.PreviewCallback cb)
Can be called at any time to instruct the camera to use a callback for each preview frame in addition to displaying it. |
void |
setPreviewDisplay(SurfaceHolder holder)
Sets the SurfaceHolder to be used for a picture preview. |
void |
startPreview()
Start drawing preview frames to the surface. |
void |
stopPreview()
Stop drawing preview frames to the surface. |
void |
takePicture(Camera.ShutterCallback shutter,
Camera.PictureCallback raw,
Camera.PictureCallback jpeg)
Registers a callback to be invoked when a picture is taken. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CAMERA_ERROR_UNKNOWN
public static final int CAMERA_ERROR_SERVER_DIED
| Constructor Detail |
|---|
Camera()
| Method Detail |
|---|
public static Camera open()
protected void finalize()
ObjectNote: The virtual machine assumes that the implementation in class Object is empty.
finalize in class Objectpublic final void release()
It is recommended that you call this as soon as you're done with the Camera object.
public final void setPreviewDisplay(SurfaceHolder holder)
holder - the SurfaceHolder upon which to place the picture previewpublic final void startPreview()
public final void stopPreview()
public final void setPreviewCallback(Camera.PreviewCallback cb)
cb - A callback object that receives a copy of each preview frame.
Pass null to stop receiving callbacks at any time.public final void autoFocus(Camera.AutoFocusCallback cb)
cb - the callback to run
public final void takePicture(Camera.ShutterCallback shutter,
Camera.PictureCallback raw,
Camera.PictureCallback jpeg)
raw - the callback to run for raw images, may be nulljpeg - the callback to run for jpeg images, may be nullpublic final void setErrorCallback(Camera.ErrorCallback cb)
cb - the callback to runpublic void setParameters(Camera.Parameters params)
params - the Parameters to use for this Camera servicepublic Camera.Parameters getParameters()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||