engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FMediaSampleCache类 参考

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.

成员函数说明

◆ Empty()

void FMediaSampleCache::Empty ( )

Empty the cache.

参见
Update

◆ GetAudioSample()

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.

参数
TimeThe time to get the sample for (in the player's clock).
返回
The sample, or nullptr if no sample available.
参见
GetAudioSamples, GetCachedVideoSampleRanges, GetOverlaySamples

◆ GetCachedAudioSampleRanges()

void FMediaSampleCache::GetCachedAudioSampleRanges ( TRangeSet< FTimespan > &  OutTimeRanges) const

Get the time ranges of audio samples currently in the cache.

参数
OutTimeRangesWill contain the set of cached sample time ranges.
参见
GetAudioSample, GetCachedVideoSampleRanges

◆ GetCachedVideoSampleRanges()

void FMediaSampleCache::GetCachedVideoSampleRanges ( TRangeSet< FTimespan > &  OutTimeRanges) const

Get the time ranges of video samples currently in the cache.

参数
OutTimeRangesWill contain the set of cached sample time ranges.
参见
GetCachedAudioSampleRanges, GetVideoSample

◆ GetOverlaySamples()

void FMediaSampleCache::GetOverlaySamples ( FTimespan  Time,
TArray< TSharedPtr< IMediaOverlaySample, ESPMode::ThreadSafe > > &  OutSamples 
)

Get the text overlay samples for the specified time.

参数
TimeThe time to get the sample for (in the player's clock).
OutSamplesWill contain the overlay samples.
参见
GetAudioSample, GetVideoSample

◆ GetVideoSample()

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.

参数
TimeThe time to get the sample for (in the player's clock).
ForwardWhether the play direction is forward (true) or backward (false).
返回
The sample, or nullptr if no sample available.
参见
GetAudioSample, GetCachedVideoSampleRanges, GetOverlaySamples

◆ SetCacheWindow()

void FMediaSampleCache::SetCacheWindow ( FTimespan  Ahead,
FTimespan  Behind 
)
inline

Set the time window of samples to cache.

参数
AheadMaximum time of samples to cache ahead of the play position.
BehindMaximum time of samples to cache behind the play position.

◆ Tick()

void FMediaSampleCache::Tick ( FTimespan  DeltaTime,
float  Rate,
FTimespan  Time 
)

Tick the cache.

This method fetches any unconsumed media samples from the player and removes expired samples from the cache.

参数
DeltaTimeTime since the last tick.
RateThe current play rate.
TimeThe current play time.
参见
Initialize, Shutdown

该类的文档由以下文件生成: