Navigation
API > API/Runtime > API/Runtime/MediaAssets
Implements a texture asset for rendering video tracks from UMediaPlayer assets.
note: derives directly from UTexture, not from UTexture2D or UTexture2DDynamic maybe should have been UTexture2DDynamic?
| Name | UMediaTexture |
| Type | class |
| Header File | /Engine/Source/Runtime/MediaAssets/Public/MediaTexture.h |
| Include Path | #include "MediaTexture.h" |
Syntax
UCLASS (HideCategories=(Adjustments, Compositing, LevelOfDetail, ImportSettings, Object),
MinimalAPI)
class UMediaTexture : public UTexture
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UStreamableRenderAsset → UTexture → UMediaTexture
Implements Interfaces
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UMediaTexture
(
const FObjectInitializer& ObjectInitializer |
MediaTexture.h |
Enums
Public
| Name | Remarks |
|---|---|
| ERenderMode | Possible render modes of this media texture. |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| AddressX | TEnumAsByte< TextureAddress > | The addressing mode to use for the X axis. | MediaTexture.h |
|
| AddressY | TEnumAsByte< TextureAddress > | The addressing mode to use for the Y axis. | MediaTexture.h |
|
| AutoClear | bool | Whether to clear the texture when no media is being played (default = enabled). | MediaTexture.h |
|
| ClearColor | FLinearColor | The color used to clear the texture if AutoClear is enabled (default = black). | MediaTexture.h |
|
| CurrentAspectRatio | float | Current aspect ratio | MediaTexture.h |
|
| CurrentOrientation | TEnumAsByte< enum MediaTextureOrientation > | Current media orientation | MediaTexture.h |
|
| EnableGenMips | bool | Basic enablement for mip generation (default = false). | MediaTexture.h |
|
| NewStyleOutput | bool | Allows the media texture to be used as a regular 2D texture in materials, with Color or Linear Color sampler types as opposed to External. | MediaTexture.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bIsCleared | bool | True if the texture has been cleared. | MediaTexture.h | |
| CachedNextSampleTime | TAtomic< FTimespan > | Next available sample time when last render call was made | MediaTexture.h | |
| ClockSink | TSharedPtr< FMediaTextureClockSink, ESPMode::ThreadSafe > | The texture's media clock sink. | MediaTexture.h | |
| ColorspaceOverride | UE::Color::EColorSpace | Colorspace override | MediaTexture.h | |
| CriticalSection | FCriticalSection | Critical section to protect last rendered guid since it can be read from anywhere. | MediaTexture.h | |
| CurrentGuid | FGuid | The default external texture GUID if no media player is assigned. | MediaTexture.h | |
| CurrentPlayer | TWeakObjectPtr< UMediaPlayer > | The player that is currently associated with this texture. | MediaTexture.h | |
| CurrentRenderedGuid | FGuid | The last Guid that was rendered and registered in the render command | MediaTexture.h | |
| DefaultGuid | const FGuid | The default external texture GUID if no media player is assigned. | MediaTexture.h | |
| Dimensions | FIntPoint | Current width and height of the resource (in pixels). | MediaTexture.h | |
| LastClearColor | FLinearColor | The previously clear color. | MediaTexture.h | |
| LastSrgb | bool | The previously used sRGB flag. | MediaTexture.h | |
| MipMapBias | float | Mip-map bias used by the media texture resource sampler. | MediaTexture.h | |
| RenderMode | ERenderMode | Current render mode of this media texture. Can be changed using SetRenderMode() | MediaTexture.h | |
| SampleQueue | TSharedPtr< FMediaTextureSampleQueue, ESPMode::ThreadSafe > | Texture sample queue. | MediaTexture.h | |
| Size | SIZE_T | Current size of the resource (in bytes). | MediaTexture.h | |
| TextureNumMips | int32 | Number of mips in the actual output texture | MediaTexture.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void CacheNextAvailableSampleTime
(
FTimespan InNextSampleTime |
Caches the next available sample time from the queue when last rendering was made | MediaTexture.h | |
float GetAspectRatio () |
Gets the current aspect ratio of the texture. | MediaTexture.h |
|
int32 GetAvailableSampleCount() |
Gets the number of samples that are available | MediaTexture.h | |
float GetCurrentAspectRatio() |
Get current aspect ratio of presented frame. | MediaTexture.h | |
MediaTextureOrientation GetCurrentOrientation() |
Get current orientation of presented frame. | MediaTexture.h | |
int32 GetHeight () |
Gets the current height of the texture. | MediaTexture.h |
|
| Get the media player that provides the video samples. | MediaTexture.h |
|
|
float GetMipMapBias() |
Get the texture's mip-map bias, clamped to a legal range. | MediaTexture.h | |
| Gets the next sample Time. | MediaTexture.h | ||
ERenderMode GetRenderMode() |
Returns the ERenderMode of this media texture | MediaTexture.h | |
int32 GetTextureNumMips() |
Gets the current numbe of mips of the texture. | MediaTexture.h |
|
int32 GetWidth () |
Gets the current width of the texture. | MediaTexture.h |
|
virtual void JustInTimeRender () |
Renders this media texture. | MediaTexture.h | |
void SetColorSpaceOverride
(
UE::Color::EColorSpace InColorspaceOverride |
Set an override for color space conversions | MediaTexture.h | |
void SetDefaultMediaPlayer
(
UMediaPlayer* NewMediaPlayer |
Set the texture's default media player property. | MediaTexture.h | |
void SetMediaPlayer
(
UMediaPlayer* NewMediaPlayer |
Set the media player that provides the video samples. | MediaTexture.h |
|
void SetMediaPlayer
(
UMediaPlayer* NewMediaPlayer, |
Set the media player that provides the video samples and optionally the sample queue that receives them. | MediaTexture.h | |
void SetMipMapBias
(
float InMipMapBias |
Set texture's mip-map bias, for use by the texture resource sampler. | MediaTexture.h | |
void SetRenderedExternalTextureGuid
(
const FGuid& InNewGuid |
MediaTexture.h | ||
void SetRenderMode
(
ERenderMode InRenderMode |
Sets the ERenderMode of this media texture | MediaTexture.h |
Overridden from UTexture
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual uint32 CalcTextureMemorySizeEnum
(
ETextureMipCount Enum |
MediaTexture.h | ||
virtual FTextureResource * CreateResource() |
MediaTexture.h | ||
virtual FGuid GetExternalTextureGuid() |
MediaTexture.h | ||
virtual EMaterialValueType GetMaterialType() |
MediaTexture.h | ||
virtual uint32 GetSurfaceArraySize() |
MediaTexture.h | ||
virtual float GetSurfaceDepth() |
MediaTexture.h | ||
virtual float GetSurfaceHeight() |
MediaTexture.h | ||
virtual float GetSurfaceWidth() |
MediaTexture.h | ||
virtual ETextureClass GetTextureClass() |
MediaTexture.h | ||
virtual void UpdateResource () |
Creates a new resource for the texture, and updates any cached references to the resource. | MediaTexture.h |
|
Overridden from UObject
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual void BeginDestroy() |
MediaTexture.h | ||
virtual FString GetDesc() |
MediaTexture.h | ||
virtual void GetResourceSizeEx
(
FResourceSizeEx& CumulativeResourceSize |
MediaTexture.h | ||
virtual bool IsPostLoadThreadSafe() |
MediaTexture.h | ||
virtual void PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
MediaTexture.h | ||
virtual void PostInitProperties() |
MediaTexture.h | ||
virtual void PostLoad() |
MediaTexture.h |
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void TickResource
(
FTimespan Timecode |
Tick the texture resource. | MediaTexture.h | |
void UpdatePlayerAndQueue
(
TSharedPtr< FMediaTextureSampleQueue > InSampleQueue |
Update the video sample queue, if necessary. | MediaTexture.h | |
void UpdateSampleInfo
(
const TSharedPtr< IMediaTextureSample, ESPMode::ThreadSafe >& Sample |
Update sample info | MediaTexture.h |
Deprecated Variables
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| NumMips_DEPRECATED | uint8 | MediaTexture.h |
|