Navigation
API > API/Runtime > API/Runtime/Media
Interface for media texture samples.
Media texture samples are generated by media players and sent to the registered media texture sink. They contain a single frame of texture data along with extra metadata, such as dimensions, time codes, and durations.
Depending on the decoder, a frame's pixel data may be stored in a CPU memory buffer, or in an RHI texture resource (only available when compiling against the Engine). The media texture sample API supports both models via the GetBuffer and the GetTexture methods. Sample instances need to implement only one of these.
| Name | IMediaTextureSample |
| Type | class |
| Header File | /Engine/Source/Runtime/Media/Public/IMediaTextureSample.h |
| Include Path | #include "IMediaTextureSample.h" |
Syntax
class IMediaTextureSample
Derived Classes
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual ~IMediaTextureSample() |
Virtual destructor. | IMediaTextureSample.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
virtual double GetAspectRatio() |
Get pixel aspect ratio | IMediaTextureSample.h | |
const void * GetBuffer () |
Get the sample's frame buffer. | IMediaTextureSample.h | |
virtual UE::Color::EChromaticAdaptationMethod GetChromaticAdapationMethod() |
Chromatic adaptation method to be used when applying a color space transform (i.e. from source to working color space). | IMediaTextureSample.h | |
FIntPoint GetDim () |
Get the width and height of the sample. | IMediaTextureSample.h | |
virtual TOptional< UE::Color::FColorSpace > GetDisplayMasteringColorSpace() |
Get display mastering color space | IMediaTextureSample.h | |
virtual bool GetDisplayMasteringLuminance
(
float& OutMin, |
Get display mastering luminance information | IMediaTextureSample.h | |
virtual FVector2d GetDisplayPrimaryBlue() |
IMediaTextureSample.h | ||
virtual FVector2d GetDisplayPrimaryGreen() |
IMediaTextureSample.h | ||
virtual FVector2d GetDisplayPrimaryRed() |
IMediaTextureSample.h | ||
| Get the amount of time for which the sample is valid. | IMediaTextureSample.h | ||
virtual UE::Color::EEncoding GetEncodingType() |
Get EOTF / "Gamma" / encoding type of data | IMediaTextureSample.h | |
| Get the texture sample format. | IMediaTextureSample.h | ||
virtual TOptional< FFrameRate > GetFramerate () |
Get the sample framerate if available. | IMediaTextureSample.h | |
virtual bool GetFullRange() |
Get full range color flag | IMediaTextureSample.h | |
virtual FMatrix44d GetGamutToXYZMatrix() |
IMediaTextureSample.h | ||
virtual float GetHDRNitsNormalizationFactor() |
Get factor to normalize data from nits to scene color values | IMediaTextureSample.h | |
virtual bool GetMaxLuminanceLevels
(
uint16& OutCLL, |
Get maximum luminance information | IMediaTextureSample.h | |
virtual uint8 GetNumMips () |
Get the number of mips encoded in the sample | IMediaTextureSample.h | |
virtual FLinearColor GetOffset () |
Get the Offset applied after ScaleRotation for the sample. | IMediaTextureSample.h | |
virtual EMediaOrientation GetOrientation() |
Get image orientation vs. physically returned image data | IMediaTextureSample.h | |
FIntPoint GetOutputDim () |
Get the sample's desired output width and height. | IMediaTextureSample.h | |
virtual FMatrix44f GetSampleToRGBMatrix() |
Get complete 4x4 matrix to apply to the sample's pixels to yield RGB data in the sample's gamut | IMediaTextureSample.h | |
virtual FLinearColor GetScaleRotation () |
Get the ScaleRotation (2x2 matrix) for the sample. | IMediaTextureSample.h | |
virtual const UE::Color::FColorSpace & GetSourceColorSpace() |
Get sample source color space (defaults to the sRGB/Rec709 gamut) | IMediaTextureSample.h | |
uint32 GetStride () |
Get the horizontal stride (aka. pitch) of the sample's frame buffer. | IMediaTextureSample.h | |
| Get tile information (number, size and border size) of the sample. | IMediaTextureSample.h | ||
| Get the sample time (in the player's local clock). | IMediaTextureSample.h | ||
virtual TOptional< FTimecode > GetTimecode () |
Get the sample timecode if available. | IMediaTextureSample.h | |
virtual MediaShaders::EToneMapMethod GetToneMapMethod() |
Get an optional tonemapping method, for application on HDR inputs. | IMediaTextureSample.h | |
virtual FVector2d GetWhitePoint() |
IMediaTextureSample.h | ||
virtual const FMatrix & GetYUVToRGBMatrix () |
Get the YUV to RGB conversion matrix. | IMediaTextureSample.h | |
bool IsCacheable () |
Whether the sample can be held in a cache. | IMediaTextureSample.h | |
virtual bool IsExternalImage() |
Indicate if this sample references an "external image" | IMediaTextureSample.h | |
bool IsOutputSrgb() |
Whether the output of the sample is in sRGB color space. | IMediaTextureSample.h | |
virtual void Reset() |
Reset sample to empty state | IMediaTextureSample.h | |
virtual bool ShouldApplyColorConversion () |
Whether samples should be converted based on a mismatch with the working color space. | IMediaTextureSample.h |