Class XRCameraSubsystem.IProvider
Interface for providing camera functionality for the implementation.
Inheritance
Namespace: UnityEngine.XR.ARSubsystems
Syntax
protected class IProvider
Properties
permissionGranted
Method to be implemented by the provider to determine whether camera permission has been granted.
Declaration
public virtual bool permissionGranted { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
shaderName
Method to be implemented by the provder to get the shader name used by XRCameraSubsystem to render
texture.
Declaration
public virtual string shaderName { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
Destroy()
Method to be implemented by provider to destroy the camera for the subsystem.
Declaration
public virtual void Destroy()
GetTextureDescriptors(XRTextureDescriptor, Allocator)
Get the XRTextureDescriptors associated with the current XRCameraFrame.
Declaration
public virtual NativeArray<XRTextureDescriptor> GetTextureDescriptors(XRTextureDescriptor defaultDescriptor, Allocator allocator)
Parameters
| Type | Name | Description |
|---|---|---|
| XRTextureDescriptor | defaultDescriptor | A default value which should be used to fill the returned array before copying in the real values. This ensures future additions to this struct are backwards compatible. |
| Allocator | allocator | The allocator to use when creating
the returned |
Returns
| Type | Description |
|---|---|
| NativeArray<XRTextureDescriptor> | The current texture descriptors. |
Start()
Method to be implemented by provider to start the camera for the subsystem.
Declaration
public virtual void Start()
Stop()
Method to be implemented by provider to stop the camera for the subsystem.
Declaration
public virtual void Stop()
TryGetFrame(XRCameraParams, out XRCameraFrame)
Method to be implemented by provider to get the camera frame for the subsystem.
Declaration
public virtual bool TryGetFrame(XRCameraParams cameraParams, out XRCameraFrame cameraFrame)
Parameters
| Type | Name | Description |
|---|---|---|
| XRCameraParams | cameraParams | The current Unity |
| XRCameraFrame | cameraFrame | The current camera frame returned by the method. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
TryGetIntrinsics(out XRCameraIntrinsics)
Method to be implemented by the provider to get the camera intrinisics information.
Declaration
public virtual bool TryGetIntrinsics(out XRCameraIntrinsics cameraIntrinsics)
Parameters
| Type | Name | Description |
|---|---|---|
| XRCameraIntrinsics | cameraIntrinsics | The camera intrinsics information returned from the method. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
TrySetFocusMode(CameraFocusMode)
Method to be implemented by the provider to set the focus mode for the camera.
Declaration
public virtual bool TrySetFocusMode(CameraFocusMode cameraFocusMode)
Parameters
| Type | Name | Description |
|---|---|---|
| CameraFocusMode | cameraFocusMode | The focus mode to set for the camera. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
TrySetLightEstimationMode(LightEstimationMode)
Method to be implemented by the provider to set the light estimation mode.
Declaration
public virtual bool TrySetLightEstimationMode(LightEstimationMode lightEstimationMode)
Parameters
| Type | Name | Description |
|---|---|---|
| LightEstimationMode | lightEstimationMode | The light estimation mode to set. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|