Class XRCameraSubsystem.IProvider | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class XRCameraSubsystem.IProvider

    Interface for providing camera functionality for the implementation.

    Inheritance
    System.Object
    XRCameraSubsystem.IProvider
    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 NativeArray.

    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 Camera parameters.

    XRCameraFrame cameraFrame

    The current camera frame returned by the method.

    Returns
    Type Description
    System.Boolean

    true if the method successfully got a frame. Otherwise, false.

    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

    true if the method successfully gets the camera intrinsics information. Otherwise, false.

    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

    true if the method successfully set the focus mode for the camera. Otherwise, false.

    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

    true if the method successfully set the light estimation mode. Otherwise, false.

    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023