Add more backends

This commit is contained in:
Wojtek Figat
2024-05-13 15:03:44 +02:00
parent 6b31d51e31
commit df086f3b3b
2 changed files with 30 additions and 0 deletions

View File

@@ -34,6 +34,18 @@ public class Video : EngineModule
options.OutputFiles.Add("mfreadwrite.lib");
options.OutputFiles.Add("mfuuid.lib");
break;
case TargetPlatform.PS4:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS4", "Engine", "Video"));
options.CompileEnv.PreprocessorDefinitions.Add("VIDEO_API_PS4");
break;
case TargetPlatform.PS5:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "PS5", "Engine", "Video"));
options.CompileEnv.PreprocessorDefinitions.Add("VIDEO_API_PS5");
break;
case TargetPlatform.Switch:
options.SourcePaths.Add(Path.Combine(Globals.EngineRoot, "Source", "Platforms", "Switch", "Engine", "Video"));
options.CompileEnv.PreprocessorDefinitions.Add("VIDEO_API_SWITCH");
break;
}
}

View File

@@ -22,6 +22,15 @@
#if VIDEO_API_MF
#include "MF/VideoBackendMF.h"
#endif
#if VIDEO_API_PS4
#include "Platforms/PS4/Engine/Video/VideoBackendPS4.h"
#endif
#if VIDEO_API_PS5
#include "Platforms/PS5/Engine/Video/VideoBackendPS5.h"
#endif
#if VIDEO_API_SWITCH
#include "Platforms/Switch/Engine/Video/VideoBackendSwitch.h"
#endif
/// <summary>
/// Video frame upload task to the GPU.
@@ -200,6 +209,15 @@ bool Video::CreatePlayerBackend(const VideoBackendPlayerInfo& info, VideoBackend
#if VIDEO_API_MF
TRY_USE_BACKEND(VideoBackendMF);
#endif
#if VIDEO_API_PS4
TRY_USE_BACKEND(VideoBackendPS4);
#endif
#if VIDEO_API_PS5
TRY_USE_BACKEND(VideoBackendPS5);
#endif
#if VIDEO_API_SWITCH
TRY_USE_BACKEND(VideoBackendSwitch);
#endif
#undef TRY_USE_BACKEND
LOG(Error, "Failed to setup Video playback backend for '{}'", info.Url);