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

Interface for media players. 更多...

#include <IMediaPlayer.h>

Public 类型

enum class  EFeatureFlag { AllowShutdownOnClose = 0 , UsePlaybackTimingV2 , UseRealtimeWithVideoOnly , AlwaysPullNewestVideoFrame }
 

Public 成员函数

virtual void Close ()=0
 Close a previously opened media source. 更多...
 
virtual bool FlushOnSeekCompleted () const
 Flush sinks when seek ends 更多...
 
virtual bool FlushOnSeekStarted () const
 Flush sinks when seek begins 更多...
 
virtual IMediaCache & GetCache ()=0
 Get the player's cache controls. 更多...
 
virtual IMediaControls & GetControls ()=0
 Get the player's playback controls. 更多...
 
virtual FString GetInfo () const =0
 Get debug information about the player and currently opened media. 更多...
 
virtual FText GetMediaName () const
 Get the human readable name of the currently loaded media source. 更多...
 
virtual FGuid GetPlayerPluginGUID () const =0
 Get the GUID for this player plugin. 更多...
 
virtual IMediaSamples & GetSamples ()=0
 Get the player's sample queue. 更多...
 
virtual FString GetStats () const =0
 Get playback statistics information. 更多...
 
virtual IMediaTracks & GetTracks ()=0
 Get the player's track collection. 更多...
 
virtual FString GetUrl () const =0
 Get the URL of the currently loaded media. 更多...
 
virtual IMediaView & GetView ()=0
 Get the player's view settings. 更多...
 
virtual bool Open (const FString &Url, const IMediaOptions *Options)=0
 Open a media source from a URL with optional parameters. 更多...
 
virtual bool Open (const FString &Url, const IMediaOptions *Options, const FMediaPlayerOptions *PlayerOptions)
 Open a media source from a URL with optional asset and player parameters.
 
virtual bool Open (const TSharedRef< FArchive, ESPMode::ThreadSafe > &Archive, const FString &OriginalUrl, const IMediaOptions *Options)=0
 Open a media source from a file or memory archive with optional parameters. 更多...
 
virtual void ProcessVideoSamples ()
 Any extra processing that the player should do when FMediaPlayerFacade::ProcessVideoSamples is run should be put here.
 
virtual void SetGuid (const FGuid &Guid)
 Set the player's globally unique identifier. 更多...
 
virtual void SetLastAudioRenderedSampleTime (FTimespan SampleTime)
 Notify player of last sample time of audio used. 更多...
 
virtual bool SetNativeVolume (float Volume)
 Set the player's native volume if supported. 更多...
 
virtual void TickAudio ()
 Tick the player's audio related code. 更多...
 
virtual void TickFetch (FTimespan DeltaTime, FTimespan Timecode)
 Tick the player in the Fetch phase. 更多...
 
virtual void TickInput (FTimespan DeltaTime, FTimespan Timecode)
 Tick the player in the Input phase. 更多...
 
virtual ~IMediaPlayer ()
 Virtual destructor.
 

详细描述

Interface for media players.

参见
IMediaPlayerFactory

成员枚举类型说明

◆ EFeatureFlag

enum class IMediaPlayer::EFeatureFlag
strong
枚举值
AllowShutdownOnClose 

Allow player to be shutdown right after 'close' event is received from it

UsePlaybackTimingV2 

Use v2 playback timing and AV sync

UseRealtimeWithVideoOnly 

Use realtime rather then game deltatime to control video playback if no audio is present

AlwaysPullNewestVideoFrame 

Mediaframework will not gate video frame output with its own timing, but assumes "ASAP" as output time for every sample

成员函数说明

◆ Close()

virtual void IMediaPlayer::Close ( )
pure virtual

Close a previously opened media source.

Call this method to free up all resources associated with an opened media source. If no media is open, this function has no effect.

The media may not necessarily be closed after this function succeeds, because closing may happen asynchronously. Subscribe to the MediaClosed event to detect when the media finished closing. This events is only triggered if Close returns true.

参见
IsReady, Open

◆ FlushOnSeekCompleted()

virtual bool IMediaPlayer::FlushOnSeekCompleted ( ) const
inlinevirtual

Flush sinks when seek ends

返回
true if sinks should be flushed when a seek finishes

◆ FlushOnSeekStarted()

virtual bool IMediaPlayer::FlushOnSeekStarted ( ) const
inlinevirtual

Flush sinks when seek begins

返回
true if sinks should be flushed when a seek starts

◆ GetCache()

virtual IMediaCache & IMediaPlayer::GetCache ( )
pure virtual

Get the player's cache controls.

The interface returned by this method must remain valid for the player's life time.

返回
Cache controls.
参见
GetControls, GetSamples, GetTracks, GetView

◆ GetControls()

virtual IMediaControls & IMediaPlayer::GetControls ( )
pure virtual

Get the player's playback controls.

The interface returned by this method must remain valid for the player's life time.

返回
Playback controls.
参见
GetCache, GetSamples, GetTracks, GetView

◆ GetInfo()

