Camera
An instance of quick access to the camera is provided, an interface for previewing data is obtained, method of managing the life cycle of the camera is encapsulated, and the monitoring of the camera.
Description of functional types
CameraManager
The main methods of operating the camera
Member Function | Description | Version Introduced |
CameraManager removePreviewCallbackWithBuffer(PreviewCallback callback) | remove preview data callback | 2.0.0 |
CameraManager addPreviewCallbackWithBuffer(PreviewCallback callback) | add preview data callback | 2.0.0 |
CameraManager getInstance(int cameraId) | get camera instance | 2.0.0 |
CameraManager setDisplayOrientation(int degree) | set Preview Degree | 2.0.0 |
CameraManager setPreviewTexture(SurfaceTexture texture) | set Preview Texture | 2.0.0 |
List getSupportedPreviewSizes() | get the Preview Size Supported by the Camera | 2.0.0 |
void initParameters(int width, int height, int degree, SurfaceTexture surfaceTexture) | Camera Initialization | 2.0.0 |
void openCamera(Context context) | open Camera | 2.0.0 |
void releaseCamera() | release Camera | 2.0.0 |
void startPreview() | start Preview | 2.0.0 |
void stopPreview() | stop Preview | 2.0.0 |
Description of Member Function
CameraManager addPreviewCallbackWithBuffer(PreviewCallback callback)
Add preview data callback
Parameter
Parameter Name | Type | Description | Note | Version Introduced |
callback | PreviewCallback | Preview Data Callback | None | 2.0.0 |
Return
Current Object
Exception
None
CameraManager removePreviewCallbackWithBuffer(PreviewCallback callback)
Remove Preview Data Callback
Parameter
Parameter Name | Type | Description | Note | Version Introduced |
callback | PreviewCallback | Preview Data Callback | None | 2.0.0 |
Return
Current Object
Exception
None
CameraManager getInstance(int cameraId)
Get camera instance
Parameter
Parameter Name | Type | Description | Note | Version Introduced |
cameraId | int | Camera Index | None | 2.0.0 |
Return
Current Object
Exception
None
CameraManager setDisplayOrientation(int degree)
Set Preview Degree, 0/90/180/270 selectable
Parameter
Parameter Name | Type | Description | Note | Version Introduced |
degree | int | Degree, 0/90/180/270 selectable | None | 2.0.0 |
Return
Current Object
Exception
None
CameraManager setPreviewTexture(SurfaceTexture texture)
Set Preview Texture
Parameter
Parameter Name | Type | Description | Note | Version Introduced |
texture | SurfaceTexture | Preview Texture | None | 2.0.0 |
Return
Current Object
Exception
None
List getSupportedPreviewSizes()
Get the List of Supported Preview Sizes
Parameter
None
Return
Returned Value | Description | Version introduced |
List | List of Supported Preview Sizes | 2.0.0 |
Exception
None
void initParameters(int width, int height, int degree, SurfaceTexture surfaceTexture)
Camera Initialization
Parameter
Parameter Name | Type | Description | Note | Version Introduced |
width | int | Preview Width | None | 2.0.0 |
height | int | Preview Height | None | 2.0.0 |
degree | int | Preview Degree: 0,90,180,270 | None | 2.0.0 |
surfaceTexture | SurfaceTexture | Preview Texture | None | 2.0.0 |
Return
None
Exception
None
void openCamera(Context context)
Open Camera
Parameter
Parameter Name | Type | Description | Note | Version Introduced |
context | Context | Context | None | 2.0.0 |
Return
None
Exception
None
void releaseCamera()
Release Camera
Parameter
None
Return
None
Exception
None
void startPreview()
Start Camera Preview
Parameter
None
Return
None
Exception
None
void stopPreview()
Stop Camera Preview
Parameter
None
Return
None
Exception
None
Description of Entities
None
最終更新