Class OnDemandSurfaceTextureCaptureSession
- Namespace
- Uralstech.UXR.QuestCamera.SurfaceTextureCapture
On-demand version of SurfaceTextureCaptureSession.
public class OnDemandSurfaceTextureCaptureSession : SurfaceTextureCaptureSession
- Inheritance
-
objectOnDemandSurfaceTextureCaptureSession
- Inherited Members
Remarks
This experimental capture session uses a native OpenGL texture to capture images for better performance and requires OpenGL ES 3.0 as the project's graphics API. Works with single and multi-threaded rendering.
Constructors
OnDemandSurfaceTextureCaptureSession(Resolution)
public OnDemandSurfaceTextureCaptureSession(Resolution resolution)
Parameters
resolutionResolution
Properties
HasFrame
Has the capture session received its first frame?
public bool HasFrame { get; }
Property Value
- bool
Methods
Invoke(string, nint)
public override nint Invoke(string methodName, nint javaArgs)
Parameters
methodNamestringjavaArgsnint
Returns
- nint
RequestCapture()
Updates the unity texture with the latest capture from the camera.
public WaitUntil? RequestCapture()
Returns
- WaitUntil?
Returns a WaitUntil operation if the renderer was invoked, null otherwise.
RequestCapture(Action<Texture2D, long>)
Updates the unity texture with the latest capture from the camera.
public bool RequestCapture(Action<Texture2D, long> onDone)
Parameters
onDoneAction<Texture2D, long>Called when the capture has been rendered in unity, with its timestamp.
Returns
RequestCapture(TimeSpan, Action, WaitTimeoutMode)
Updates the unity texture with the latest capture from the camera.
public WaitUntil? RequestCapture(TimeSpan timeout, Action onTimeout, WaitTimeoutMode timeoutMode = null)
Parameters
timeoutTimeSpanonTimeoutActiontimeoutModeWaitTimeoutMode
Returns
- WaitUntil?
Returns a WaitUntil operation if the renderer was invoked, null otherwise.
RequestCaptureAsync(CancellationToken)
Updates the unity texture with the latest capture from the camera.
public Task<(Texture2D?, long)> RequestCaptureAsync(CancellationToken token = default)
Parameters
tokenCancellationToken
Returns
- Task<(Texture2D?, long)>
The rendered texture and timestamp, or default values if the renderer could not be invoked.