virtual FString IMediaPlayer::GetInfo ( ) const
pure virtual

Get debug information about the player and currently opened media.

返回
Information string.
参见
GetStats

◆ GetMediaName()

virtual FText IMediaPlayer::GetMediaName ( ) const
inlinevirtual

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

Depending on the type of media source, this might be the name of a file, the display name of a capture device, or some other identifying string. If the player does not provide a specialized implementation for this method, the media name will be derived from the current media URL.

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

◆ GetPlayerPluginGUID()

virtual FGuid IMediaPlayer::GetPlayerPluginGUID ( ) const
pure virtual

Get the GUID for this player plugin.

返回
Media player GUID (usually corresponds to a player name)
参见
GetPlayerName

◆ GetSamples()

virtual IMediaSamples & IMediaPlayer::GetSamples ( )
pure virtual

Get the player's sample queue.

The interface returned by this method must remain valid for the player's life time.

返回
Cache interface.
参见
GetCache, GetControls, GetTracks, GetView

◆ GetStats()

virtual FString IMediaPlayer::GetStats ( ) const
pure virtual

Get playback statistics information.

返回
Information string.
参见
GetInfo

◆ GetTracks()

virtual IMediaTracks & IMediaPlayer::GetTracks ( )
pure virtual

Get the player's track collection.

The interface returned by this method must remain valid for the player's life time.

返回
Tracks interface.
参见
GetCache, GetControls, GetSamples, GetView

◆ GetUrl()

virtual FString IMediaPlayer::GetUrl ( ) const
pure virtual

Get the URL of the currently loaded media.

返回
Media URL.

◆ GetView()

virtual IMediaView & IMediaPlayer::GetView ( )
pure virtual

Get the player's view settings.

The interface returned by this method must remain valid for the player's life time.

返回
View interface.
参见
GetCache, GetControls, GetSamples, GetTracks

◆ Open() [1/2]

virtual bool IMediaPlayer::Open ( const FString &  Url,
const IMediaOptions *  Options 
)
pure virtual

Open a media source from a URL with optional parameters.

The media may not necessarily be opened after this function succeeds, because opening may happen asynchronously. Subscribe to the MediaOpened and MediaOpenFailed events to detect when the media finished or failed to open. These events are only triggered if Open returns true.

The optional parameters can be used to configure aspects of media playback and are specific to the type of media source and the underlying player. Check their documentation for available keys and values.

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

◆ Open() [2/2]

virtual bool IMediaPlayer::Open ( const TSharedRef< FArchive, ESPMode::ThreadSafe > &  Archive,
const FString &  OriginalUrl,
const IMediaOptions *  Options 
)
pure virtual

Open a media source from a file or memory archive with optional parameters.

The media may not necessarily be opened after this function succeeds, because opening may happen asynchronously. Subscribe to the MediaOpened and MediaOpenFailed events to detect when the media finished or failed to open. These events are only triggered if Open returns true.

The optional parameters can be used to configure aspects of media playback and are specific to the type of media source and the underlying player. Check their documentation for available keys and values.

参数
ArchiveThe archive holding the media data.
OriginalUrlThe original URL of the media that was loaded into the buffer.
OptionsOptional media parameters.
返回
true if the media is being opened, false otherwise.
参见
Close, IsReady, OnOpen, OnOpenFailed

◆ SetGuid()

virtual void IMediaPlayer::SetGuid ( const FGuid &  Guid)
inlinevirtual

Set the player's globally unique identifier.

参数
GuidThe GUID to set.

◆ SetLastAudioRenderedSampleTime()

virtual void IMediaPlayer::SetLastAudioRenderedSampleTime ( FTimespan  SampleTime)
inlinevirtual

Notify player of last sample time of audio used.

参数
SampleTimeThe last audio sample dequeued by one of the audio sinks.

◆ SetNativeVolume()

virtual bool IMediaPlayer::SetNativeVolume ( float  Volume)
inlinevirtual

Set the player's native volume if supported.

参数
VolumeThe volume to set.
返回
true on success, false otherwise.

◆ TickAudio()

virtual void IMediaPlayer::TickAudio ( )
inlinevirtual

Tick the player's audio related code.

This is a high-frequency tick function. Media players override this method to fetch and process audio samples, or to perform other time critical tasks.

参见
TickInput, TickFetch

◆ TickFetch()

virtual void IMediaPlayer::TickFetch ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
inlinevirtual

Tick the player in the Fetch phase.

Media players may override this method to fetch newly decoded input samples before they are rendered on textures or audio components.

参数
DeltaTimeTime since last tick.
TimecodeThe current media time code.
参见
TickAudio, TickInput

◆ TickInput()

virtual void IMediaPlayer::TickInput ( FTimespan  DeltaTime,
FTimespan  Timecode 
)
inlinevirtual

Tick the player in the Input phase.

Media players may override this method to update their state before the Engine is being ticked, or to initiate the processing of input samples.

参数
DeltaTimeTime since last tick.
TimecodeThe current media time code.
参见
TickAudio, TickFetch

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