2017-06-28 21:21:42 +00:00
|
|
|
/*
|
|
|
|
* Modern effects for a modern Streamer
|
|
|
|
* Copyright (C) 2017 Michael Fabian Dirks
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2019-01-14 10:23:21 +00:00
|
|
|
#include "plugin.hpp"
|
2019-09-04 00:59:04 +00:00
|
|
|
#include <stdexcept>
|
2019-09-04 00:47:27 +00:00
|
|
|
#include "filters/filter-blur.hpp"
|
|
|
|
#include "filters/filter-color-grade.hpp"
|
|
|
|
#include "filters/filter-displacement.hpp"
|
|
|
|
#include "filters/filter-dynamic-mask.hpp"
|
|
|
|
#include "filters/filter-sdf-effects.hpp"
|
|
|
|
#include "filters/filter-shader.hpp"
|
|
|
|
#include "filters/filter-transform.hpp"
|
2019-09-04 01:03:41 +00:00
|
|
|
#include "obs/obs-source-tracker.hpp"
|
2019-09-04 00:47:27 +00:00
|
|
|
#include "sources/source-mirror.hpp"
|
|
|
|
#include "sources/source-shader.hpp"
|
2017-06-28 21:21:42 +00:00
|
|
|
|
2019-09-05 16:42:28 +00:00
|
|
|
MODULE_EXPORT bool obs_module_load(void) try {
|
2018-11-08 10:16:33 +00:00
|
|
|
P_LOG_INFO("Loading Version %u.%u.%u (Build %u)", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR,
|
2018-11-07 14:24:25 +00:00
|
|
|
PROJECT_VERSION_PATCH, PROJECT_VERSION_TWEAK);
|
2019-09-05 16:42:28 +00:00
|
|
|
|
|
|
|
// Initialize Source Tracker
|
2019-01-27 21:43:49 +00:00
|
|
|
obs::source_tracker::initialize();
|
2019-09-05 16:42:28 +00:00
|
|
|
|
|
|
|
// Initialize Filters
|
|
|
|
filter::blur::blur_factory::initialize();
|
|
|
|
filter::color_grade::color_grade_factory::initialize();
|
|
|
|
filter::displacement::displacement_factory::initialize();
|
|
|
|
filter::dynamic_mask::dynamic_mask_factory::initialize();
|
|
|
|
filter::sdf_effects::sdf_effects_factory::initialize();
|
|
|
|
filter::shader::shader_factory::initialize();
|
|
|
|
filter::transform::transform_factory::initialize();
|
|
|
|
|
|
|
|
// Initialize Sources
|
|
|
|
source::mirror::mirror_factory::initialize();
|
|
|
|
source::shader::shader_factory::initialize();
|
|
|
|
|
2017-06-28 21:21:42 +00:00
|
|
|
return true;
|
2019-09-05 16:42:28 +00:00
|
|
|
} catch (...) {
|
|
|
|
P_LOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
|
|
|
|
return false;
|
2017-06-28 21:21:42 +00:00
|
|
|
}
|
|
|
|
|
2019-09-05 16:42:28 +00:00
|
|
|
MODULE_EXPORT void obs_module_unload(void) try {
|
2018-11-08 10:16:33 +00:00
|
|
|
P_LOG_INFO("Unloading Version %u.%u.%u (Build %u)", PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR,
|
2018-11-07 14:24:25 +00:00
|
|
|
PROJECT_VERSION_PATCH, PROJECT_VERSION_TWEAK);
|
2019-09-05 16:42:28 +00:00
|
|
|
|
|
|
|
// Clean up Sources
|
|
|
|
source::mirror::mirror_factory::finalize();
|
|
|
|
source::shader::shader_factory::finalize();
|
|
|
|
|
|
|
|
// Clean up Filters
|
|
|
|
filter::blur::blur_factory::finalize();
|
|
|
|
filter::color_grade::color_grade_factory::finalize();
|
|
|
|
filter::displacement::displacement_factory::finalize();
|
|
|
|
filter::dynamic_mask::dynamic_mask_factory::finalize();
|
|
|
|
filter::sdf_effects::sdf_effects_factory::finalize();
|
|
|
|
filter::shader::shader_factory::finalize();
|
|
|
|
filter::transform::transform_factory::finalize();
|
|
|
|
|
|
|
|
// Clean up Source Tracker
|
2019-01-27 21:43:49 +00:00
|
|
|
obs::source_tracker::finalize();
|
2019-09-05 16:42:28 +00:00
|
|
|
} catch (...) {
|
|
|
|
P_LOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__);
|
2017-06-28 21:21:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
2019-01-14 10:23:21 +00:00
|
|
|
// Windows Only
|
|
|
|
extern "C" {
|
2017-06-28 21:21:42 +00:00
|
|
|
#include <windows.h>
|
2019-01-14 10:23:21 +00:00
|
|
|
}
|
2017-06-28 21:21:42 +00:00
|
|
|
|
2018-11-07 14:24:25 +00:00
|
|
|
BOOL WINAPI DllMain(HINSTANCE, DWORD, LPVOID)
|
|
|
|
{
|
2017-06-28 21:21:42 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
#endif
|