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
Description of functional types
RgbAndIrCameraManager
The main methods to operate the camera in order to output video stream (combined RGB and IR).
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
Description of Member Function
void addPreviewCallbackWithBuffer(IRgbAndIrPreviewCallback callback)
Add preview data callback
Parameter
Parameter Name
Type
Description
Note
Version Introduced
callback
IRgbAndIrPreviewCallback
Preview Data Callback
None
2.1.0
Return
None
Exception
None
void removePreviewCallbackWithBuffer(PreviewCallback callback)
Remove preview data callback
Parameter
Parameter Name
Type
Description
Note
Version Introduced
callback
IRgbAndIrPreviewCallback
Preview Data Callback
None
2.1.0
Return
None
Exception
None
RgbAndIrCameraManager getInstance()
Get camera instance
Parameter
None
Return
Current object
Exception
None
List getSupportedPreviewSizes(CameraType cameraType)
Get the preview size supported by the camera
Parameter
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
Camera Type
None
2.1.0
Return
Return Value
Description
Version Introduced
List
Preview size list
2.1.0
Exception
None
void initParameters(int width, int height, int degree,SurfaceTexture irSurfaceTexture, SurfaceTexture rgbSurfaceTexture, CameraType cameraType)
Camera Initialization
Parameter
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
Return
None
Exception
None
void openCamera(Context context,CameraType cameraType)
Open camera
Parameter
Parameter Name
Type
Description
Note
Version Introduced
context
Context
context
None
2.1.0
cameraType
CameraType
camera type
None
2.1.0
Return
None
Exception
None
void releaseCamera(CameraType cameraType)
Release camera
Parameter
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
camera type
None
2.1.0
Return
None
Exception
None
void startPreview(CameraType cameraType)
Start camera preview
Parameter
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
camera type
None
2.1.0
Return
None
Exception
None
void stopPreview(CameraType cameraType)
Stop camera preview
Parameter
Parameter Name
Type
Description
Note
Version Introduced
cameraType
CameraType
camera type
None
2.1.0
Return
None
Exception
None
void resetPreviewSize(ScaleManager.Size size,CameraType cameraType)
reset the preview size supported by the camera
Parameter
Parameter Name
Type
Description
Note
Version Introduced
size
ScaleManager.Size
preview size
None
2.1.0
cameraType
CameraType
camera type
None
2.1.0
Return
None
Exception
None
Description of Entities
CameraType
Parameter Description
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
最終更新