engine
 
载入中...
搜索中...
未找到
Public 成员函数 | Protected 成员函数 | Protected 属性 | 所有成员列表
FCachedAudioStreamingManager结构体 参考

This implementation of the audio streaming manager uses an internal LRU cache (or in more advanced applications, a bank of parallel LRU caches) 更多...

#include <AudioStreamingCache.h>

+ 类 FCachedAudioStreamingManager 继承关系图:

Public 成员函数

virtual void AddDecoder (ICompressedAudioInfo *CompressedAudioInfo) override
 Adds the decoder to the streaming manager to prevent stream chunks from getting reaped from underneath it
 
virtual void AddLevel (class ULevel *Level) override
 Adds a ULevel that has already prepared StreamingData to the streaming manager.
 
virtual void AddStreamingSoundSource (FSoundSource *SoundSource) override
 Adds a new Sound Source to the streaming manager.
 
virtual void AddStreamingSoundWave (USoundWave *SoundWave) override
 Adds a new Sound Wave to the streaming manager.
 
virtual int32 BlockTillAllRequestsFinished (float TimeLimit=0.0f, bool bLogResults=false) override
 Blocks till all pending requests are fulfilled. 更多...
 
virtual void CancelForcedResources () override
 Cancels the timed Forced resources (i.e used the Kismet action "Stream In Textures").
 
 FCachedAudioStreamingManager (const FCachedAudioStreamingManagerParams &InitParams)
 Constructor, initializing all members
 
virtual FString GenerateMemoryReport () override
 Generate a memory report as a formatted string for this streaming manager.
 
virtual FAudioChunkHandle GetLoadedChunk (const USoundWave *SoundWave, uint32 ChunkIndex, bool bBlockForLoad=false, bool bForImmediatePlayback=false) const override
 Gets a pointer to a chunk of audio data 更多...
 
virtual bool IsManagedStreamingSoundSource (const FSoundSource *SoundSource) const override
 Returns true if this is a streaming Sound Source that is managed by the streaming manager.
 
virtual bool IsManagedStreamingSoundWave (const USoundWave *SoundWave) const override
 Returns true if this is a Sound Wave that is managed by the streaming manager.
 
virtual bool IsStreamingInProgress (const USoundWave *SoundWave) override
 Returns true if this Sound Wave is currently streaming a chunk.
 
virtual void NotifyLevelChange () override
 Notifies manager of "level" change.
 
virtual void NotifyLevelOffset (class ULevel *Level, const FVector &Offset) override
 Notifies manager that level primitives were shifted
 
virtual void RemoveDecoder (ICompressedAudioInfo *CompressedAudioInfo) override
 Removes the decoder from the streaming manager.
 
virtual void RemoveLevel (class ULevel *Level) override
 Removes a ULevel from the streaming manager.
 
virtual void RemoveStreamingSoundSource (FSoundSource *SoundSource) override
 Removes a Sound Source from the streaming manager.
 
virtual void RemoveStreamingSoundWave (USoundWave *SoundWave) override
 Removes a Sound Wave from the streaming manager.
 
virtual int32 RenderStatAudioStreaming (UWorld *World, FViewport *Viewport, FCanvas *Canvas, int32 X, int32 Y, const FVector *ViewLocation, const FRotator *ViewRotation) override
 Used for rendering debug info:
 
virtual bool RequestChunk (USoundWave *SoundWave, uint32 ChunkIndex, TFunction< void(EAudioChunkLoadResult)> OnLoadCompleted, ENamedThreads::Type ThreadToCallOnLoadCompletedOn, bool bForImmediatePlayback=false) override
 Manually prepare a chunk to start playing back. 更多...
 
virtual void SetDisregardWorldResourcesForFrames (int32 NumFrames) override
 Don't stream world resources for the next NumFrames.
 
virtual void SetProfilingMode (bool bEnabled) override
 Whether to toggle a performance intensive profiling mode the streaming manager.
 
virtual uint64 TrimMemory (uint64 NumBytesToFree) override
 This will start evicting elements from the cache until either hit our target of bytes or run out of chunks we can free. 更多...
 
virtual void UpdateResourceStreaming (float DeltaTime, bool bProcessEverything=false) override
 Updates streaming, taking into account all current view infos. 更多...
 
virtual void AddDecoder (ICompressedAudioInfo *CompressedAudioInfo)=0
 Adds the decoder to the streaming manager to prevent stream chunks from getting reaped from underneath it
 
virtual void AddStreamingSoundSource (FSoundSource *SoundSource)=0
 Adds a new Sound Source to the streaming manager.
 
