UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
IMediaTracks Class Referenceabstract

#include <IMediaTracks.h>

Public Member Functions

virtual bool GetAudioTrackFormat (int32 TrackIndex, int32 FormatIndex, FMediaAudioTrackFormat &OutFormat) const =0
 
virtual int32 GetNumTracks (EMediaTrackType TrackType) const =0
 
virtual int32 GetNumTrackFormats (EMediaTrackType TrackType, int32 TrackIndex) const =0
 
virtual int32 GetSelectedTrack (EMediaTrackType TrackType) const =0
 
virtual FText GetTrackDisplayName (EMediaTrackType TrackType, int32 TrackIndex) const =0
 
virtual int32 GetTrackFormat (EMediaTrackType TrackType, int32 TrackIndex) const =0
 
virtual FString GetTrackLanguage (EMediaTrackType TrackType, int32 TrackIndex) const =0
 
virtual FString GetTrackName (EMediaTrackType TrackType, int32 TrackIndex) const =0
 
virtual bool GetVideoTrackFormat (int32 TrackIndex, int32 FormatIndex, FMediaVideoTrackFormat &OutFormat) const =0
 
virtual bool SelectTrack (EMediaTrackType TrackType, int32 TrackIndex)=0
 
virtual bool SetTrackFormat (EMediaTrackType TrackType, int32 TrackIndex, int32 FormatIndex)=0
 
virtual bool SetVideoTrackFrameRate (int32 TrackIndex, int32 FormatIndex, float FrameRate)
 
virtual ~IMediaTracks ()
 

Detailed Description

Interface for access to a media player's tracks.

See also
IMediaCache, IMediaControls, IMediaPlayer, IMediaSamples, IMediaView

Constructor & Destructor Documentation

◆ ~IMediaTracks()

virtual IMediaTracks::~IMediaTracks ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ GetAudioTrackFormat()

virtual bool IMediaTracks::GetAudioTrackFormat ( int32  TrackIndex,
int32  FormatIndex,
FMediaAudioTrackFormat OutFormat 
) const
pure virtual

Get details about the specified audio track format.

Parameters
TrackIndexThe index of the audio track (must be valid).
FormatIndexThe index of the track's format (must be valid).
OutFormatWill contain the format details.
Returns
true on success, false otherwise.
See also
GetVideoTrackFormat

◆ GetNumTrackFormats()

virtual int32 IMediaTracks::GetNumTrackFormats ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const
pure virtual

Get the number of formats of the specified track.

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track (must be valid).
Returns
Number of formats.
See also
GetNumTracks, GetTrackFormatType, GetTrackDisplayName

◆ GetNumTracks()

virtual int32 IMediaTracks::GetNumTracks ( EMediaTrackType  TrackType) const
pure virtual

Get the number of media tracks of the given type.

Parameters
TrackTypeThe type of media tracks.
Returns
Number of tracks.
See also
GetNumTrackFormats, GetSelectedTrack, SelectTrack

◆ GetSelectedTrack()

virtual int32 IMediaTracks::GetSelectedTrack ( EMediaTrackType  TrackType) const
pure virtual

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

Parameters
TrackTypeThe type of track to get.
Returns
The index of the selected track, or INDEX_NONE if no track is active.
See also
GetNumTracks, SelectTrack

◆ GetTrackDisplayName()

virtual FText IMediaTracks::GetTrackDisplayName ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const
pure virtual

Get the human readable name of the specified track.

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track (must be valid).
Returns
Display name.
See also
GetTrackLanguage, GetTrackName

◆ GetTrackFormat()

virtual int32 IMediaTracks::GetTrackFormat ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const
pure virtual

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

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track (must be valid).
Returns
The index of the selected format.
See also
GetNumTrackFormats, GetSelectedTrack, SetTrackFormat

◆ GetTrackLanguage()

virtual FString IMediaTracks::GetTrackLanguage ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const
pure virtual

Get the language tag of the specified track.

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track (must be valid).
Returns
Language tag, i.e. "en-US" for English, or "und" for undefined.
See also
GetTrackDisplayName, GetTrackName

◆ GetTrackName()

virtual FString IMediaTracks::GetTrackName ( EMediaTrackType  TrackType,
int32  TrackIndex 
) const
pure virtual

Get the internal name of the specified track.

Parameters
TrackTypeThe type of track.
TrackIndexThe index of the track (must be valid).
Returns
Track name.
See also
GetTrackDisplayName, GetTrackLanguage

◆ GetVideoTrackFormat()

virtual bool IMediaTracks::GetVideoTrackFormat ( int32  TrackIndex,
int32  FormatIndex,
FMediaVideoTrackFormat OutFormat 
) const
pure virtual

Get details about the specified video track format.

Parameters
TrackIndexThe index of the video track (must be valid).
FormatIndexThe index of the track's format (must be valid).
OutFormatWill contain the format details.
Returns
true on success, false otherwise.
See also
GetAudioTrackFormat

◆ SelectTrack()

virtual bool IMediaTracks::SelectTrack ( EMediaTrackType  TrackType,
int32  TrackIndex 
)
pure virtual

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.

Parameters
TrackTypeThe type of track to select.
TrackIndexThe index of the track to select, or INDEX_NONE to deselect.
Returns
true if the track was selected, false otherwise.
See also
GetNumTracks, GetSelectedTrack, SetTrackFormat

◆ SetTrackFormat()

virtual bool IMediaTracks::SetTrackFormat ( EMediaTrackType  TrackType,
int32  TrackIndex,
int32  FormatIndex 
)
pure virtual

Select the active 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.

Parameters
TrackTypeThe type of track to update.
TrackIndexThe index of the track to update (must be valid).
FormatIndexThe index of the format to select (must be valid).
Returns
true if the format was selected, false otherwise.
See also
GetNumTrackFormats, GetNumTracks, GetTrackFormat, SelectTrack

◆ SetVideoTrackFrameRate()

virtual bool IMediaTracks::SetVideoTrackFrameRate ( int32  TrackIndex,
int32  FormatIndex,
float  FrameRate 
)
inlinevirtual

Set the frame rate of the specified video track.

Note that most players may not support overriding the video frame rate. This feature is often only available on video capture media sources.

Parameters
TrackIndexThe index of the track (must be valid).
FormatIndexIndex of the track format (must be valid).
FrameRateThe frame rate to set (must be in range of format's supported frame rates).
Returns
true on success, false otherwise.
See also
GetTrackFormat, SetTrackFormat

The documentation for this class was generated from the following file: