Files
UnrealEngineUWP/Engine/Plugins/Experimental/GeometryCache/Source/GeometryCacheStreamer/Public/IGeometryCacheStream.h
anousack kitisa aa29f23b38 Streaming GeometryCache:
* Implemented memory limits in streaming GeometryCache from Alembic. There are two settings available under Project Settings > Plugins > Geometry Cache to control the look-ahead buffer and the overall memory limit for all streams.

#jira UETOOL-3881

#rb Johan.Duparc

#preflight 619c0abe3a72199267381885

#ROBOMERGE-AUTHOR: anousack.kitisa
#ROBOMERGE-SOURCE: CL 18269585 in //UE5/Release-5.0/... via CL 18269600
#ROBOMERGE-BOT: STARSHIP (Release-Engine-Staging -> Release-Engine-Test) (v895-18170469)

[CL 18269614 by anousack kitisa in ue5-release-engine-test branch]
2021-11-23 09:27:18 -05:00

50 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
struct FGeometryCacheMeshData;
struct FGeometryCacheStreamStats;
/** Interface to stream GeometryCacheMeshData asynchronously from any source through the GeometryCacheStreamer */
class IGeometryCacheStream
{
public:
virtual ~IGeometryCacheStream() = default;
/** Prefetch NumFrames starting from the given StartFrameIndex. If no NumFrames given, prefetch the whole stream */
virtual void Prefetch(int32 StartFrameIndex, int32 NumFrames = 0) = 0;
/** Return the number of frame indices needed to be loaded */
virtual uint32 GetNumFramesNeeded() = 0;
/** Request a read of the next frame as determined by the stream. Return true if the request could be handled */
virtual bool RequestFrameData() = 0;
/** Update the status of the read requests currently in progress. Return the frame indices that were completed */
virtual void UpdateRequestStatus(TArray<int32>& OutFramesCompleted) = 0;
/* Get the MeshData at given FrameIndex without waiting for data to be ready
* Return true if MeshData could be retrieved
*/
virtual bool GetFrameData(int32 FrameIndex, FGeometryCacheMeshData& OutMeshData) = 0;
/** Cancel the scheduled read requests. Return the number of requests that were canceled */
virtual int32 CancelRequests() = 0;
/** Return the memory usage and related stats for the stream */
virtual const FGeometryCacheStreamStats& GetStreamStats() const = 0;
/** Set the memory usage limits for the stream */
virtual void SetLimits(float MaxMemoryAllowed, float MaxCachedDuration) = 0;
};
struct FGeometryCacheStreamStats
{
uint32 NumCachedFrames = 0; // number of frames currently resident in memory
float CachedDuration = 0.0f;// in seconds
float MemoryUsed = 0.0f; // in MB
float AverageBitrate = 0.0f;// in MB/s
};