virtual void AddStreamingSoundWave (USoundWave *SoundWave)=0
 Adds a new Sound Wave to the streaming manager.
 
virtual FString GenerateMemoryReport ()=0
 Generate a memory report as a formatted string for this streaming manager.
 
virtual FAudioChunkHandle GetLoadedChunk (const USoundWave *SoundWave, uint32 ChunkIndex, bool bBlockForLoad=false, bool bForImmediatePlayback=false) const =0
 Gets a pointer to a chunk of audio data 更多...
 
virtual bool IsManagedStreamingSoundSource (const FSoundSource *SoundSource) const =0
 Returns true if this is a streaming Sound Source that is managed by the streaming manager.
 
virtual bool IsManagedStreamingSoundWave (const USoundWave *SoundWave) const =0
 Returns true if this is a Sound Wave that is managed by the streaming manager.
 
virtual bool IsStreamingInProgress (const USoundWave *SoundWave)=0
 Returns true if this Sound Wave is currently streaming a chunk.
 
virtual void RemoveDecoder (ICompressedAudioInfo *CompressedAudioInfo)=0
 Removes the decoder from the streaming manager.
 
virtual void RemoveStreamingSoundSource (FSoundSource *SoundSource)=0
 Removes a Sound Source from the streaming manager.
 
virtual void RemoveStreamingSoundWave (USoundWave *SoundWave)=0
 Removes a Sound Wave from the streaming manager.
 
virtual int32 RenderStatAudioStreaming (UWorld *World, FViewport *Viewport, FCanvas *Canvas, int32 X, int32 Y, const FVector *ViewLocation, const FRotator *ViewRotation)=0
 Used for rendering debug info:
 
virtual bool RequestChunk (USoundWave *SoundWave, uint32 ChunkIndex, TFunction< void(EAudioChunkLoadResult)> OnLoadCompleted=[](EAudioChunkLoadResult) {}, ENamedThreads::Type ThreadToCallOnLoadCompletedOn=ENamedThreads::AnyThread, bool bForImmediatePlayback=false)=0
 Manually prepare a chunk to start playing back. 更多...
 
virtual void SetProfilingMode (bool bEnabled)=0
 Whether to toggle a performance intensive profiling mode the streaming manager.
 
virtual uint64 TrimMemory (uint64 NumBytesToFree)=0
 This will start evicting elements from the cache until either hit our target of bytes or run out of chunks we can free. 更多...
 
- Public 成员函数 继承自 IStreamingManager
virtual void AddLevel (class ULevel *Level)=0
 Adds a ULevel that has already prepared StreamingData to the streaming manager.
 
ENGINE_API void AddViewInformation (const FVector &ViewOrigin, float ScreenSize, float FOVScreenSize, float BoostFactor=1.0f, bool bOverrideLocation=false, float Duration=0.0f, TWeakObjectPtr< AActor > InActorToBoost=NULL)
 Adds the passed in view information to the static array. 更多...
 
ENGINE_API void AddViewSlaveLocation (const FVector &SlaveLocation, float BoostFactor=1.0f, bool bOverrideLocation=false, float Duration=0.0f)
 Queue up view "slave" locations to the streaming system. 更多...
 
virtual int32 BlockTillAllRequestsFinished (float TimeLimit=0.0f, bool bLogResults=false)=0
 Blocks till all pending requests are fulfilled. 更多...
 
virtual void CancelForcedResources ()=0
 Cancels the timed Forced resources (i.e used the Kismet action "Stream In Textures").
 
virtual bool Exec (UWorld *InWorld, const TCHAR *Cmd, FOutputDevice &Ar)
 Allows the streaming manager to process exec commands. 更多...
 
ENGINE_API int32 GetNumViews () const
 Returns the number of view infos.
 
virtual int32 GetNumWantingResources () const
 Returns the number of resources that currently wants to be streamed in.
 
virtual int32 GetNumWantingResourcesID () const
 Returns the current ID for GetNumWantingResources(). 更多...
 
ENGINE_API const FStreamingViewInfo & GetViewInformation (int32 ViewIndex) const
 Returns the view info by the specified index.
 
virtual void NotifyActorDestroyed (AActor *Actor)
 Called when a spawned actor is destroyed.
 
virtual void NotifyLevelChange ()=0
 Notifies manager of "level" change.
 
virtual void NotifyLevelOffset (class ULevel *Level, const FVector &Offset)=0
 Notifies manager that level primitives were shifted
 
virtual void NotifyPrimitiveDetached (const UPrimitiveComponent *Primitive)
 Called when a primitive is detached from an actor or another component.
 
