-
Notifications
You must be signed in to change notification settings - Fork 30
/
BackgroundTask.cpp
31 lines (28 loc) · 1.24 KB
/
BackgroundTask.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <BaseUtils/Logger.h>
#include "BackgroundTask.h"
namespace json = imgui_json;
using namespace Logger;
using namespace std;
namespace MEC
{
BackgroundTask::Holder CreateBgtask_Vidstab(const json::value& jnTask, MediaCore::SharedSettings::Holder hSettings, RenderUtils::TextureManager::Holder hTxMgr);
BackgroundTask::Holder CreateBgtask_SceneDetect(const json::value& jnTask, MediaCore::SharedSettings::Holder hSettings, RenderUtils::TextureManager::Holder hTxMgr);
BackgroundTask::Holder BackgroundTask::CreateBackgroundTask(const json::value& jnTask, MediaCore::SharedSettings::Holder hSettings, RenderUtils::TextureManager::Holder hTxMgr)
{
if (!jnTask.contains("type"))
{
Log(Error) << "FAILED to create 'BackgroundTask'! Json does not have 'type' attribute." << endl;
return nullptr;
}
const string strTaskType = jnTask["type"].get<json::string>();
if (strTaskType == "Vidstab")
return CreateBgtask_Vidstab(jnTask, hSettings, hTxMgr);
else if (strTaskType == "SceneDetect")
return CreateBgtask_SceneDetect(jnTask, hSettings, hTxMgr);
else
{
Log(Error) << "FAILED to create 'BackgroundTask'! Unsupported task type '" << strTaskType << "'." << endl;
return nullptr;
}
}
}