Dela via


Class RemoteRenderingClient

RemoteRenderingClient is an authorized connection to the Azure APIs for Remote Rendering.

It is the main entry point for users to use remote rendering. Use this to create RenderingSession instances.

class Microsoft::Azure::RemoteRendering::RemoteRenderingClient final

Methods

CreateNewRenderingSessionAsync

Creates a new rendering session.

This spins up a new server in the Azure cloud. Once ready, CreateNewRenderingSessionAsync returns the created RenderingSession object or an error context.

auto CreateNewRenderingSessionAsync(Microsoft::Azure::RemoteRendering::RenderingSessionCreationOptions options, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::CreateRenderingSessionResult>)> callback) -> void;

Parameters

Name Type Description
options RenderingSessionCreationOptions Session creation parameters
  • callback - The task result is of type CreateRenderingSessionResult which either holds a valid session reference or additional error context.

Returns

Type Description
void The task result is of type CreateRenderingSessionResult which either holds a valid session reference or additional error context.

CreateNewRenderingSessionUnsafeAsync

Internal.

auto CreateNewRenderingSessionUnsafeAsync(Microsoft::Azure::RemoteRendering::RenderingSessionCreationOptionsUnsafe options, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::CreateRenderingSessionResult>)> callback) -> void;

Parameters

Name Type Description
options RenderingSessionCreationOptionsUnsafe
  • callback

Returns

Type Description
void

Dispose

auto Dispose() noexcept -> Microsoft::Azure::RemoteRendering::Status;

GetAssetConversionStatusAsync

Deprecated. Use GetConversionPropertiesAsync() instead.

auto GetAssetConversionStatusAsync(std::string const& conversionId, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::AssetConversionStatusResult>)> callback) -> void;

Parameters

Name Type Description
conversionId string
  • callback

Returns

Type Description
void

GetConversionPropertiesAsync

Queries the properties of an asset conversion.

Since the underlying call is a REST call, there should be sufficient delay (5-10s) between subsequent calls to avoid server throttling. In case of throttling, the function will fail and the HttpResponseCode reports code 429 ("too many requests").

  • A Result.InvalidParam error occurs if no conversionId is provided, or the rendering service URL was empty, because the account domain and account Id was not provided.
  • A Result.AuthenticationFailed error occurs if the request could not be authenticated.
  • A Result.TooManyRequests error occurs if the rate limit has been exceeded. Retry the request after the duration given in the Retry-After header.
  • A Result.DomainUnreachable error occurs if remote rendering domain is unreachable. Url may be invalid or Azure Remote Rendering is not supported in this region.
  • A Result.ConnectionRefused error occurs if remote rendering connection is refused by destination host.
  • A Result.ConnectionFailed error occurs if remote rendering connection failed. Exact reason is unknown.
  • A Result.Timeout error occurs if remote rendering connection timed out.
auto GetConversionPropertiesAsync(std::string const& conversionId, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::ConversionPropertiesResult>)> callback) -> void;

Parameters

Name Type Description
conversionId string The conversion ID returned by StartAssetConversionAsync.
  • callback - Task containing the conversion status or an error context. The returned async will complete in an arbitrary thread.

Returns

Type Description
void Task containing the conversion status or an error context. The returned async will complete in an arbitrary thread.

GetCurrentConversionsAsync

Queries for all asset conversions of the last 30 days for the account associated with this client.

Since the underlying call is a REST call, there should be sufficient delay (5-10s) between subsequent calls to avoid server throttling. In case of throttling, the function will fail and the HttpResponseCode reports code 429 ("too many requests"). The returned async will complete in an arbitrary thread.

auto GetCurrentConversionsAsync(std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::ConversionPropertiesArrayResult>)> callback) -> void;

Parameters

Name Type Description
  • callback - The returned async will complete in an arbitrary thread.

Returns

Type Description
void The returned async will complete in an arbitrary thread.

GetCurrentRenderingSessionsAsync

Queries for all existing rendering sessions for the account associated with this client.

Since the underlying call is a REST call, there should be sufficient delay (5-10s) between subsequent calls to avoid server throttling. In case of throttling, the function will fail and the HttpResponseCode reports code 429 ("too many requests"). The returned async will complete in an arbitrary thread.

auto GetCurrentRenderingSessionsAsync(std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::RenderingSessionPropertiesArrayResult>)> callback) -> void;

Parameters

Name Type Description
  • callback - The returned async will complete in an arbitrary thread.

Returns

Type Description
void The returned async will complete in an arbitrary thread.

OpenRenderingSessionAsync

Opens an existing rendering session.

The session id can be created through RemoteRenderingClient.CreateNewRenderingSessionAsync(RenderingSessionCreationOptions), as well as through external tooling such as PowerShell.

auto OpenRenderingSessionAsync(std::string const& sessionId, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::CreateRenderingSessionResult>)> callback) -> void;

Parameters

Name Type Description
sessionId string The UUID of a rendering session.
  • callback - The task result is of type CreateRenderingSessionResult which either holds a valid session reference or additional error context.

Returns

Type Description
void The task result is of type CreateRenderingSessionResult which either holds a valid session reference or additional error context.

StartAssetConversionAsync

Starts converting an asset.

auto StartAssetConversionAsync(Microsoft::Azure::RemoteRendering::AssetConversionOptions conversionOptions, std::function<void(Status, ApiHandle<Microsoft::Azure::RemoteRendering::AssetConversionResult>)> callback) -> void;

Parameters

Name Type Description
conversionOptions AssetConversionOptions Conversion properties. Includes the conversion id, the asset input information, and the output information
  • callback - Task containing the asset token or an error context. The returned async will complete in an arbitrary thread.

Returns

Type Description
void Task containing the asset token or an error context. The returned async will complete in an arbitrary thread.

Properties

Configuration

Parameters with which this instance was initialized.

auto GetConfiguration() const noexcept -> Microsoft::Azure::RemoteRendering::SessionConfiguration;

LogLevel

Only messages at this log level or below will be delivered through RemoteRenderingClient.MessageLogged.

auto GetLogLevel() const noexcept -> Microsoft::Azure::RemoteRendering::LogLevel;
auto SetLogLevel(Microsoft::Azure::RemoteRendering::LogLevel value) noexcept -> Microsoft::Azure::RemoteRendering::Status;

Valid

Whether this object is still valid.

An object is invalid if it has been destroyed or if the connection has been lost. It is an error to call any other function on an invalid object.

auto GetValid() const noexcept -> bool;

Events

MessageLogged

Log messages are delivered through this callback.

auto MessageLogged(LogEventHandler const& handler) noexcept -> Expected<event_token, Microsoft::Azure::RemoteRendering::Status>;
auto MessageLogged(event_token& token) noexcept -> Microsoft::Azure::RemoteRendering::Status;

TokenRequired

Occurs when the client requires an updated access token or authentication token.

auto TokenRequired(TokenRequiredEventHandler const& handler) noexcept -> Expected<event_token, Microsoft::Azure::RemoteRendering::Status>;
auto TokenRequired(event_token& token) noexcept -> Microsoft::Azure::RemoteRendering::Status;