startPreview
Initializes the start of the camera preview on screen and preview frames to consume, the surfaceProvider must supply a valid surface when requested and it is responsible for managing the lifecycle of the surface.
If requireTakePictureCapability is requested, the camera will be configured to allow requests to take manual frames at the expense of performance and the ability to generate images for analysis with a higher resolution than 1080p on supported devices. If it is not requested and the capability is needed later, the camera must be re-initialized.
Events emitted:
FrameProducer.Event.FrameProducerWarning.CameraNotInitialized If there is an attempt to start the preview while the camera is not ready.
FrameProducer.Event.InitializationError.PreviewInitialization If this function was not called in the main thread or the camera configuration is not enough to start the preview.
FrameProducer.Event.CameraReady If the camera preview has started and it's safe to interact with.
Parameters
The provider of the surface where the preview will send frames to display, it must supply a valid surface when requested.
Determines whether manual picture-taking capabilities are enabled or disabled.
See also
Deprecated
Use startPreview(Preview.SurfaceProvider) instead, this method will not be supported in future versions.
Initializes the start of the camera preview on screen and preview frames to consume, if the holders' underlying surface is null or invalid it will wait for it to be ready first.
If requireTakePictureCapability is requested, the camera will be configured to allow requests to take manual frames at the expense of performance and the ability to generate images for analysis with a higher resolution than 1080p on supported devices. If it is not requested and the capability is needed later, the camera must be re-initialized.
Events emitted:
FrameProducer.Event.FrameProducerWarning.CameraNotInitialized If there is an attempt to start the preview while the camera is not ready.
FrameProducer.Event.InitializationError.PreviewInitialization If this function was not called in the main thread or the camera configuration is not enough to start the preview.
FrameProducer.Event.CameraReady If the camera preview has started and it's safe to interact with.
Parameters
The holder of the surface where the preview will send frames to display on screen.
Determines whether manual picture-taking capabilities are enabled or disabled.
Deprecated
Use startPreview(Preview.SurfaceProvider) instead, this method will not be supported in future versions.
Initializes the start of the camera preview on screen and preview frames to consume.
If requireTakePictureCapability is requested, the camera will be configured to allow requests to take manual frames at the expense of performance and the ability to generate images for analysis with a higher resolution than 1080p on supported devices. If it is not requested and the capability is needed later, the camera must be re-initialized.
Events emitted:
FrameProducer.Event.InitializationError.InvalidPreviewSurface If the passed down surface is not valid.
FrameProducer.Event.InitializationError.PreviewInitialization If this function was not called in the main thread or the camera configuration is not enough to start the preview.
FrameProducer.Event.CameraReady If the camera preview has started and it's safe to interact with.
NOTE: the surface must be valid, if not the preview initialization will abort.
Parameters
The surface where the preview will send frames to display on screen.
Determines whether manual picture-taking capabilities are enabled or disabled.