Summary: Ctors | Methods | Inherited Methods | [Expand All]
public static class

# CameraSource.Builder

extends Object

java.lang.Object
↳ | com.google.android.gms.vision.CameraSource.Builder

## Class Overview

Builder for configuring and creating an associated camera source.

## Summary

Public Constructors
| CameraSource.Builder(Context context, Detector<?> detector) Creates a camera source builder with the supplied context and detector.

Public Methods
CameraSource | build() Creates an instance of the camera source.
CameraSource.Builder | setAutoFocusEnabled(boolean autoFocusEnabled) Sets whether to enable camera auto focus.
CameraSource.Builder | setFacing(int facing) Sets the camera to use (either `CAMERA_FACING_BACK` or `CAMERA_FACING_FRONT`).
CameraSource.Builder | setRequestedFps(float fps) Sets the requested frame rate in frames per second.
CameraSource.Builder | setRequestedPreviewSize(int width, int height) Sets the desired width and height of the camera frames in pixels.

[Expand] Inherited Methods
From class java.lang.Object
Object | clone()
boolean | equals(Object arg0)
void | finalize()
final Class<?> | getClass()
int | hashCode()
final void | notify()
final void | notifyAll()
String | toString()
final void | wait(long arg0, int arg1)
final void | wait(long arg0)
final void | wait()

## Public Constructors

#### public CameraSource.Builder (Context context, Detector<?> detector)

Creates a camera source builder with the supplied context and detector. Camera preview images will be streamed to the associated detector upon starting the camera source.

## Public Methods

#### public CameraSource build ()

Creates an instance of the camera source.

#### public CameraSource.Builder setAutoFocusEnabled (boolean autoFocusEnabled)

Sets whether to enable camera auto focus. If set to false (default), the camera's default focus setting is used. If set to true, a continuous video focus setting is used (if supported by the camera hardware). Default: false.

#### public CameraSource.Builder setFacing (int facing)

Sets the camera to use (either `CAMERA_FACING_BACK` or `CAMERA_FACING_FRONT`). Default: back facing.

#### public CameraSource.Builder setRequestedFps (float fps)

Sets the requested frame rate in frames per second. If the exact requested value is not not available, the best matching available value is selected. Default: 30.

#### public CameraSource.Builder setRequestedPreviewSize (int width, int height)

Sets the desired width and height of the camera frames in pixels. If the exact desired values are not available options, the best matching available options are selected. Also, we try to select a preview size which corresponds to the aspect ratio of an associated full picture size, if applicable. Default: 1024x768.