Methods Summary |
---|
public final void | autoFocus(android.hardware.Camera$AutoFocusCallback cb)Starts auto-focus function and registers a callback function to
run when camera is focused. Only valid after startPreview() has
been called.
mAutoFocusCallback = cb;
native_autoFocus();
|
protected void | finalize()
native_release();
|
public android.hardware.Camera$Parameters | getParameters()Returns the picture Parameters for this Camera service.
Parameters p = new Parameters();
String s = native_getParameters();
Log.e(TAG, "_getParameters: " + s);
p.unflatten(s);
return p;
|
public final native int | lock()Lock the camera to prevent other processes from accessing it. To save
setup/teardown time, a client of Camera can pass an initialized Camera
object to another process. This method is used to re-lock the Camera
object prevent other processes from accessing it. By default, the
Camera object is locked. Locking it again from the same process will
have no effect. Attempting to lock it from another process if it has
not been unlocked will fail.
Returns 0 if lock was successful.
FIXME: Unhide after approval
|
private final native void | native_autoFocus()
|
private final native java.lang.String | native_getParameters()
|
private final native void | native_release()
|
private final native void | native_setParameters(java.lang.String params)
|
private final native void | native_setup(java.lang.Object camera_this)
|
private final native void | native_takePicture()
|
public static android.hardware.Camera | open()Returns a new Camera object.
return new Camera();
|
private static void | postEventFromNative(java.lang.Object camera_ref, int what, int arg1, int arg2, java.lang.Object obj)
Camera c = (Camera)((WeakReference)camera_ref).get();
if (c == null)
return;
if (c.mEventHandler != null) {
Message m = c.mEventHandler.obtainMessage(what, arg1, arg2, obj);
c.mEventHandler.sendMessage(m);
}
|
public final native boolean | previewEnabled()Return current preview state.
FIXME: Unhide before release
|
public final native void | reconnect()Reconnect to the camera after passing it to MediaRecorder. To save
setup/teardown time, a client of Camera can pass an initialized Camera
object to a MediaRecorder to use for video recording. Once the
MediaRecorder is done with the Camera, this method can be used to
re-establish a connection with the camera hardware. NOTE: The Camera
object must first be unlocked by the process that owns it before it
can be connected to another proces.
|
public final void | release()Disconnects and releases the Camera object resources.
It is recommended that you call this as soon as you're done with the
Camera object.
native_release();
|
public final void | setErrorCallback(android.hardware.Camera$ErrorCallback cb)Registers a callback to be invoked when an error occurs.
mErrorCallback = cb;
|
private final native void | setHasPreviewCallback(boolean installed, boolean oneshot)
|
public final void | setOneShotPreviewCallback(android.hardware.Camera$PreviewCallback cb)Installs a callback to retrieve a single preview frame, after which the
callback is cleared.
if (cb != null) {
mPreviewCallback = cb;
mOneShot = true;
setHasPreviewCallback(true, true);
}
|
public void | setParameters(android.hardware.Camera$Parameters params)Sets the Parameters for pictures from this Camera service.
Log.e(TAG, "setParameters()");
//params.dump();
native_setParameters(params.flatten());
|
public final void | setPreviewCallback(android.hardware.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.
mPreviewCallback = cb;
mOneShot = false;
setHasPreviewCallback(cb != null, false);
|
public final void | setPreviewDisplay(android.view.SurfaceHolder holder)Sets the SurfaceHolder to be used for a picture preview. If the surface
changed since the last call, the screen will blank. Nothing happens
if the same surface is re-set.
setPreviewDisplay(holder.getSurface());
|
private final native void | setPreviewDisplay(android.view.Surface surface)
|
public final native void | startPreview()Start drawing preview frames to the surface.
|
public final native void | stopPreview()Stop drawing preview frames to the surface.
|
public final void | takePicture(android.hardware.Camera$ShutterCallback shutter, android.hardware.Camera$PictureCallback raw, android.hardware.Camera$PictureCallback jpeg)Triggers an asynchronous image capture. The camera service
will initiate a series of callbacks to the application as the
image capture progresses. The shutter callback occurs after
the image is captured. This can be used to trigger a sound
to let the user know that image has been captured. The raw
callback occurs when the raw image data is available. The jpeg
callback occurs when the compressed image is available. If the
application does not need a particular callback, a null can be
passed instead of a callback method.
mShutterCallback = shutter;
mRawImageCallback = raw;
mJpegCallback = jpeg;
native_takePicture();
|
public final native int | unlock()Unlock the camera to allow aother process to access it. To save
setup/teardown time, a client of Camera can pass an initialized Camera
object to another process. This method is used to unlock the Camera
object before handing off the Camera object to the other process.
Returns 0 if unlock was successful.
FIXME: Unhide after approval
|