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.
The main methods of operating the camera
Add preview data callback
Parameter
Return
Current Object
Exception
None
Remove Preview Data Callback
Parameter
Return
Current Object
Exception
None
Get camera instance
Parameter
Return
Current Object
Exception
None
Set Preview Degree, 0/90/180/270 selectable
Parameter
Return
Current Object
Exception
None
Set Preview Texture
Parameter
Return
Current Object
Exception
None
Get the List of Supported Preview Sizes
Parameter
None
Return
Exception
None
Camera Initialization
Parameter
Return
None
Exception
None
Open Camera
Parameter
Return
None
Exception
None
Release Camera
Parameter
None
Return
None
Exception
None
Start Camera Preview
Parameter
None
Return
None
Exception
None
Stop Camera Preview
Parameter
None
Return
None
Exception
None
None
The main methods to operate the camera in order to output video stream (combined RGB and IR).
Add preview data callback
Parameter
Return
None
Exception
None
Remove preview data callback
Parameter
Return
None
Exception
None
Get camera instance
Parameter
None
Return
Current object
Exception
None
Get the preview size supported by the camera
Parameter
Return
Exception
None
Camera Initialization
Parameter
Return
None
Exception
None
Open camera
Parameter
Return
None
Exception
None
Release camera
Parameter
Return
None
Exception
None
Start camera preview
Parameter
Return
None
Exception
None
Stop camera preview
Parameter
Return
None
Exception
None
reset the preview size supported by the camera
Parameter
Return
None
Exception
None
Parameter Description
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
Parameter Name
Type
Description
Note
Version Introduced
callback
PreviewCallback
Preview Data Callback
None
2.0.0
Parameter Name
Type
Description
Note
Version Introduced
callback
PreviewCallback
Preview Data Callback
None
2.0.0
Parameter Name
Type
Description
Note
Version Introduced
cameraId
int
Camera Index
None
2.0.0
Parameter Name
Type
Description
Note
Version Introduced
degree
int
Degree, 0/90/180/270 selectable
None
2.0.0
Parameter Name
Type
Description
Note
Version Introduced
texture
SurfaceTexture
Preview Texture
None
2.0.0
Returned Value
Description
Version introduced
List
List of Supported Preview Sizes
2.0.0
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
Parameter Name
Type
Description
Note
Version Introduced
context
Context
Context
None
2.0.0
Member Function
Description
Version Introduced
void removePreviewCallbackWithBuffer(IRgbAndIrPreviewCallback callback)
remove preview data callback
2.1.0
void addPreviewCallbackWithBuffer(IRgbAndIrPreviewCallback callback)
add preview data callback
2.1.0
RgbAndIrCameraManager getInstance()
get camera instance
2.1.0
List getSupportedPreviewSizes(CameraType cameraType)
get the preview size supported by the camera
2.1.0
void initParameters(int width, int height, int degree , SurfaceTexture irSurfaceTexture, SurfaceTexture rgbSurfaceTexture, CameraType cameraType)
Camera Initialization
2.1.0
void openCamera(Context context,CameraType cameraType)
open camera
2.1.0
void releaseCamera(CameraType cameraType)
release camera
2.1.0
void startPreview(CameraType cameraType)
start preview
2.1.0
void stopPreview(CameraType cameraType)
stop Preview
2.1.0
void resetPreviewSize(ScaleManager.Size size,CameraType cameraType)
reset the preview size supported by the camera
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
callback
IRgbAndIrPreviewCallback
Preview Data Callback
None
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
callback
IRgbAndIrPreviewCallback
Preview Data Callback
None
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
Camera Type
None
2.1.0
Return Value
Description
Version Introduced
List
Preview size list
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
width
int
preview width
None
2.1.0
height
int
preview height
None
2.1.0
degree
int
preview degreeļ¼ 0,90,180,270
None
2.1.0
irSurfaceTexture
SurfaceTexture
IR surface
None
2.1.0
rgbSurfaceTexture
SurfaceTexture
RGB surface
None
2.1.0
cameraType
CameraType
camera type
None
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
context
Context
context
None
2.1.0
cameraType
CameraType
camera type
None
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
camera type
None
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
camera type
None
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
camera type
None
2.1.0
Parameter Name
Type
Description
Note
Version Introduced
size
ScaleManager.Size
preview size
None
2.1.0
cameraType
CameraType
camera type
None
2.1.0
Member
Description
Note
Version Introduced
RGB
1 rgb camera
None
2.1.0
IR
2 ir camera
None
2.1.0
RGB_IR
3 rgb and ir camera
None
2.1.0