virtual void NotifyPrimitiveUpdated (const UPrimitiveComponent *Primitive)
 Called when a primitive streaming data needs to be updated.
 
virtual void NotifyPrimitiveUpdated_Concurrent (const UPrimitiveComponent *Primitive)
 Called when a primitive streaming data needs to be updated in the last stage of the frame.
 
virtual void PropagateLightingScenarioChange ()
 Propagates a change to the active lighting scenario.
 
virtual void RemoveLevel (class ULevel *Level)=0
 Removes a ULevel from the streaming manager.
 
void RemoveStreamingViews (ERemoveStreamingViews RemovalType)
 Removes streaming views from the streaming manager. 更多...
 
virtual void SetDisregardWorldResourcesForFrames (int32 NumFrames)=0
 Don't stream world resources for the next NumFrames.
 
virtual int32 StreamAllResources (float TimeLimit=0.0f)
 Streams in/out all resources that wants to and blocks until it's done. 更多...
 
virtual ENGINE_API void Tick (float DeltaTime, bool bProcessEverything=false)
 Calls UpdateResourceStreaming(), and does per-frame cleaning. 更多...
 
virtual void UpdateResourceStreaming (float DeltaTime, bool bProcessEverything=false)=0
 Updates streaming, taking into account all current view infos. 更多...
 
virtual ~IStreamingManager ()
 Virtual destructor
 

Protected 成员函数

virtual void AddReferenceToChunk (const FAudioChunkHandle &InHandle) override
 This can be used to increment reference counted handles to audio chunks. 更多...
 
FAudioChunkCache * GetCacheForWave (const USoundWave *InSoundWave) const
 Returns which cache this sound wave should be in, based on the size of this sound wave's chunk, or nullptr if MemoryLoadOnDemand is disabled.
 
int32 GetNextChunkIndex (const USoundWave *InSoundWave, uint32 CurrentChunkIndex) const
 Returns the next chunk to kick off a load for, or INDEX_NONE if there is only one chunk to cache.
 
virtual void RemoveReferenceToChunk (const FAudioChunkHandle &InHandle) override
 This can be used to decrement reference counted handles to audio chunks. 更多...
 
virtual void AddReferenceToChunk (const FAudioChunkHandle &InHandle)=0
 This can be used to increment reference counted handles to audio chunks. 更多...
 
virtual void RemoveReferenceToChunk (const FAudioChunkHandle &InHandle)=0
 This can be used to decrement reference counted handles to audio chunks. 更多...
 
- Protected 成员函数 继承自 IStreamingManager
void SetupViewInfos (float DeltaTime)
 Sets up the CurrentViewInfos array based on PendingViewInfos, LastingViewInfos and SlaveLocations. 更多...
 

Protected 属性

TArray< FAudioChunkCache > CacheArray
 Audio chunk caches. 更多...
 
- Protected 属性 继承自 IStreamingManager
int32 NumWantingResources
 Number of resources that currently wants to be streamed in.
 
int32 NumWantingResourcesCounter
 The current counter for NumWantingResources. 更多...
 

额外继承的成员函数

- 静态 Public 成员函数 继承自 IStreamingManager
static ENGINE_API struct FStreamingManagerCollection * Get_Concurrent ()
 Same as get but could fail if state not allocated or shutdown.
 
static ENGINE_API bool HasShutdown ()
 Checks if the streaming manager has already been shut down.
 
- 静态 Protected 成员函数 继承自 IAudioStreamingManager
static FAudioChunkHandle BuildChunkHandle (const uint8 *InData, uint32 NumBytes, const USoundWave *InSoundWave, const FName &SoundWaveName, uint32 InChunkIndex, uint64 CacheLookupID)
 This can be called by implementers of IAudioStreamingManager to construct an FAudioChunkHandle using an otherwise inaccessible constructor.
 
- 静态 Protected 成员函数 继承自 IStreamingManager
static void AddViewInfoToArray (TArray< FStreamingViewInfo > &ViewInfos, const FVector &ViewOrigin, float ScreenSize, float FOVScreenSize, float BoostFactor, bool bOverrideLocation, float Duration, TWeakObjectPtr< AActor > InActorToBoost)
 Adds the passed in view information to the static array. 更多...
 
static void RemoveViewInfoFromArray (TArray< FStreamingViewInfo > &ViewInfos, const FVector &ViewOrigin)
 Remove view infos with the same location from the given array. 更多...
 
- 静态 Protected 属性 继承自 IStreamingManager
static bool bPendingRemoveViews
 Set when Tick() has been called. 更多...
 
