Skip to main content
Version: 14 Oct 2024

ACameraDevice

NameSpace: Camera

Inherits from:
INullablePointer,
IDisposable

Public Fields

Id

Note: Be careful when repeatedly accessing this property, because it allocates a new C# string each time and can generate additional GC pressure.


public string Id { get; set; }


Public Methods

void Dispose

public void Dispose()

bool TryCreateCaptureRequest

public bool TryCreateCaptureRequest(
ACaptureRequest.Template template,
out ACaptureRequest request
)

Parameters

TypeNameDescription
ACaptureRequest.Templatetemplate
out ACaptureRequestrequest

bool TryCreateCaptureSession

public bool TryCreateCaptureSession(
ACaptureSessionOutputContainer container,
out ACameraCaptureSession session
)

Parameters

TypeNameDescription
ACaptureSessionOutputContainercontainer
out ACameraCaptureSessionsession

bool TryCreateCaptureSessionWithCallbacks

public bool TryCreateCaptureSessionWithCallbacks(
ACaptureSessionOutputContainer container,
ACameraCaptureSession.StateCallbacks callbacks,
out ACameraCaptureSession session
)

Parameters

TypeNameDescription
ACaptureSessionOutputContainercontainer
ACameraCaptureSession.StateCallbackscallbacks
out ACameraCaptureSessionsession

Public Attributes

IsNull


public bool IsNull => value == IntPtr.Zero;


Public Enums

ErrorCode

EnumeratorValueDescription
CameraInUse1The camera device is in use already.
MaxCamerasInUse2The system-wide limit for number of open cameras or camera resources has been reached, and more camera devices cannot be opened until previous instances are closed.
CameraDisabled3The camera is disabled due to a device policy, and cannot be opened.
CameraDeviceFatalError4The camera device has encountered a fatal error. The camera device needs to be re-opened to be used again.
CameraServiceFatalError5The camera service has encountered a fatal error. The Android device may need to be shut down and restarted to restore camera function, or there may be a persistent hardware problem. An attempt at recovery may be possible by closing the CameraDevice and the CameraManager, and trying to acquire all resources again from scratch.