Files
william belcher ea066a25d4 QOL: Deprecate AVEncoder (for removal) and its dependencies (to be moved to plugins)
#rb luke.bermingham
#jira UE-174651
[FYI]

[CL 32499131 by william belcher in 5.4 branch]
2024-03-26 02:13:50 -04:00

70 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "WindowsPlatformFeatures.h"
#include "WmfPrivate.h"
#include "WindowsVideoRecordingSystem.h"
#include "SaveGameSystem.h"
#include "Misc/CommandLine.h"
#include "Misc/ConfigCacheIni.h"
IMPLEMENT_MODULE(FWindowsPlatformFeaturesModule, WindowsPlatformFeatures);
FWindowsPlatformFeaturesModule::FWindowsPlatformFeaturesModule()
{
}
IVideoRecordingSystem* FWindowsPlatformFeaturesModule::GetVideoRecordingSystem()
{
if (!VideoRecordingSystem)
{
VideoRecordingSystem = MakeShared<FWindowsVideoRecordingSystem>();
}
return VideoRecordingSystem.Get();
}
void FWindowsPlatformFeaturesModule::RegisterVideoRecordingSystem(TSharedPtr<IVideoRecordingSystem> InVideoRecordingSystem)
{
VideoRecordingSystem = InVideoRecordingSystem;
}
ISaveGameSystem* FWindowsPlatformFeaturesModule::GetSaveGameSystem()
{
static ISaveGameSystem* SaveGameSystem = nullptr;
static bool bIniChecked = false;
if (!SaveGameSystem || !bIniChecked)
{
ISaveGameSystemModule* SaveGameSystemModule = nullptr;
if (!GEngineIni.IsEmpty())
{
FString SaveGameModule;
GConfig->GetString(TEXT("PlatformFeatures"), TEXT("SaveGameSystemModule"), SaveGameModule, GEngineIni);
if (!SaveGameModule.IsEmpty())
{
SaveGameSystemModule = FModuleManager::LoadModulePtr<ISaveGameSystemModule>(*SaveGameModule);
if (SaveGameSystemModule != nullptr)
{
// Attempt to grab the save game system
SaveGameSystem = SaveGameSystemModule->GetSaveGameSystem();
}
}
bIniChecked = true;
}
if (SaveGameSystem == nullptr)
{
// Placeholder/default instance
SaveGameSystem = IPlatformFeaturesModule::GetSaveGameSystem();
}
}
return SaveGameSystem;
}
void FWindowsPlatformFeaturesModule::StartupModule()
{
FModuleManager::Get().LoadModule(TEXT("GameplayMediaEncoder"));
}