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

Facade for low-level media player objects. 更多...

#include <MediaPlayerFacade.h>

+ 类 FMediaPlayerFacade 继承关系图:

Public 成员函数

void AddAudioSampleSink (const TSharedRef< FMediaAudioSampleSink, ESPMode::ThreadSafe > &SampleSink)
 Add the given audio sample sink to this player. 更多...
 
void AddCaptionSampleSink (const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &SampleSink)
 Add the given audio sample sink to this player. 更多...
 
void AddMetadataSampleSink (const TSharedRef< FMediaBinarySampleSink, ESPMode::ThreadSafe > &SampleSink)
 Add the given audio sample sink to this player. 更多...
 
void AddSubtitleSampleSink (const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &SampleSink)
 Add the given audio sample sink to this player. 更多...
 
void AddVideoSampleSink (const TSharedRef< FMediaTextureSampleSink, ESPMode::ThreadSafe > &SampleSink)
 Add the given audio sample sink to this player. 更多...
 
bool CanPause () const
 Whether playback can be paused. 更多...
 
bool CanPlayUrl (const FString &Url, const IMediaOptions *Options)
 Whether the specified URL can be played by this player. 更多...
 
bool CanResume () const
 Whether playback can be resumed. 更多...
 
bool CanScrub () const
 Whether playback can be scrubbed. 更多...
 
bool CanSeek () const
 Whether playback can jump to a position. 更多...
 
void Close ()
 Close the currently open media, if any.
 
 DECLARE_EVENT_OneParam (FMediaPlayerFacade, FOnMediaEvent, EMediaEvent) FOnMediaEvent &OnMediaEvent()
 Get an event delegate that is invoked when a media event occurred.
 
 FMediaPlayerFacade ()
 Default constructor.
 
uint32 GetAudioTrackChannels (int32 TrackIndex, int32 FormatIndex) const
 Get the number of channels in the specified audio track. 更多...
 
uint32 GetAudioTrackSampleRate (int32 TrackIndex, int32 FormatIndex) const
 Get the sample rate of the specified audio track. 更多...
 
FString GetAudioTrackType (int32 TrackIndex, int32 FormatIndex) const
 Get the type of the specified audio track format. 更多...
 
FTimespan GetDuration () const
 Get the media's duration. 更多...
 
const FGuid & GetGuid ()
 Get the player's globally unique identifier. 更多...
 
FString GetInfo () const
 Get debug information about the player and currently opened media. 更多...
 
FTimespan GetLastAudioRenderedSampleTime () const
 Get time of last audio sample played 更多...
 
FText GetMediaName () const
 Get the human readable name of the currently loaded media source. 更多...
 
int32 GetNumTrackFormats (EMediaTrackType TrackType, int32 TrackIndex) const
 Get the number of formats of the specified track. 更多...
 
int32 GetNumTracks (EMediaTrackType TrackType) const
 Get the number of tracks of the given type. 更多...
 
TSharedPtr< IMediaPlayer, ESPMode::ThreadSafe > GetPlayer () const
 Get the low-level player associated with this object. 更多...
 
FName GetPlayerName () const
 Get the name of the current native media player. 更多...
 
float GetRate () const
 Get the media's current playback rate. 更多...
 
int32 GetSelectedTrack (EMediaTrackType TrackType) const
 Get the index of the currently selected track of the given type. 更多...
 
FString GetStats () const
 Get playback statistics information. 更多...
 
TRangeSet< float > GetSupportedRates (bool Unthinned=true) const
 Get the supported playback rates. 更多...
 
FTimespan GetTime () const
 Get the media's current playback time. 更多...
 
FMediaTimeStamp GetTimeStamp () const
 Get the media's current playback time stamp. 更多...
 
FText GetTrackDisplayName (EMediaTrackType TrackType, int32 TrackIndex) const
 Get the human readable name of the specified track. 更多...
 
int32 GetTrackFormat (EMediaTrackType TrackType, int32 TrackIndex) const
 Get the index of the active format of the specified track. 更多...
 
FString GetTrackLanguage (EMediaTrackType TrackType, int32 TrackIndex) const
 Get the language tag of the specified track. 更多...
 
const FString & GetUrl () const
 Get the URL of the currently loaded media, if any. 更多...
 
float GetVideoTrackAspectRatio (int32 TrackIndex, int32 FormatIndex) const
 Get the aspect ratio of the specified video track. 更多...
 
FIntPoint GetVideoTrackDimensions (int32 TrackIndex, int32 FormatIndex) const
 Get the width and height of the specified video track. 更多...
 
