> For the complete documentation index, see [llms.txt](https://portal-integracao.intelbras.com.br/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://portal-integracao.intelbras.com.br/linha-android/videoserver/cameramanager.md).

# CameraManager

Interface Principal de CallBack: `CameraManager`

Path: `com.lamy.sdk.videoserver`

```java
/**
* Open camera
*
* @param cameraId cameraId
* @param mode mode, projects without pattern differentiation are directly
transmitted to CameraMode.VIDEO_ MODE is sufficient
* @return Operation result
*/
int open(int cameraId, @CameraMode int mode)

/**
* Turn off camera
*
* @param cameraId cameraId
* @return Operation result
*/
int close(int cameraId)

/**
* Get the current camera mode
*
* @param cameraid cameraid
* @return Return the current camera mode
*/
int getCameraMode(int cameraid)

/**
* Request parameters
*
* @param cameraId cameraId
* @param requestKey collection of a set of requested keys
* @return Camera parameters
*/
ICameraParameter requestParameters(int cameraId, List<String> requestKey)

/**
* Update camera parameters
*
* @param cameraId cameraId
* @param parameter Collection of parameters that need to be updated{@link
ICameraParameter}
* @return Whether the operation was successful
*/
int updateParameters(int cameraId, ICameraParameter parameter)

/**
* Auto Focus
*
* @param cameraId cameraId
* @param IAutoFocusCallBack Focus callback
* @return Whether the operation was successful
*/
int autoFocus(int cameraId,IAutoFocusCallBack callBack)

/**
* Cancel focus
*
* @param cameraId cameraId
* @return Whether the operation was successful
*/
int cancelAutoFocus(int cameraId)

/**
* Enable preview
*
* @param cameraId cameraId
* @param surface A surface used to carry preview data
* @param rotate rotation angle
* @param width The width of the preview interface
* @param height The height of the preview interface
* @return operation result code
*/
int startPreview(int cameraId, Surface surface, int rotate, int width, int
height)

/**
* Preview the width and height changes of the surface
*
* @param cameraId cameraId
* @param surface changing surface
* @param width surface width
* @param height surface height
* @return operation result code
*/
int onPreviewSizeChange(int cameraId, Surface surface, int width, int height)

/**
* Stop Preview
*
* @param cameraId cameraId
* @param surface The surface that needs to be stopped
* @return operation result code
*/
int stopPreview(int cameraId, Surface surface)

/**
* Set camera status monitoring
*
* @param cameraId cameraId
* @param listener listener
* @return operation result code
*/
int setCameraListener(int cameraId, ICameraStateListener listener)

/**
* Obtain ambient brightness
*
* @param cameraId cameraId
* @return ambient brightness value
*/
float getEnvironmentBrightness(int cameraId)

/**
* Obtain camera sensor angle
*
* @param cameraId cameraId
* @return angle system, usually 0-90-180-270
*/
int getSensorOrientation(int cameraId)

/**
* Obtaining the main camera cameraId, depending on the business scope of each
project
*
* @return Main camera cameraId
*/
int getMainCameraId()

/**
* Obtaining the IR camera cameraId, depending on the business scope of each
project
*
* @return IR Camera cameraId
*/
int getIrCameraId()

/**
* Obtain preview frames. You need to obtain available shared memory
shareMemToken before fetching frames
*
* @param cameraId cameraId
* @param shareMemToken Shared memory token
* @param width Preview width
* @param height Preview Height
* @param imageFormat The data format currently supported is YUV420
* @param commandListener data callback
* @return Operation result
*/
int requestOneShotFrame(int cameraId, int shareMemToken, int width, int height,
@ImageFormat int imageFormat,ICameraCommandListener commandListener)

/**
* Directly fetch the preview frame interface and return the byte array (only
preview width and height are supported noew)
*
* @param cameraId cameraId
* @param width Preview width
* @param height Preview Height
* @param imageFormat The data format currently supported is YUV420
* @param oneShotCallBack Data callback
* @return Operation result
*/
int requestOneShotFrame(int cameraId, int width, int height, @ImageFormat int
imageFormat, IOneShotCallBack oneShotCallBack)

/**
* Update Intelligent Frame
* @param frameWidth Intelligent Frame Width
* @param frameHeight Intelligent frame height
* @param faces The actual data type
* @return Operation result
*/
boolean updateFaceInfoToAiFrame(int frameWidth, int frameHeight, Parcelable[]
faces)

/**
* Set preview callback. After setting, the preview data will be continuously
recalled and needs to be manually cancelled (set to null)
* @param cameraId cameraId
* @param previewCallBack Preview image callback
* @return Operation result
*/
int setPreviewCallBack(int cameraId, IPreviewCallBack previewCallBack)


```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://portal-integracao.intelbras.com.br/linha-android/videoserver/cameramanager.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
