![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <MediaSampleCache.h>
Public Member Functions | |
| MEDIAUTILS_API | FMediaSampleCache () |
| MEDIAUTILS_API void | Empty () |
| MEDIAUTILS_API TSharedPtr< IMediaAudioSample, ESPMode::ThreadSafe > | GetAudioSample (FTimespan Time) |
| MEDIAUTILS_API void | GetCachedAudioSampleRanges (TRangeSet< FTimespan > &OutTimeRanges) const |
| MEDIAUTILS_API void | GetCachedVideoSampleRanges (TRangeSet< FTimespan > &OutTimeRanges) const |
| MEDIAUTILS_API void | GetOverlaySamples (FTimespan Time, TArray< TSharedPtr< IMediaOverlaySample, ESPMode::ThreadSafe > > &OutSamples) |
| MEDIAUTILS_API TSharedPtr< IMediaTextureSample, ESPMode::ThreadSafe > | GetVideoSample (FTimespan Time, bool Forward) |
| void | SetCacheWindow (FTimespan Ahead, FTimespan Behind) |
| MEDIAUTILS_API void | Tick (FTimespan DeltaTime, float Rate, FTimespan Time) |
Implements a cache for media samples.
| FMediaSampleCache::FMediaSampleCache | ( | ) |
Default constructor.
| TSharedPtr< IMediaAudioSample, ESPMode::ThreadSafe > FMediaSampleCache::GetAudioSample | ( | FTimespan | Time | ) |
Get the audio sample for the specified play time.
This method returns the sample that contains the specified time code.
| Time | The time to get the sample for (in the player's clock). |
Get the time ranges of audio samples currently in the cache.
| OutTimeRanges | Will contain the set of cached sample time ranges. |
Get the time ranges of video samples currently in the cache.
| OutTimeRanges | Will contain the set of cached sample time ranges. |
| void FMediaSampleCache::GetOverlaySamples | ( | FTimespan | Time, |
| TArray< TSharedPtr< IMediaOverlaySample, ESPMode::ThreadSafe > > & | OutSamples | ||
| ) |
Get the text overlay samples for the specified time.
| Time | The time to get the sample for (in the player's clock). |
| OutSamples | Will contain the overlay samples. |
| TSharedPtr< IMediaTextureSample, ESPMode::ThreadSafe > FMediaSampleCache::GetVideoSample | ( | FTimespan | Time, |
| bool | Forward | ||
| ) |
Get the video sample for the specified play time.
This method will return the closest match for the given time code. If the current play rate is positive, the closest sample with an equal or older time is returned. If the current rate is negative, the closest sample with an equal or newer time is returned.
| Time | The time to get the sample for (in the player's clock). |
| Forward | Whether the play direction is forward (true) or backward (false). |
Set the time window of samples to cache.
| Ahead | Maximum time of samples to cache ahead of the play position. |
| Behind | Maximum time of samples to cache behind the play position. |
Tick the cache.
This method fetches any unconsumed media samples from the player and removes expired samples from the cache.
| DeltaTime | Time since the last tick. |
| Rate | The current play rate. |
| Time | The current play time. |