@Implements(value=android.hardware.Camera.class) public class ShadowCamera extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ShadowCamera.ShadowParameters
Shadows the Android
Camera.Parameters class. |
static class |
ShadowCamera.ShadowSize |
Constructor and Description |
---|
ShadowCamera() |
Modifier and Type | Method and Description |
---|---|
protected void |
__constructor__() |
protected void |
addCallbackBuffer(byte[] callbackBuffer) |
static void |
addCameraInfo(int id,
android.hardware.Camera.CameraInfo camInfo)
Add a mock
Camera.CameraInfo object to simulate the existence of one or more cameras. |
protected void |
autoFocus(android.hardware.Camera.AutoFocusCallback callback) |
protected void |
cancelAutoFocus() |
static void |
clearCameraInfo() |
java.util.List<byte[]> |
getAddedCallbackBuffers() |
protected static void |
getCameraInfo(int cameraId,
android.hardware.Camera.CameraInfo cameraInfo) |
int |
getDisplayOrientation() |
static int |
getLastOpenedCameraId() |
protected static int |
getNumberOfCameras() |
protected android.hardware.Camera.Parameters |
getParameters() |
android.view.SurfaceHolder |
getPreviewDisplay() |
boolean |
hasRequestedAutoFocus() |
void |
invokeAutoFocusCallback(boolean success,
android.hardware.Camera camera) |
void |
invokePreviewCallback(byte[] data)
Allows test cases to invoke the preview callback, to simulate a frame of camera data.
|
boolean |
isLocked() |
boolean |
isPreviewing() |
boolean |
isReleased() |
protected static android.hardware.Camera |
open() |
protected static android.hardware.Camera |
open(int cameraId) |
protected void |
reconnect() |
protected void |
release() |
protected void |
setDisplayOrientation(int degrees) |
protected void |
setOneShotPreviewCallback(android.hardware.Camera.PreviewCallback cb) |
protected void |
setParameters(android.hardware.Camera.Parameters params) |
protected void |
setPreviewCallback(android.hardware.Camera.PreviewCallback cb) |
protected void |
setPreviewCallbackWithBuffer(android.hardware.Camera.PreviewCallback cb) |
protected void |
setPreviewDisplay(android.view.SurfaceHolder holder) |
protected void |
startPreview() |
protected void |
stopPreview() |
protected void |
takePicture(android.hardware.Camera.ShutterCallback shutter,
android.hardware.Camera.PictureCallback raw,
android.hardware.Camera.PictureCallback jpeg) |
protected void |
unlock() |
@Implementation protected void __constructor__()
@Implementation protected static android.hardware.Camera open()
@Implementation protected static android.hardware.Camera open(int cameraId)
public static int getLastOpenedCameraId()
@Implementation protected void unlock()
@Implementation protected void reconnect()
@Implementation protected android.hardware.Camera.Parameters getParameters()
@Implementation protected void setParameters(android.hardware.Camera.Parameters params)
@Implementation protected void setPreviewDisplay(android.view.SurfaceHolder holder)
@Implementation protected void startPreview()
@Implementation protected void stopPreview()
@Implementation protected void release()
@Implementation protected void setPreviewCallback(android.hardware.Camera.PreviewCallback cb)
@Implementation protected void setOneShotPreviewCallback(android.hardware.Camera.PreviewCallback cb)
@Implementation protected void setPreviewCallbackWithBuffer(android.hardware.Camera.PreviewCallback cb)
public void invokePreviewCallback(byte[] data)
Allows test cases to invoke the preview callback, to simulate a frame of camera data.
data
- byte buffer of simulated camera data@Implementation protected void addCallbackBuffer(byte[] callbackBuffer)
public java.util.List<byte[]> getAddedCallbackBuffers()
@Implementation protected void setDisplayOrientation(int degrees)
public int getDisplayOrientation()
@Implementation protected void autoFocus(android.hardware.Camera.AutoFocusCallback callback)
@Implementation protected void cancelAutoFocus()
public boolean hasRequestedAutoFocus()
public void invokeAutoFocusCallback(boolean success, android.hardware.Camera camera)
@Implementation protected static void getCameraInfo(int cameraId, android.hardware.Camera.CameraInfo cameraInfo)
@Implementation protected static int getNumberOfCameras()
@Implementation protected void takePicture(android.hardware.Camera.ShutterCallback shutter, android.hardware.Camera.PictureCallback raw, android.hardware.Camera.PictureCallback jpeg)
public boolean isLocked()
public boolean isPreviewing()
public boolean isReleased()
public android.view.SurfaceHolder getPreviewDisplay()
public static void addCameraInfo(int id, android.hardware.Camera.CameraInfo camInfo)
Add a mock Camera.CameraInfo
object to simulate the existence of one or more cameras. By default, no cameras are defined.
id
- The camera idcamInfo
- The CameraInfopublic static void clearCameraInfo()