class

MediaSourceAsset

MediaSourceAsset (.mmedia) — a clip plus how it should play, the way UE's MediaSource + MediaPlayer settings pair.

Module
AssetSystem
Header
#include "AssetSystem/Assets/MediaSourceAsset.h"
Namespace
Mowo

FMediaPlayer::Open already takes a path, so why an asset: a bare path is not a reference. It cannot be renamed with a redirector, it does not appear in the dependency graph, and the cook has no way to know a movie is used — so a packaged build ships with the cutscene missing and nothing says so until a player reaches it. Naming the clip through an asset puts it on the same footing as a texture or a mesh.

The playback settings live here rather than at each call site because they belong to the CLIP: a looping ambient screen and a one-shot cutscene want different answers, and the answer should travel with the content instead of being re-decided by whoever opens it.

Constructors

SignatureNameDescription
MediaSourceAsset()MediaSourceAsset
~MediaSourceAsset() override~MediaSourceAsset

Public functions

ReturnsNameDescription
boolLoad
voidUnload
boolCreateGPU
voidDestroyGPU
boolDestroyGPUIsFrameSafe
boolSaveToFile
std::stringSerializeToString
boolLoadFromString
const std::string&GetClipPathVFS path of the clip itself ("Content/Movies/intro.mpg").
voidSetClipPath
boolIsLooping
voidSetLooping
boolIsAutoPlay
voidSetAutoPlay
floatGetVolume
voidSetVolume
boolOpenOnOpen the clip on player with this asset's settings and, when autoPlay is set, start it.

Function details

MediaSourceAsset

C++
MediaSourceAsset()

~MediaSourceAsset

C++
~MediaSourceAsset() override

Load

C++
bool Load(const std::string& path) override

Unload

C++
void Unload() override

CreateGPU

C++
bool CreateGPU(const GPUContext& ctx) override

DestroyGPU

C++
void DestroyGPU() override

DestroyGPUIsFrameSafe

C++
bool DestroyGPUIsFrameSafe() const override

SaveToFile

C++
bool SaveToFile(const std::string& path) const

SerializeToString

C++
std::string SerializeToString() const

LoadFromString

C++
bool LoadFromString(const std::string& text)

GetClipPath

C++
const std::string& GetClipPath() const

VFS path of the clip itself ("Content/Movies/intro.mpg"). This is the edge the cook follows, so it is also what a dependency walk reports.

SetClipPath

C++
void SetClipPath(std::string path)

IsLooping

C++
bool IsLooping() const

SetLooping

C++
void SetLooping(bool loop)

IsAutoPlay

C++
bool IsAutoPlay() const

SetAutoPlay

C++
void SetAutoPlay(bool autoPlay)

GetVolume

C++
float GetVolume() const

SetVolume

C++
void SetVolume(float volume)

OpenOn

C++
bool OpenOn(FMediaPlayer& player) const

Open the clip on player with this asset's settings and, when autoPlay is set, start it. One call so no caller has to remember the order (volume only sticks once a stream exists, i.e. after Open). Returns false when the clip fails to open.

Generated from AssetSystem/Assets/MediaSourceAsset.h via assetsystem.json · Nov 4, 2026Version 1.0.0