Table of Contents

Class StreamableResource

Namespace
Stride.Streaming
Assembly
Stride.Rendering.dll

Base class for all resources that can be dynamicly streamed.

public abstract class StreamableResource : ComponentBase, IDisposable, IComponent, IReferencable, ICollectorHolder
Inheritance
StreamableResource
Implements
Derived
Inherited Members
Extension Methods

Constructors

StreamableResource(StreamingManager)

protected StreamableResource(StreamingManager manager)

Parameters

manager StreamingManager

Fields

StreamingOptions

The current streaming options of the resource.

public StreamingOptions? StreamingOptions

Field Value

StreamingOptions?

cancellationToken

protected CancellationTokenSource cancellationToken

Field Value

CancellationTokenSource

fileProvider

protected DatabaseFileProvider fileProvider

Field Value

DatabaseFileProvider

Properties

AllocatedResidency

Gets the allocated residency level.

public abstract int AllocatedResidency { get; }

Property Value

int

CurrentResidency

Gets the current residency level.

public abstract int CurrentResidency { get; }

Property Value

int

IsAllocated

Gets a value indicating whether this resource is allocated.

public bool IsAllocated { get; }

Property Value

bool

Manager

Gets the manager.

public StreamingManager Manager { get; }

Property Value

StreamingManager

MaxResidency

Gets the maximum residency level.

public abstract int MaxResidency { get; }

Property Value

int

Resource

Gets the resource object.

public abstract object Resource { get; }

Property Value

object

Storage

Gets the resource storage.

public ContentStorage Storage { get; }

Property Value

ContentStorage

TargetResidency

Gets the target residency level.

public int TargetResidency { get; }

Property Value

int

Methods

CalculateRequestedResidency(int)

Calculates the requested residency level for this resource based on a given target residency. Resource can control how to change it's residency up/down and if do it at once or in steps, etc.. This gives more control over per resource streaming.

public abstract int CalculateRequestedResidency(int targetResidency)

Parameters

targetResidency int

The target residency.

Returns

int

Requested residency.

CalculateTargetResidency(StreamingQuality)

Calculates the target residency level for this resource based on a given uniform quality.

public abstract int CalculateTargetResidency(StreamingQuality quality)

Parameters

quality StreamingQuality

The quality.

Returns

int

Target residency.

Destroy()

Disposes of object resources.

protected override void Destroy()

Init(IDatabaseFileProviderService, ContentStorage)

protected void Init(IDatabaseFileProviderService databaseFileProviderService, ContentStorage storage)

Parameters

databaseFileProviderService IDatabaseFileProviderService
storage ContentStorage

StopStreaming()

Stops the resource streaming using cancellation token.

public void StopStreaming()

StreamAsync(int)

Stream resource to the target residency level.

protected abstract Task StreamAsync(int residency)

Parameters

residency int

The target residency.

Returns

Task