static ENGINE_API TArray< FStreamingViewInfo > CurrentViewInfos
 Current collection of views that need to be taken into account for streaming. 更多...
 
static TArray< FStreamingViewInfo > LastingViewInfos
 Views that stick around for a while. 更多...
 
static TArray< FStreamingViewInfo > PendingViewInfos
 Pending views. 更多...
 
static TArray< FSlaveLocation > SlaveLocations
 Collection of view locations that will be added at the next call to AddViewInformation.
 

详细描述

This implementation of the audio streaming manager uses an internal LRU cache (or in more advanced applications, a bank of parallel LRU caches)

成员函数说明

◆ AddReferenceToChunk()

virtual void FCachedAudioStreamingManager::AddReferenceToChunk ( const FAudioChunkHandle &  InHandle)
overrideprotectedvirtual

This can be used to increment reference counted handles to audio chunks.

Called by the copy constructor of FAudioChunkHandle.

实现了 IAudioStreamingManager.

◆ BlockTillAllRequestsFinished()

virtual int32 FCachedAudioStreamingManager::BlockTillAllRequestsFinished ( float  TimeLimit = 0.0f,
bool  bLogResults = false 
)
overridevirtual

Blocks till all pending requests are fulfilled.

参数
TimeLimitOptional time limit for processing, in seconds. Specifying 0 means infinite time limit.
bLogResultsWhether to dump the results to the log.
返回
Number of streaming requests still in flight, if the time limit was reached before they were finished.

实现了 IStreamingManager.

◆ GetLoadedChunk()

virtual FAudioChunkHandle FCachedAudioStreamingManager::GetLoadedChunk ( const USoundWave *  SoundWave,
uint32  ChunkIndex,
bool  bBlockForLoad = false,
bool  bForImmediatePlayback = false 
) const
overridevirtual

Gets a pointer to a chunk of audio data

参数
SoundWaveSoundWave we want a chunk from
ChunkIndexIndex of the chunk we want
bBlockForLoadif true, will block this thread until we finish loading this chunk.
bForImmediatePlaybackif true, will optionally reprioritize this chunk's load request. See au.streamcaching.PlaybackRequestPriority.
返回
a handle to the loaded chunk. Can return a default constructed FAudioChunkHandle if the chunk is not loaded yet.

实现了 IAudioStreamingManager.

◆ RemoveReferenceToChunk()

virtual void FCachedAudioStreamingManager::RemoveReferenceToChunk ( const FAudioChunkHandle &  InHandle)
overrideprotectedvirtual

This can be used to decrement reference counted handles to audio chunks.

Called by the destructor of FAudioChunkHandle.

实现了 IAudioStreamingManager.

◆ RequestChunk()

virtual bool FCachedAudioStreamingManager::RequestChunk ( USoundWave *  SoundWave,
uint32  ChunkIndex,
TFunction< void(EAudioChunkLoadResult)>  OnLoadCompleted,
ENamedThreads::Type  ThreadToCallOnLoadCompletedOn,
bool  bForImmediatePlayback = false 
)
overridevirtual

Manually prepare a chunk to start playing back.

This should only be used when the Load On Demand feature is enabled, and returns false on failure.

参数
SoundWaveSoundWave we would like to request a chunk of.
ChunkIndexthe index of that soundwave we'd like to request a chunk of.
OnLoadCompletedoptional callback when the load completes.
ThreadToCallOnLoadCompleteOn.Optional specifier for which thread OnLoadCompleted should be called on.
bForImmediatePlaybacif true, this will optionally reprioritize this chunk's load request.

实现了 IAudioStreamingManager.

◆ TrimMemory()

virtual uint64 FCachedAudioStreamingManager::TrimMemory ( uint64  NumBytesToFree)
overridevirtual

This will start evicting elements from the cache until either hit our target of bytes or run out of chunks we can free.

参数
NumBytesToFreeThe amount of memory we would like to free, in bytes.
返回
the amount of bytes we managed to free.

实现了 IAudioStreamingManager.

◆ UpdateResourceStreaming()

virtual void FCachedAudioStreamingManager::UpdateResourceStreaming ( float  DeltaTime,
bool  bProcessEverything = false 
)
overridevirtual

Updates streaming, taking into account all current view infos.

Can be called multiple times per frame.

参数
DeltaTimeTime since last call in seconds
bProcessEverything[opt] If true, process all resources with no throttling limits

实现了 IStreamingManager.

类成员变量说明

◆ CacheArray

TArray<FAudioChunkCache> FCachedAudioStreamingManager::CacheArray
protected

Audio chunk caches.

These are set up on initialization.


该结构体的文档由以下文件生成: