Class ShadowCamera


  • @Implements(android.hardware.Camera.class)
    public class ShadowCamera
    extends java.lang.Object
    • Constructor Detail

      • ShadowCamera

        public ShadowCamera()
    • Method Detail

      • __constructor__

        @Implementation
        protected void __constructor__()
      • open

        @Implementation
        protected static android.hardware.Camera open()
      • open

        @Implementation
        protected static android.hardware.Camera open​(int cameraId)
      • getLastOpenedCameraId

        public static int getLastOpenedCameraId()
      • unlock

        @Implementation
        protected void unlock()
      • reconnect

        @Implementation
        protected void reconnect()
      • getParameters

        @Implementation
        protected android.hardware.Camera.Parameters getParameters()
      • setParameters

        @Implementation
        protected void setParameters​(android.hardware.Camera.Parameters params)
      • setPreviewDisplay

        @Implementation
        protected void setPreviewDisplay​(android.view.SurfaceHolder holder)
      • startPreview

        @Implementation
        protected void startPreview()
      • stopPreview

        @Implementation
        protected void stopPreview()
      • release

        @Implementation
        protected void release()
      • setPreviewCallback

        @Implementation
        protected void setPreviewCallback​(android.hardware.Camera.PreviewCallback cb)
      • setOneShotPreviewCallback

        @Implementation
        protected void setOneShotPreviewCallback​(android.hardware.Camera.PreviewCallback cb)
      • setPreviewCallbackWithBuffer

        @Implementation
        protected void setPreviewCallbackWithBuffer​(android.hardware.Camera.PreviewCallback cb)
      • invokePreviewCallback

        public void invokePreviewCallback​(byte[] data)
        Allows test cases to invoke the preview callback, to simulate a frame of camera data.
        Parameters:
        data - byte buffer of simulated camera data
      • addCallbackBuffer

        @Implementation
        protected void addCallbackBuffer​(byte[] callbackBuffer)
      • getAddedCallbackBuffers

        public java.util.List<byte[]> getAddedCallbackBuffers()
      • setDisplayOrientation

        @Implementation
        protected void setDisplayOrientation​(int degrees)
      • getDisplayOrientation

        public int getDisplayOrientation()
      • autoFocus

        @Implementation
        protected void autoFocus​(android.hardware.Camera.AutoFocusCallback callback)
      • cancelAutoFocus

        @Implementation
        protected void cancelAutoFocus()
      • hasRequestedAutoFocus

        public boolean hasRequestedAutoFocus()
      • invokeAutoFocusCallback

        public void invokeAutoFocusCallback​(boolean success,
                                            android.hardware.Camera camera)
      • getCameraInfo

        @Implementation
        protected static void getCameraInfo​(int cameraId,
                                            android.hardware.Camera.CameraInfo cameraInfo)
      • getNumberOfCameras

        @Implementation
        protected static int getNumberOfCameras()
      • takePicture

        @Implementation
        protected void takePicture​(android.hardware.Camera.ShutterCallback shutter,
                                   android.hardware.Camera.PictureCallback raw,
                                   android.hardware.Camera.PictureCallback jpeg)
      • isLocked

        public boolean isLocked()
      • isPreviewing

        public boolean isPreviewing()
      • isReleased

        public boolean isReleased()
      • getPreviewDisplay

        public android.view.SurfaceHolder getPreviewDisplay()
      • addCameraInfo

        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.
        Parameters:
        id - The camera id
        camInfo - The CameraInfo
      • clearCameraInfo

        public static void clearCameraInfo()