Share via


CameraDevice Class

Definition

The CameraDevice class is a representation of a single camera connected to an Android device, allowing for fine-grain control of image capture and post-processing at high frame rates.

[Android.Runtime.Register("android/hardware/camera2/CameraDevice", DoNotGenerateAcw=true)]
public abstract class CameraDevice : Java.Lang.Object, IDisposable, Java.Interop.IJavaPeerable, Java.Lang.IAutoCloseable
[<Android.Runtime.Register("android/hardware/camera2/CameraDevice", DoNotGenerateAcw=true)>]
type CameraDevice = class
    inherit Object
    interface IAutoCloseable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
Inheritance
CameraDevice
Attributes
Implements

Remarks

The CameraDevice class is a representation of a single camera connected to an Android device, allowing for fine-grain control of image capture and post-processing at high frame rates.

Your application must declare the android.Manifest.permission#CAMERA Camera permission in its manifest in order to access camera devices.

A given camera device may provide support at one of several levels defined in CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL. If a device supports CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LEGACY LEGACY level, the camera device is running in backward compatibility mode and has minimum camera2 API support. If a device supports the CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED level, then Camera2 exposes a feature set that is roughly equivalent to the older android.hardware.Camera Camera API, although with a cleaner and more efficient interface. If a device supports the CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_EXTERNAL EXTERNAL level, then the device is a removable camera that provides similar but slightly less features as the CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED LIMITED level. Devices that implement the CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_FULL FULL or CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3 LEVEL3 level of support provide substantially improved capabilities over the older camera API. If your application requires a full-level device for proper operation, declare the "android.hardware.camera.level.full" feature in your manifest.

Java documentation for android.hardware.camera2.CameraDevice.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

CameraDevice(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Fields

AudioRestrictionNone
Obsolete.

No vibration or sound muting for this camera device.

AudioRestrictionVibration
Obsolete.

Mute vibration from ringtones, alarms or notifications while this camera device is in use.

AudioRestrictionVibrationSound
Obsolete.

Mute vibration and sound from ringtones, alarms or notifications while this camera device is in use.

Properties

CameraAudioRestriction

Get currently applied global camera audio restriction mode. -or- Set audio restriction mode when this CameraDevice is being used.

Class

Returns the runtime class of this Object.

(Inherited from Object)
Handle

The handle to the underlying Android instance.

(Inherited from Object)
Id

Get the ID of this camera device.

JniIdentityHashCode (Inherited from Object)
JniPeerMembers
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

Methods

Clone()

Creates and returns a copy of this object.

(Inherited from Object)
Close()

Close the connection to this camera device as quickly as possible.

CreateCaptureRequest(CameraTemplate, ICollection<String>)

Create a CaptureRequest.Builder for new capture requests, initialized with template for a target use case.

CreateCaptureRequest(CameraTemplate)

Create a CaptureRequest.Builder for new capture requests, initialized with template for a target use case.

CreateCaptureSession(IList<Surface>, CameraCaptureSession+StateCallback, Handler)
CreateCaptureSession(SessionConfiguration)

Create a new CameraCaptureSession using a SessionConfiguration helper object that aggregates all supported parameters.

CreateCaptureSessionByOutputConfigurations(IList<OutputConfiguration>, CameraCaptureSession+StateCallback, Handler)

Create a new camera capture session by providing the target output set of Surfaces and its corresponding surface configuration to the camera device.

CreateConstrainedHighSpeedCaptureSession(IList<Surface>, CameraCaptureSession+StateCallback, Handler)

Create a new constrained high speed capture session.

CreateExtensionSession(ExtensionSessionConfiguration)

Initialize a specific device-specific extension augmented camera capture session.

CreateReprocessableCaptureSession(InputConfiguration, IList<Surface>, CameraCaptureSession+StateCallback, Handler)

Create a new reprocessable camera capture session by providing the desired reprocessing input Surface configuration and the target output set of Surfaces to the camera device.

CreateReprocessableCaptureSessionByConfigurations(InputConfiguration, IList<OutputConfiguration>, CameraCaptureSession+StateCallback, Handler)

Create a new reprocessable camera capture session by providing the desired reprocessing input configuration and output OutputConfiguration to the camera device.

CreateReprocessCaptureRequest(TotalCaptureResult)

Create a CaptureRequest.Builder for a new reprocess CaptureRequest from a TotalCaptureResult.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
IsSessionConfigurationSupported(SessionConfiguration)

Checks whether a particular SessionConfiguration is supported by the camera device.

JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to