Android.Hardware.Camera2.CameraCaptureSession Class
A configured capture session for a Android.Hardware.Camera2.CameraDevice, used for capturing images from the camera.

See Also: CameraCaptureSession Members

Syntax

[Android.Runtime.Register("android/hardware/camera2/CameraCaptureSession", DoNotGenerateAcw=true)]
public abstract class CameraCaptureSession : Java.Lang.Object

Remarks

A configured capture session for a Android.Hardware.Camera2.CameraDevice, used for capturing images from the camera.

A CameraCaptureSession is created by providing a set of target output surfaces to CameraDevice.createCaptureSession(java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler). Once created, the session is active until a new session is created by the camera device, or the camera device is closed.

Creating a session is an expensive operation and can take several hundred milliseconds, since it requires configuring the camera device's internal pipelines and allocating memory buffers for sending images to the desired targets. Therefore the setup is done asynchronously, and CameraDevice.createCaptureSession(java.util.List<android.view.Surface>, android.hardware.camera2.CameraCaptureSession.StateCallback, android.os.Handler) will send the ready-to-use CameraCaptureSession to the provided listener's NoType:android/hardware/camera2/CameraCaptureSession$StateCallback;Href=../../../../reference/android/hardware/camera2/CameraCaptureSession.StateCallback.html#onConfigured(android.hardware.camera2.CameraCaptureSession) callback. If configuration cannot be completed, then the NoType:android/hardware/camera2/CameraCaptureSession$StateCallback;Href=../../../../reference/android/hardware/camera2/CameraCaptureSession.StateCallback.html#onConfigureFailed(android.hardware.camera2.CameraCaptureSession) is called, and the session will not become active.

If a new session is created by the camera device, then the previous session is closed, and its associated NoType:android/hardware/camera2/CameraCaptureSession$StateCallback;Href=../../../../reference/android/hardware/camera2/CameraCaptureSession.StateCallback.html#onClosed(android.hardware.camera2.CameraCaptureSession) callback will be invoked. All of the session methods will throw an IllegalStateException if called once the session is closed.

A closed session clears any repeating requests (as if CameraCaptureSession.StopRepeating had been called), but will still complete all of its in-progress capture requests as normal, before a newly created session takes over and reconfigures the camera device.

[Android Documentation]

Requirements

Namespace: Android.Hardware.Camera2
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0