float GetVideoTrackFrameRate (int32 TrackIndex, int32 FormatIndex) const
 Get frame rate of the specified video track. 更多...
 
TRange< float > GetVideoTrackFrameRates (int32 TrackIndex, int32 FormatIndex) const
 Get the supported range of frame rates of the specified video track. 更多...
 
FString GetVideoTrackType (int32 TrackIndex, int32 FormatIndex) const
 Get the type of the specified video track format. 更多...
 
bool GetViewField (float &OutHorizontal, float &OutVertical) const
 Get the field of view. 更多...
 
bool GetViewOrientation (FQuat &OutOrientation) const
 Get the view's orientation. 更多...
 
bool HasError () const
 Check whether the player is in an error state. 更多...
 
bool IsBuffering () const
 Whether the player is currently buffering data. 更多...
 
bool IsClosed () const
 Whether media is currently closed. 更多...
 
bool IsConnecting () const
 Whether the player is currently connecting to a media source. 更多...
 
bool IsLooping () const
 Whether playback is looping. 更多...
 
bool IsPaused () const
 Whether playback is currently paused. 更多...
 
bool IsPlaying () const
 Whether playback is in progress. 更多...
 
bool IsPreparing () const
 Whether the media is currently opening or buffering. 更多...
 
bool IsReady () const
 Whether media is ready for playback. 更多...
 
bool Open (const FString &Url, const IMediaOptions *Options, const FMediaPlayerOptions *PlayerOptions=nullptr)
 Open a media source from a URL with optional parameters. 更多...
 
void QueryCacheState (EMediaTrackType TrackType, EMediaCacheState State, TRangeSet< FTimespan > &OutTimeRanges) const
 Query the time ranges of cached media samples for the specified caching state. 更多...
 
bool Seek (const FTimespan &Time)
 Seeks to the specified playback time. 更多...
 
bool SelectTrack (EMediaTrackType TrackType, int32 TrackIndex)
 Select the active track of the given type. 更多...
 
void SetBlockOnTime (const FTimespan &Time)
 Set the time on which to block. 更多...
 
void SetCacheWindow (FTimespan Ahead, FTimespan Behind)
 Set sample caching options. 更多...
 
void SetGuid (FGuid &Guid)
 Set the player's globally unique identifier. 更多...
 
void SetLastAudioRenderedSampleTime (FTimespan SampleTime)
 Record last audio sample played to track audio sync (for automated tests) 更多...
 
bool SetLooping (bool Looping)
 Enables or disables playback looping. 更多...
 
void SetMediaOptions (const IMediaOptions *Options)
 Changes media ooptions on the player.
 
bool SetNativeVolume (float Volume)
 Changes the media's native volume. 更多...
 
bool SetRate (float Rate)
 Changes the media's playback rate. 更多...
 
bool SetTrackFormat (EMediaTrackType TrackType, int32 TrackIndex, int32 FormatIndex)
 Set the format on the specified track. 更多...
 
bool SetVideoTrackFrameRate (int32 TrackIndex, int32 FormatIndex, float FrameRate)
 Set the frame rate of the specified video track. 更多...
 
bool SetViewField (float Horizontal, float Vertical, bool Absolute)
 Set the field of view. 更多...
 
bool SetViewOrientation (const FQuat &Orientation, bool Absolute)
 Set the view's orientation. 更多...
 
bool SupportsRate (float Rate, bool Unthinned) const
 Whether the specified playback rate is supported. 更多...
 
virtual void TickFetch (FTimespan DeltaTime, FTimespan Timecode) override
 Called each tick to handle updates after the Engine ticked. 更多...
 
virtual void TickInput (FTimespan DeltaTime, FTimespan Timecode) override
 Called each tick to handle input before the Engine is ticked. 更多...
 
virtual void TickOutput (FTimespan DeltaTime, FTimespan Timecode) override
 Called each tick to output the rendered frame. 更多...
 
virtual void TickTickable () override
 Tick the object.
 
virtual ~FMediaPlayerFacade ()
 Virtual destructor.
 
- Public 成员函数 继承自 IMediaClockSink
virtual void TickFetch (FTimespan DeltaTime, FTimespan Timecode)
 Called each tick to handle updates after the Engine ticked. 更多...
 
virtual void TickInput (FTimespan DeltaTime, FTimespan Timecode)
 Called each tick to handle input before the Engine is ticked. 更多...
 
virtual void TickOutput (FTimespan DeltaTime, FTimespan Timecode)
 Called each tick to output the rendered frame. 更多...
 
