|
|
|
@ -30,7 +30,8 @@ or `CameraOptions.supports(Control)` to see if it is supported. |
|
|
|
|
app:cameraVideoCodec="deviceDefault|h263|h264" |
|
|
|
|
app:cameraVideoMaxSize="0" |
|
|
|
|
app:cameraVideoMaxDuration="0" |
|
|
|
|
app:cameraVideoBitRate="0"/> |
|
|
|
|
app:cameraVideoBitRate="0" |
|
|
|
|
app:cameraPreviewFrameRate="30"/> |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
### APIs |
|
|
|
@ -40,6 +41,8 @@ or `CameraOptions.supports(Control)` to see if it is supported. |
|
|
|
|
Which camera to use, either back facing or front facing. |
|
|
|
|
Defaults to the first available value (tries `BACK` first). |
|
|
|
|
|
|
|
|
|
The available values are exposed through the `CameraOptions` object. |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
cameraView.setFacing(Facing.BACK); |
|
|
|
|
cameraView.setFacing(Facing.FRONT); |
|
|
|
@ -49,6 +52,8 @@ cameraView.setFacing(Facing.FRONT); |
|
|
|
|
|
|
|
|
|
Flash mode, either off, on, auto or torch. Defaults to `OFF`. |
|
|
|
|
|
|
|
|
|
The available values are exposed through the `CameraOptions` object. |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
cameraView.setFlash(Flash.OFF); |
|
|
|
|
cameraView.setFlash(Flash.ON); |
|
|
|
@ -61,6 +66,8 @@ cameraView.setFlash(Flash.TORCH); |
|
|
|
|
Sets the encoder for video recordings. Defaults to `DEVICE_DEFAULT`, |
|
|
|
|
which should typically be H_264. |
|
|
|
|
|
|
|
|
|
The available values are exposed through the `CameraOptions` object. |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
cameraView.setVideoCodec(VideoCodec.DEVICE_DEFAULT); |
|
|
|
|
cameraView.setVideoCodec(VideoCodec.H_263); |
|
|
|
@ -72,6 +79,8 @@ cameraView.setVideoCodec(VideoCodec.H_264); |
|
|
|
|
Sets the desired white balance for the current session. |
|
|
|
|
Defaults to `AUTO`. |
|
|
|
|
|
|
|
|
|
The available values are exposed through the `CameraOptions` object. |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
cameraView.setWhiteBalance(WhiteBalance.AUTO); |
|
|
|
|
cameraView.setWhiteBalance(WhiteBalance.INCANDESCENT); |
|
|
|
@ -84,6 +93,8 @@ cameraView.setWhiteBalance(WhiteBalance.CLOUDY); |
|
|
|
|
|
|
|
|
|
Turns on or off HDR captures. Defaults to `OFF`. |
|
|
|
|
|
|
|
|
|
The available values are exposed through the `CameraOptions` object. |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
cameraView.setHdr(Hdr.OFF); |
|
|
|
|
cameraView.setHdr(Hdr.ON); |
|
|
|
@ -94,6 +105,8 @@ cameraView.setHdr(Hdr.ON); |
|
|
|
|
Turns on or off audio stream while recording videos. |
|
|
|
|
Defaults to `ON`. |
|
|
|
|
|
|
|
|
|
The available values are exposed through the `CameraOptions` object. |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
cameraView.setAudio(Audio.OFF); |
|
|
|
|
cameraView.setAudio(Audio.ON); // on but depends on video config |
|
|
|
@ -143,6 +156,27 @@ cameraView.setVideoBitRate(0); |
|
|
|
|
cameraView.setVideoBitRate(4000000); |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
##### cameraPreviewFrameRate |
|
|
|
|
|
|
|
|
|
Controls the preview frame rate, in frames per second. |
|
|
|
|
Use a value of 0F to restore the camera default value. |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
cameraView.setPreviewFrameRate(30F); |
|
|
|
|
cameraView.setPreviewFrameRate(0F); |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
The preview frame rate is an important parameter because it will also |
|
|
|
|
control (broadly) the rate at which frame processor frames are dispatched, |
|
|
|
|
the video snapshots frame rate, and the rate at which real-time filters are invoked. |
|
|
|
|
|
|
|
|
|
The available values are exposed through the `CameraOptions` object: |
|
|
|
|
|
|
|
|
|
```java |
|
|
|
|
float min = options.getPreviewFrameRateMinValue(); |
|
|
|
|
float max = options.getPreviewFrameRateMaxValue(); |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
|
### Zoom |
|
|
|
|
|
|
|
|
|
There are two ways to control the zoom value: |
|
|
|
|