FMediaSamples

General purpose media sample queue.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

IMediaSamples

FMediaSamples

References

Module

MediaUtils

Header

/Engine/Source/Runtime/MediaUtils/Public/MediaSamples.h

Include

#include "MediaSamples.h"

Syntax

class FMediaSamples : public IMediaSamples

Remarks

General purpose media sample queue.

Functions

Name Description

Public function

void

 

AddAudio

(
    const TSharedRef< IMediaAudioSample...
)

Add the given audio sample to the cache.

Public function

void

 

AddCaption

(
    const TSharedRef< IMediaOverlaySamp...
)

Add the given caption sample to the cache.

Public function

void

 

AddMetadata

(
    const TSharedRef< IMediaBinarySampl...
)

Add the given audio sample to the cache.

Public function

void

 

AddSubtitle

(
    const TSharedRef< IMediaOverlaySamp...
)

Add the given subtitle sample to the cache.

Public function

void

 

AddVideo

(
    const TSharedRef< IMediaTextureSamp...
)

Add the given audio sample to the cache.

Overridden from IMediaSamples

Name Description

Public function Virtual Const

bool

 

CanReceiveAudioSamples

(
    uint32 Num
)

Check if can receive more audio samples

Public function Virtual Const

bool

 

CanReceiveVideoSamples

(
    uint32 Num
)

Check if can receive more video samples

Public function Virtual

bool

 

FetchAudio

(
    TRange< FTimespan > TimeRange,
    TSharedPtr< IMediaAudioSample, ESPM...
)

Peek next video sample's timestamp

Public function Virtual

EFetchBestSa...

 

FetchBestVideoSampleForTimeRange

(
    const TRange< FMediaTimeStamp >& T...,
    TSharedPtr< IMediaTextureSample, ES...,
    bool bReverse
)

Fetch video sample best suited for the given time range.

Public function Virtual

bool

 

FetchCaption

(
    TRange< FMediaTimeStamp > TimeRange,
    TSharedPtr< IMediaOverlaySample, ES...
)

Public function Virtual

bool

 

FetchCaption

(
    TRange< FTimespan > TimeRange,
    TSharedPtr< IMediaOverlaySample, ES...
)

Fetch the next caption sample.

Public function Virtual

bool

 

FetchMetadata

(
    TRange< FTimespan > TimeRange,
    TSharedPtr< IMediaBinarySample, ESP...
)

Fetch the next metadata sample.

Public function Virtual

bool

 

FetchSubtitle

(
    TRange< FMediaTimeStamp > TimeRange,
    TSharedPtr< IMediaOverlaySample, ES...
)

Public function Virtual

bool

 

FetchSubtitle

(
    TRange< FTimespan > TimeRange,
    TSharedPtr< IMediaOverlaySample, ES...
)

Fetch the next subtitle sample.

Public function Virtual

bool

 

FetchVideo

(
    TRange< FMediaTimeStamp > TimeRange,
    TSharedPtr< IMediaTextureSample, ES...
)

Public function Virtual

bool

 

FetchVideo

(
    TRange< FTimespan > TimeRange,
    TSharedPtr< IMediaTextureSample, ES...
)

Fetch the next video sample.

Public function Virtual

void

 

FlushSamples()

Discard any outstanding media samples.

Public function Virtual Const

int32

 

NumAudio()

Get the number of queued audio samples.

Public function Virtual Const

int32

 

NumCaption()

Get the number of queued caption samples.

Public function Virtual Const

int32

 

NumMetadataSamples()

Get the number of queued metadata samples.

Public function Virtual Const

int32

 

NumSubtitleSamples()

Get the number of queued subtitle samples.

Public function Virtual Const

int32

 

NumVideoSamples()

Get the number of queued video samples.

Public function Virtual

bool

 

PeekVideoSampleTime

(
    FMediaTimeStamp& TimeStamp
)

Public function Virtual

uint32

 

PurgeOutdatedSubtitleSamples

(
    const FMediaTimeStamp& ReferenceTi...,
    bool bReversed
)

Remove any subtitle samples from the queue that have no chance of being displayed anymore

Public function Virtual

uint32

 

PurgeOutdatedVideoSamples

(
    const FMediaTimeStamp& ReferenceTi...,
    bool bReversed
)

Remove any video samples from the queue that have no chance of being displayed anymore