virtual void TickRender (FTimespan DeltaTime, FTimespan Timecode)
 Called each tick before the frame finished rendering. 更多...
 
virtual ~IMediaClockSink ()
 Virtual destructor.
 
- Public 成员函数 继承自 IMediaTickable
virtual void TickTickable ()=0
 Tick the object.
 
virtual ~IMediaTickable ()
 Virtual destructor.
 
- Public 成员函数 继承自 TSharedFromThis< FMediaPlayerFacade, ESPMode::ThreadSafe >
TSharedRef< FMediaPlayerFacade, Mode > AsShared ()
 Provides access to a shared reference to this object. 更多...
 
TSharedRef< FMediaPlayerFacade const, Mode > AsShared () const
 Provides access to a shared reference to this object (const.) Note that is only valid to call this after a shared reference (or shared pointer) to the object has already been created. 更多...
 
FORCEINLINE bool DoesSharedInstanceExist () const
 Checks whether our referenced instance is valid (ie, whether it's safe to call AsShared). 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, Mode > const *InSharedPtr, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, Mode > const *InSharedRef, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 

Public 属性

TOptional< FMediaPlayerOptions > ActivePlayerOptions
 Active media player options.
 
FName DesiredPlayerName
 Name of the desired native player, if any.
 
FTimespan TimeDelay
 Extra time to reduce from current player's time.
 

Protected 成员函数

bool BlockOnFetch () const
 Whether sample fetching should block. 更多...
 
void FlushSinks ()
 Flush all media sample sinks.
 
bool GetAudioTrackFormat (int32 TrackIndex, int32 FormatIndex, FMediaAudioTrackFormat &OutFormat) const
 Get details about the specified audio track format. 更多...
 
TSharedPtr< IMediaPlayer, ESPMode::ThreadSafe > GetPlayerForUrl (const FString &Url, const IMediaOptions *Options)
 Get a player that can play the specified media URL. 更多...
 
bool GetVideoTrackFormat (int32 TrackIndex, int32 FormatIndex, FMediaVideoTrackFormat &OutFormat) const
 Get details about the specified audio track format. 更多...
 
void ProcessAudioSamples (IMediaSamples &Samples, TRange< FTimespan > TimeRange)
 Fetch audio samples from the player and forward them to the registered sinks.
 
void ProcessCaptionSamples (IMediaSamples &Samples, TRange< FTimespan > TimeRange)
 Fetch audio samples from the player and forward them to the registered sinks.
 
void ProcessEvent (EMediaEvent Event)
 Process the given media event. 更多...
 
void ProcessMetadataSamples (IMediaSamples &Samples, TRange< FTimespan > TimeRange)
 Fetch metadata samples from the player and forward them to the registered sinks.
 
void ProcessSubtitleSamples (IMediaSamples &Samples, TRange< FTimespan > TimeRange)
 Fetch subtitle samples from the player and forward them to the registered sinks.
 
void ProcessVideoSamples (IMediaSamples &Samples, TRange< FTimespan > TimeRange)
 Fetch video samples from the player and forward them to the registered sinks.
 
void ReceiveMediaEvent (EMediaEvent Event) override
 Receive the given media event. 更多...
 
void SelectDefaultTracks ()
 Select the default media tracks.
 
- Protected 成员函数 继承自 IMediaEventSink
virtual void ReceiveMediaEvent (EMediaEvent Event)=0
 Receive the given media event. 更多...
 
virtual ~IMediaEventSink ()
 Virtual destructor.
 
- Protected 成员函数 继承自 TSharedFromThis< FMediaPlayerFacade, ESPMode::ThreadSafe >
FORCEINLINE TSharedFromThis & operator= (TSharedFromThis const &)
 Hidden stub assignment operator
 
 TSharedFromThis ()
 Hidden stub constructor
 
 TSharedFromThis (TSharedFromThis const &)
 Hidden stub copy constructor
 
 ~TSharedFromThis ()
 Hidden destructor
 
TSharedRef< FMediaPlayerFacade, Mode > AsShared ()
 Provides access to a shared reference to this object. 更多...
 
TSharedRef< FMediaPlayerFacade const, Mode > AsShared () const
 Provides access to a shared reference to this object (const.) Note that is only valid to call this after a shared reference (or shared pointer) to the object has already been created. 更多...
 
FORCEINLINE bool DoesSharedInstanceExist () const
 Checks whether our referenced instance is valid (ie, whether it's safe to call AsShared). 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedPtr< SharedPtrType, Mode > const *InSharedPtr, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 
FORCEINLINE void UpdateWeakReferenceInternal (TSharedRef< SharedRefType, Mode > const *InSharedRef, OtherType *InObject) const
 INTERNAL USE ONLY – Do not call this method. 更多...
 

额外继承的成员函数

- 静态 Protected 成员函数 继承自 TSharedFromThis< FMediaPlayerFacade, ESPMode::ThreadSafe >
static FORCEINLINE TSharedRef< OtherType const, Mode > SharedThis (const OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 
static FORCEINLINE TSharedRef< OtherType, Mode > SharedThis (OtherType *ThisPtr)
 Provides access to a shared reference to an object, given the object's 'this' pointer. 更多...
 

详细描述

Facade for low-level media player objects.

The purpose of this class is to provide a simpler interface to low-level media player implementations. It implements common functionality, such as translating between time codes and play times, and manages the selection and creation of player implementations for a given media source.

Note that, unlike the low-level methods in IMediaTracks, most track and track format related methods in this class allow for INDEX_NONE to be used as track and format indices in order to indicate the 'current selection'.

成员函数说明

◆ AddAudioSampleSink()

void FMediaPlayerFacade::AddAudioSampleSink ( const TSharedRef< FMediaAudioSampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

参数
SampleSinkThe sink to receive audio samples.
参见
AddCaptionSampleSink, AddMetadataSampleSink, AddSubtitleSampleSink, AddVideoSampleSink

◆ AddCaptionSampleSink()

void FMediaPlayerFacade::AddCaptionSampleSink ( const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

参数
SampleSinkThe sink to receive caption samples.
参见
AddAudioSampleSink, AddMetadataSampleSink, AddSubtitleSampleSink, AddVideoSampleSink

◆ AddMetadataSampleSink()

void FMediaPlayerFacade::AddMetadataSampleSink ( const TSharedRef< FMediaBinarySampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

参数
SampleSinkThe sink to receive metadata samples.
参见
AddAudioSampleSink, AddCaptionSampleSink, AddSubtitleSampleSink, AddVideoSampleSink

◆ AddSubtitleSampleSink()

void FMediaPlayerFacade::AddSubtitleSampleSink ( const TSharedRef< FMediaOverlaySampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

参数
SampleSinkThe sink to receive subtitle samples.
参见
AddAudioSampleSink, AddCaptionSampleSink, AddMetadataSampleSink, AddVideoSampleSink

◆ AddVideoSampleSink()

void FMediaPlayerFacade::AddVideoSampleSink ( const TSharedRef< FMediaTextureSampleSink, ESPMode::ThreadSafe > &  SampleSink)

Add the given audio sample sink to this player.

参数
SampleSinkThe sink to receive video samples.
参见
AddAudioSampleSink, AddCaptionSampleSink, AddMetadataSampleSink, AddSubtitleSampleSink

◆ BlockOnFetch()

bool FMediaPlayerFacade::BlockOnFetch ( ) const
protected

Whether sample fetching should block.

返回
true if sample fetching should block, false otherwise.

◆ CanPause()

bool FMediaPlayerFacade::CanPause ( ) const

Whether playback can be paused.

Playback can be paused if the media supports pausing and if it is currently playing.

返回
true if pausing is allowed, false otherwise.
参见
CanResume, CanScrub, CanSeek, Pause

◆ CanPlayUrl()

bool FMediaPlayerFacade::CanPlayUrl ( const FString &  Url,
const IMediaOptions *  Options 
)

Whether the specified URL can be played by this player.

If a desired player name is set for this player, it will only check whether that particular player type can play the specified URL.

参数
UrlThe URL to check.
OptionsOptional media parameters.
参见
CanPlaySource, SetDesiredPlayerName

◆ CanResume()

bool FMediaPlayerFacade::CanResume ( ) const

Whether playback can be resumed.

Playback can be resumed if media is loaded and if it is not already playing.

返回
true if resuming is allowed, false otherwise.
参见
CanPause, CanScrub, CanSeek, SetRate

◆ CanScrub()

bool FMediaPlayerFacade::CanScrub ( ) const

Whether playback can be scrubbed.

返回
true if scrubbing is allowed, false otherwise.
参见
CanPause, CanResume, CanSeek, Seek

◆ CanSeek()

bool FMediaPlayerFacade::CanSeek ( ) const

Whether playback can jump to a position.

返回
true if seeking is allowed, false otherwise.
参见
CanPause, CanResume, CanScrub, Seek

◆ GetAudioTrackChannels()

uint32 FMediaPlayerFacade::GetAudioTrackChannels ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the number of channels in the specified audio track.

参数
TrackIndexIndex of the audio track.
FormatIndexIndex of the track format.
返回
Number of channels.
参见
GetAudioTrackSampleRate, GetAudioTrackType

◆ GetAudioTrackFormat()

bool FMediaPlayerFacade::GetAudioTrackFormat ( int32  TrackIndex,
int32  FormatIndex,
FMediaAudioTrackFormat &  OutFormat 
) const
protected

Get details about the specified audio track format.

参数
TrackIndexThe index of the audio track.
FormatIndexThe index of the track's format.
OutFormatWill contain the format details.
返回
true on success, false otherwise.
参见
GetVideoTrackFormat

◆ GetAudioTrackSampleRate()

uint32 FMediaPlayerFacade::GetAudioTrackSampleRate ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the sample rate of the specified audio track.

参数
TrackIndexIndex of the audio track.
FormatIndexIndex of the track format.
返回
Samples per second.
参见
GetAudioTrackChannels, GetAudioTrackType

◆ GetAudioTrackType()

FString FMediaPlayerFacade::GetAudioTrackType ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the type of the specified audio track format.

参数
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
返回
Audio format type string.
参见
GetAudioTrackSampleRate, GetAudioTrackSampleRate

◆ GetDuration()

FTimespan FMediaPlayerFacade::GetDuration ( ) const

Get the media's duration.

返回
A time span representing the duration.
参见
GetTime, Seek

◆ GetGuid()

const FGuid & FMediaPlayerFacade::GetGuid ( )

Get the player's globally unique identifier.

返回
The Guid.
参见
SetGuid

◆ GetInfo()

FString FMediaPlayerFacade::GetInfo ( ) const

Get debug information about the player and currently opened media.

返回
Information string.
参见
GetStats

◆ GetLastAudioRenderedSampleTime()

FTimespan FMediaPlayerFacade::GetLastAudioRenderedSampleTime ( ) const

Get time of last audio sample played

返回
Time of last audio sample played.

◆ GetMediaName()

FText FMediaPlayerFacade::GetMediaName ( ) const

Get the human readable name of the currently loaded media source.

返回
Media source name, or empty text if no media is opened
参见
GetPlayerName, GetUrl

◆ GetNumTrackFormats()

int32 FMediaPlayerFacade::GetNumTrackFormats ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the number of formats of the specified track.

参数
TrackTypeThe type of media tracks.
TrackIndexThe index of the track.
返回
Number of formats.
参见
GetNumTracks, GetSelectedTrack, SelectTrack

◆ GetNumTracks()

int32 FMediaPlayerFacade::GetNumTracks ( EMediaTrackType  TrackType) const

Get the number of tracks of the given type.

参数
TrackTypeThe type of media tracks.
返回
Number of tracks.
参见
GetSelectedTrack, SelectTrack

◆ GetPlayer()

TSharedPtr< IMediaPlayer, ESPMode::ThreadSafe > FMediaPlayerFacade::GetPlayer ( ) const
inline

Get the low-level player associated with this object.

返回
The player, or nullptr if no player was created.

◆ GetPlayerForUrl()

TSharedPtr< IMediaPlayer, ESPMode::ThreadSafe > FMediaPlayerFacade::GetPlayerForUrl ( const FString &  Url,
const IMediaOptions *  Options 
)
protected

Get a player that can play the specified media URL.

参数
UrlThe URL to play.
OptionsThe media options for the URL.
返回
The player if found, or nullptr otherwise.

◆ GetPlayerName()

FName FMediaPlayerFacade::GetPlayerName ( ) const

Get the name of the current native media player.

返回
Player name, or NAME_None if not available.
参见
GetMediaName

◆ GetRate()

float FMediaPlayerFacade::GetRate ( ) const

Get the media's current playback rate.

返回
The playback rate.
参见
SetRate, SupportsRate

◆ GetSelectedTrack()

int32 FMediaPlayerFacade::GetSelectedTrack ( EMediaTrackType  TrackType) const

Get the index of the currently selected track of the given type.

参数
TrackTypeThe type of track to get.
返回
The index of the selected track, or INDEX_NONE if no track is active.
参见
GetNumTracks, SelectTrack

◆ GetStats()

FString FMediaPlayerFacade::GetStats ( ) const

Get playback statistics information.

返回
Information string.
参见
GetInfo

◆ GetSupportedRates()

TRangeSet< float > FMediaPlayerFacade::GetSupportedRates ( bool  Unthinned = true) const

Get the supported playback rates.

参数
UnthinnedWhether the rates are for unthinned playback (default = true).
返回
The ranges of supported rates.
参见
SetRate, SupportsRate

◆ GetTime()

FTimespan FMediaPlayerFacade::GetTime ( ) const

Get the media's current playback time.

返回
Playback time.
参见
GetDuration, Seek

◆ GetTimeStamp()

FMediaTimeStamp FMediaPlayerFacade::GetTimeStamp ( ) const

Get the media's current playback time stamp.

返回
Playback time stamp.
参见
GetDuration, Seek

◆ GetTrackDisplayName()

FText FMediaPlayerFacade::GetTrackDisplayName ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the human readable name of the specified track.

参数
TrackTypeThe type of track.
TrackIndexThe index of the track.
返回
Display name.
参见
GetNumTracks, GetTrackLanguage

◆ GetTrackFormat()

int32 FMediaPlayerFacade::GetTrackFormat ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the index of the active format of the specified track.

参数
TrackTypeThe type of track.
TrackIndexThe index of the track.
返回
The index of the selected format.
参见
GetNumTrackFormats, GetSelectedTrack, SetTrackFormat

◆ GetTrackLanguage()

FString FMediaPlayerFacade::GetTrackLanguage ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const

Get the language tag of the specified track.

参数
TrackTypeThe type of track.
TrackIndexThe index of the track.
返回
Language tag, i.e. "en-US" for English, or "und" for undefined.
参见
GetNumTracks, GetTrackDisplayName

◆ GetUrl()

const FString & FMediaPlayerFacade::GetUrl ( ) const
inline

Get the URL of the currently loaded media, if any.

返回
Media URL, or empty string if no media was loaded.

◆ GetVideoTrackAspectRatio()

float FMediaPlayerFacade::GetVideoTrackAspectRatio ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the aspect ratio of the specified video track.

参数
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
返回
Aspect ratio.
参见
GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

◆ GetVideoTrackDimensions()

FIntPoint FMediaPlayerFacade::GetVideoTrackDimensions ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the width and height of the specified video track.

参数
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
返回
Video dimensions.
参见
GetVideoTrackAspectRatio, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

◆ GetVideoTrackFormat()

bool FMediaPlayerFacade::GetVideoTrackFormat ( int32  TrackIndex,
int32  FormatIndex,
FMediaVideoTrackFormat &  OutFormat 
) const
protected

Get details about the specified audio track format.

参数
TrackIndexThe index of the audio track.
FormatIndexThe index of the track's format.
OutFormatWill contain the format details.
返回
true on success, false otherwise.
参见
GetVideoTrackFormat

◆ GetVideoTrackFrameRate()

float FMediaPlayerFacade::GetVideoTrackFrameRate ( int32  TrackIndex,
int32  FormatIndex 
) const

Get frame rate of the specified video track.

参数
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
返回
Video frame rate.
参见
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRates, GetVideoTrackType

◆ GetVideoTrackFrameRates()

TRange< float > FMediaPlayerFacade::GetVideoTrackFrameRates ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the supported range of frame rates of the specified video track.

参数
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
返回
Frame rate range (in frames per second).
参见
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackType

◆ GetVideoTrackType()

FString FMediaPlayerFacade::GetVideoTrackType ( int32  TrackIndex,
int32  FormatIndex 
) const

Get the type of the specified video track format.

参数
TrackIndexThe index of the track.
FormatIndexIndex of the track format.
返回
Video format type string.
参见
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates

◆ GetViewField()

bool FMediaPlayerFacade::GetViewField ( float &  OutHorizontal,
float &  OutVertical 
) const

Get the field of view.

参数
OutHorizontalWill contain the horizontal field of view.
OutVerticalWill contain the vertical field of view.
返回
true on success, false if feature is not available or if field of view has never been set.
参见
GetViewOrientation, SetViewField

◆ GetViewOrientation()

bool FMediaPlayerFacade::GetViewOrientation ( FQuat &  OutOrientation) const

Get the view's orientation.

参数
OutOrientationWill contain the view orientation.
返回
true on success, false if feature is not available or if orientation has never been set.
参见
GetViewField, SetViewOrientation

◆ HasError()

bool FMediaPlayerFacade::HasError ( ) const

Check whether the player is in an error state.

参见
IsReady

◆ IsBuffering()

bool FMediaPlayerFacade::IsBuffering ( ) const

Whether the player is currently buffering data.

返回
true if buffering, false otherwise.
参见
GetState, IsConnecting, IsLooping

◆ IsClosed()

bool FMediaPlayerFacade::IsClosed ( ) const

Whether media is currently closed.

返回
true if media is closed, false otherwise.

◆ IsConnecting()

bool FMediaPlayerFacade::IsConnecting ( ) const

Whether the player is currently connecting to a media source.

返回
true if connecting, false otherwise.
参见
GetState, IsBuffering, IsLooping

◆ IsLooping()

bool FMediaPlayerFacade::IsLooping ( ) const

Whether playback is looping.

返回
true if looping, false otherwise.
参见
GetState, IsBuffering, IsConnecting, SetLooping

◆ IsPaused()

bool FMediaPlayerFacade::IsPaused ( ) const

Whether playback is currently paused.

返回
true if playback is paused, false otherwise.
参见
CanPause, IsPlaying, IsReady, Pause

◆ IsPlaying()

bool FMediaPlayerFacade::IsPlaying ( ) const

Whether playback is in progress.

返回
true if playback has started, false otherwise.
参见
CanPlay, IsPaused, IsReady, Play

◆ IsPreparing()

bool FMediaPlayerFacade::IsPreparing ( ) const

Whether the media is currently opening or buffering.

返回
true if playback is being prepared, false otherwise.
参见
CanPlay, IsPaused, IsReady, Play

◆ IsReady()

bool FMediaPlayerFacade::IsReady ( ) const

Whether media is ready for playback.

A player is ready for playback if it has a media source opened that finished preparing and is not in an error state.

返回
true if media is ready, false otherwise.
参见
HasError, IsPaused, IsPlaying, Stop

◆ Open()

bool FMediaPlayerFacade::Open ( const FString &  Url,
const IMediaOptions *  Options,
const FMediaPlayerOptions *  PlayerOptions = nullptr 
)

Open a media source from a URL with optional parameters.

参数
UrlThe URL of the media to open (file name or web address).
OptionsOptional media parameters.
PlayerOptionsOptional player parameters.
返回
true if the media is being opened, false otherwise.

◆ ProcessEvent()

void FMediaPlayerFacade::ProcessEvent ( EMediaEvent  Event)
protected

Process the given media event.

参数
EventThe event to process.

◆ QueryCacheState()

void FMediaPlayerFacade::QueryCacheState ( EMediaTrackType  TrackType,
EMediaCacheState  State,
TRangeSet< FTimespan > &  OutTimeRanges 
) const

Query the time ranges of cached media samples for the specified caching state.

参数
StateThe sample state we're interested in.
OutTimeRangesWill contain the set of matching sample time ranges.

◆ ReceiveMediaEvent()

void FMediaPlayerFacade::ReceiveMediaEvent ( EMediaEvent  Event)
overrideprotectedvirtual

Receive the given media event.

参数
EventThe event to receive.
注解
Implementors must be thread-safe as this method may be called from arbitrary worker threads.

实现了 IMediaEventSink.

◆ Seek()

bool FMediaPlayerFacade::Seek ( const FTimespan &  Time)

Seeks to the specified playback time.

参数
TimeThe playback time to set.
返回
true on success, false otherwise.
参见
GetTime, Rewind

◆ SelectTrack()

bool FMediaPlayerFacade::SelectTrack ( EMediaTrackType  TrackType,
int32  TrackIndex 
)

Select the active track of the given type.

The selected track will use its currently active format. Active formats will be remembered on a per track basis. The first available format is active by default. To switch the track format, use SetTrackFormat instead.

参数
TrackTypeThe type of track to select.
TrackIndexThe index of the track to select, or INDEX_NONE to deselect.
返回
true if the track was selected, false otherwise.
参见
GetNumTracks, GetSelectedTrack, SetTrackFormat

◆ SetBlockOnTime()

void FMediaPlayerFacade::SetBlockOnTime ( const FTimespan &  Time)

Set the time on which to block.

If set, this player will block in TickFetch until the video sample for the specified time are actually available.

参数
TimeThe time to block on, or FTimespan::MinValue to disable.
参见
TickFetch

◆ SetCacheWindow()

void FMediaPlayerFacade::SetCacheWindow ( FTimespan  Ahead,
FTimespan  Behind 
)

Set sample caching options.

参数
AheadDuration of samples to cache ahead of the play head.
BehindDuration of samples to cache behind the play head.

◆ SetGuid()

void FMediaPlayerFacade::SetGuid ( FGuid &  Guid)

Set the player's globally unique identifier.

参数
GuidThe GUID to set.
参见
GetGuid

◆ SetLastAudioRenderedSampleTime()

void FMediaPlayerFacade::SetLastAudioRenderedSampleTime ( FTimespan  SampleTime)

Record last audio sample played to track audio sync (for automated tests)

参数
SampleTimeTime of media sample currently being played
返回
true if playback is being prepared, false otherwise.

◆ SetLooping()

bool FMediaPlayerFacade::SetLooping ( bool  Looping)

Enables or disables playback looping.

参数
LoopingWhether playback should be looped.
返回
true on success, false otherwise.
参见
IsLooping

◆ SetNativeVolume()

bool FMediaPlayerFacade::SetNativeVolume ( float  Volume)

Changes the media's native volume.

参数
RateThe volume to set.
返回
true on success, false otherwise.
参见
NativeAudioOut

◆ SetRate()

bool FMediaPlayerFacade::SetRate ( float  Rate)

Changes the media's playback rate.

参数
RateThe playback rate to set.
返回
true on success, false otherwise.
参见
GetRate, SupportsRate

◆ SetTrackFormat()

bool FMediaPlayerFacade::SetTrackFormat ( EMediaTrackType  TrackType,
int32  TrackIndex,
int32  FormatIndex 
)

Set the format on the specified track.

Selecting the format will not switch to the specified track. To switch tracks, use SelectTrack instead. If the track is already selected, the format change will be applied immediately.

参数
TrackTypeThe type of track to update.
TrackIndexThe index of the track to update.
FormatIndexThe index of the format to select (must be valid).
返回
true if the track was selected, false otherwise.
参见
GetNumTrackFormats, GetNumTracks, GetTrackFormat, SelectTrack

◆ SetVideoTrackFrameRate()

bool FMediaPlayerFacade::SetVideoTrackFrameRate ( int32  TrackIndex,
int32  FormatIndex,
float  FrameRate 
)

Set the frame rate of the specified video track.

参数
TrackIndexThe index of the track, or INDEX_NONE for the selected one.
FormatIndexIndex of the track format, or INDEX_NONE for the selected one.
FrameRateThe frame rate to set (must be in range of format's supported frame rates).
返回
true on success, false otherwise.
参见
GetVideoTrackAspectRatio, GetVideoTrackDimensions, GetVideoTrackFrameRate, GetVideoTrackFrameRates, GetVideoTrackType

◆ SetViewField()

bool FMediaPlayerFacade::SetViewField ( float  Horizontal,
float  Vertical,
bool  Absolute 
)

Set the field of view.

参数
HorizontalHorizontal field of view (in Euler degrees).
VerticalVertical field of view (in Euler degrees).
Whetherthe field of view change should be absolute (true) or relative (false).
返回
true on success, false otherwise.
参见
GetViewField, SetViewOrientation

◆ SetViewOrientation()

bool FMediaPlayerFacade::SetViewOrientation ( const FQuat &  Orientation,
bool  Absolute 
)

Set the view's orientation.

参数
OrientationQuaternion representing the orientation.
Whetherthe orientation change should be absolute (true) or relative (false).
返回
true on success, false otherwise.
参见
GetViewOrientation, SetViewField

◆ SupportsRate()

bool FMediaPlayerFacade::SupportsRate ( float  Rate,
bool  Unthinned 
) const

Whether the specified playback rate is supported.

参数
RateThe playback rate to check.
UnthinnedWhether no frames should be dropped at the given rate.
参见
CanScrub, CanSeek

◆ TickFetch()

virtual void FMediaPlayerFacade::TickFetch ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
overridevirtual

Called each tick to handle updates after the Engine ticked.

参数
DeltaTimeTime since this function was last called.
TimecodeThe current media time code.
参见
TickInput, TickOutput, TickRender

重载 IMediaClockSink .

◆ TickInput()

virtual void FMediaPlayerFacade::TickInput ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
overridevirtual

Called each tick to handle input before the Engine is ticked.

参数
DeltaTimeTime since this function was last called.
TimecodeThe current media time code.
参见
TickFetch, TickOutput, TickRender

重载 IMediaClockSink .

◆ TickOutput()

virtual void FMediaPlayerFacade::TickOutput ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
overridevirtual

Called each tick to output the rendered frame.

参数
DeltaTimeTime since this function was last called.
TimecodeThe current media time code.
参见
TickFetch, TickInput, TickRender

重载 IMediaClockSink .


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