Class StreamableResource
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
cancellationToken
protected CancellationTokenSource cancellationToken
Field Value
fileProvider
protected DatabaseFileProvider fileProvider
Field Value
Properties
AllocatedResidency
Gets the allocated residency level.
public abstract int AllocatedResidency { get; }
Property Value
CurrentResidency
Gets the current residency level.
public abstract int CurrentResidency { get; }
Property Value
IsAllocated
Gets a value indicating whether this resource is allocated.
public bool IsAllocated { get; }
Property Value
Manager
Gets the manager.
public StreamingManager Manager { get; }
Property Value
MaxResidency
Gets the maximum residency level.
public abstract int MaxResidency { get; }
Property Value
Resource
Gets the resource object.
public abstract object Resource { get; }
Property Value
Storage
Gets the resource storage.
public ContentStorage Storage { get; }
Property Value
TargetResidency
Gets the target residency level.
public int TargetResidency { get; }
Property Value
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
intThe 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
StreamingQualityThe 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
IDatabaseFileProviderServicestorage
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
intThe target residency.