Implements a cache for media samples. 更多...
#include <MediaSampleCache.h>
Public 成员函数 | |
| void | Empty () |
| Empty the cache. 更多... | |
| FMediaSampleCache () | |
| Default constructor. | |
| TSharedPtr< IMediaAudioSample, ESPMode::ThreadSafe > | GetAudioSample (FTimespan Time) |
| Get the audio sample for the specified play time. 更多... | |
| void | GetCachedAudioSampleRanges (TRangeSet< FTimespan > &OutTimeRanges) const |
| Get the time ranges of audio samples currently in the cache. 更多... | |
| void | GetCachedVideoSampleRanges (TRangeSet< FTimespan > &OutTimeRanges) const |
| Get the time ranges of video samples currently in the cache. 更多... | |
| void | GetOverlaySamples (FTimespan Time, TArray< TSharedPtr< IMediaOverlaySample, ESPMode::ThreadSafe > > &OutSamples) |
| Get the text overlay samples for the specified time. 更多... | |
| TSharedPtr< IMediaTextureSample, ESPMode::ThreadSafe > | GetVideoSample (FTimespan Time, bool Forward) |
| Get the video sample for the specified play time. 更多... | |
| void | SetCacheWindow (FTimespan Ahead, FTimespan Behind) |
| Set the time window of samples to cache. 更多... | |
| void | Tick (FTimespan DeltaTime, float Rate, FTimespan Time) |
| Tick the cache. 更多... | |
Implements a cache for media samples.
| void FMediaSampleCache::Empty | ( | ) |
Empty the cache.
| 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. |