![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <IMediaTextureSample.h>
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.
|
inlinevirtual |
Virtual destructor.
Get pixel aspect ratio
Get the sample's frame buffer.
The returned buffer is only valid for the life time of this sample.
|
inlinevirtual |
Chromatic adaptation method to be used when applying a color space transform (i.e. from source to working color space).
Get the width and height of the sample.
The sample may be larger than the output dimensions, because of horizontal or vertical padding required by some formats.
|
inlinevirtual |
Get display mastering color space
|
inlinevirtual |
Get display mastering luminance information
|
inlinevirtual |
Get EOTF / "Gamma" / encoding type of data
|
pure virtual |
Get the texture sample format.
|
inlinevirtual |
Get the sample framerate if available. This is the rate in which the timecode is measured. It is not necessarily the display frame rate.
|
inlinevirtual |
Get factor to normalize data from nits to scene color values
|
inlinevirtual |
Get maximum luminance information
Get the number of mips encoded in the sample
|
inlinevirtual |
Get the Offset applied after ScaleRotation for the sample.
|
inlinevirtual |
Get image orientation vs. physically returned image data
Get the sample's desired output width and height.
The output dimensions may be smaller than the frame buffer dimensions, because of horizontal and/or vertical padding that may be required for some formats.
|
inlinevirtual |
Get complete 4x4 matrix to apply to the sample's pixels to yield RGB data in the sample's gamut
|
inlinevirtual |
Get the ScaleRotation (2x2 matrix) for the sample.
|
inlinevirtual |
Get the horizontal stride (aka. pitch) of the sample's frame buffer.
|
inlinevirtual |
Get tile information (number, size and border size) of the sample.
|
pure virtual |
Get the sample time (in the player's local clock).
This value is used primarily for debugging purposes.
|
inlinevirtual |
Get an optional tonemapping method, for application on HDR inputs.
Get the YUV to RGB conversion matrix.
Default is equivalent to MediaShaders::YuvToRgbRec709Scaled Matrix. NOTE: previously in UE4 this was YuvToRgbRec601Scaled
Whether the sample can be held in a cache.
Non-cacheable video samples become invalid when the next sample is available, and only the latest sample should be kept by video sample consumers.
Indicate if this sample references an "external image"
Whether the output of the sample is in sRGB color space.
Whether samples should be converted based on a mismatch with the working color space. If this is false, samples will not go through the conversion process even if their encoding or chromaticity doesn't match the working color space.