public interface CameraHost
Modifier and Type | Interface and Description |
---|---|
static class |
CameraHost.FailureReason
Indication of why we were unable to open up a camera.
|
static class |
CameraHost.RecordingHint
Indication of what purpose we plan to put the camera
towards.
|
Modifier and Type | Method and Description |
---|---|
Camera.Parameters |
adjustPictureParameters(Camera.Parameters parameters)
Implement this to configure the Camera.Parameters just
prior to taking a photo.
|
Camera.Parameters |
adjustPreviewParameters(Camera.Parameters parameters)
Implement this to configure the Camera.Parameters for
the purposes of the preview.
|
void |
autoFocusAvailable()
This will be called by the library to let you know that
auto-focus is available for your use, so you can update
your UI accordingly.
|
void |
autoFocusUnavailable()
This will be called by the library to let you know that
auto-focus is not available for your use, so you can
update your UI accordingly.
|
void |
configureRecorderAudio(int cameraId,
MediaRecorder recorder)
This will be called by the library to give you a chance
to configure the audio of the MediaRecorder, just prior
to beginning to record a video.
|
void |
configureRecorderOutput(int cameraId,
MediaRecorder recorder)
This will be called by the library to give you a chance
to configure the output of the MediaRecorder, just
prior to beginning to record a video.
|
void |
configureRecorderProfile(int cameraId,
MediaRecorder recorder)
This will be called by the library to give you a chance
to configure the profile of the MediaRecorder, just
prior to beginning to record a video.
|
int |
getCameraId() |
DeviceProfile |
getDeviceProfile() |
Camera.Size |
getPictureSize(Camera.Parameters parameters)
Called to allow you to be able to indicate what size
photo should be taken.
|
Camera.Size |
getPreferredPreviewSizeForVideo(int displayOrientation,
int width,
int height,
Camera.Parameters parameters,
Camera.Size deviceHint)
Same as getPreviewSize(), but called when we anticipate
taking videos, as some devices may work better with
lower-resolution previews, to reduce CPU load
|
Camera.Size |
getPreviewSize(int displayOrientation,
int width,
int height,
Camera.Parameters parameters)
Called to allow you to indicate what size preview
should be used
|
CameraHost.RecordingHint |
getRecordingHint() |
Camera.ShutterCallback |
getShutterCallback() |
void |
handleException(java.lang.Exception e)
Called when something blows up in CameraView, to allow
you to alert the user as you see fit
|
boolean |
mirrorFFC() |
void |
onCameraFail(CameraHost.FailureReason reason)
Called when we failed to open the camera for one reason
or another, so you can let the user know
|
boolean |
rotateBasedOnExif() |
void |
saveImage(Bitmap bitmap)
Called when a picture has been taken.
|
boolean |
useSingleShotMode() |
Camera.Parameters adjustPictureParameters(Camera.Parameters parameters)
parameters
- the Camera.Parameters to be modifiedCamera.Parameters adjustPreviewParameters(Camera.Parameters parameters)
parameters
- the Camera.Parameters to be modifiedvoid autoFocusAvailable()
void autoFocusUnavailable()
void configureRecorderAudio(int cameraId, MediaRecorder recorder)
cameraId
- the camera that will be used for recordingrecorder
- the MediaRecorder to be configuredvoid configureRecorderOutput(int cameraId, MediaRecorder recorder)
cameraId
- the camera that will be used for recordingrecorder
- the MediaRecorder to be configuredvoid configureRecorderProfile(int cameraId, MediaRecorder recorder)
cameraId
- the camera that will be used for recordingrecorder
- the MediaRecorder to be configuredint getCameraId()
DeviceProfile getDeviceProfile()
Camera.Size getPictureSize(Camera.Parameters parameters)
parameters
- the current camera parametersCamera.Size getPreviewSize(int displayOrientation, int width, int height, Camera.Parameters parameters)
displayOrientation
- orientation of the display in degreeswidth
- width of the available preview spaceheight
- height of the available preview spaceparameters
- the current camera parametersCamera.Size getPreferredPreviewSizeForVideo(int displayOrientation, int width, int height, Camera.Parameters parameters, Camera.Size deviceHint)
displayOrientation
- orientation of the display in degreeswidth
- width of the available preview spaceheight
- height of the available preview spaceparameters
- the current camera parametersdeviceHint
- the size that the device itself thinks should
be used for video, which sometimes is
ridiculously lowCamera.ShutterCallback getShutterCallback()
void handleException(java.lang.Exception e)
e
- an Exception indicating what went wrongboolean mirrorFFC()
boolean rotateBasedOnExif()
void saveImage(Bitmap bitmap)
bitmap
- Bitmap of the pictureboolean useSingleShotMode()
CameraHost.RecordingHint getRecordingHint()
void onCameraFail(CameraHost.FailureReason reason)
reason
- a FailureReason indicating what went wrong