common: Common header include for improved platform support

This header includes all common data between headers used in the plugin. This should improve cross-platform compiling support whenever possible, as all platform-dependent common includes and defines can be done here.
This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2020-04-02 17:02:01 +02:00
parent 451d31546f
commit 59fa1d36d7
60 changed files with 150 additions and 416 deletions

View file

@ -20,10 +20,12 @@ NamespaceIndentation: All
# Includes # Includes
#IncludeBlocks: Regroup #IncludeBlocks: Regroup
IncludeCategories: IncludeCategories:
- Regex: '^(<|")(common.hpp|obs.h)("|>)'
Priority: 0
- Regex: '^<' - Regex: '^<'
Priority: 1 Priority: 10
- Regex: '^"' - Regex: '^"'
Priority: 2 Priority: 20
SortIncludes: true SortIncludes: true
# Alignment # Alignment

View file

@ -106,7 +106,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C++ # using Intel C++
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
set(MSVC_EXTRA_FLAGS "/wd4061 /wd4100 /wd4180 /wd4201 /wd4464 /wd4505 /wd4514 /wd4571 /wd4623 /wd4625 /wd4626 /wd4668 /wd4710 /wd4774 /wd4820 /wd5026 /wd5027 /wd5039 /wd5045") set(MSVC_EXTRA_FLAGS "/wd4061 /wd4100 /wd4180 /wd4201 /wd4464 /wd4505 /wd4514 /wd4571 /wd4623 /wd4625 /wd4626 /wd4668 /wd4710 /wd4774 /wd4820 /wd5026 /wd5027 /wd5039 /wd5045 /wd26812")
# Force to always compile with W4 # Force to always compile with W4
if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
string(REGEX REPLACE "/W[0-4]" "/Wall" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") string(REGEX REPLACE "/W[0-4]" "/Wall" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
@ -342,6 +342,7 @@ if(WIN32)
endif() endif()
list(APPEND PROJECT_PRIVATE_SOURCE list(APPEND PROJECT_PRIVATE_SOURCE
# Plugin # Plugin
"source/common.hpp"
"source/plugin.hpp" "source/plugin.hpp"
"source/plugin.cpp" "source/plugin.cpp"
"source/strings.hpp" "source/strings.hpp"

View file

@ -19,6 +19,7 @@
#pragma once #pragma once
#include <cinttypes> #include <cinttypes>
#include <cstddef>
#define STREAMFX_MAKE_VERSION(major,minor,patch,tweak) ((uint64_t(major) & 0xFFFFull) << 48ull) | ((uint64_t(minor) & 0xFFFFull) << 32ull) | ((uint64_t(patch) & 0xFFFFull) << 16ull) | ((uint64_t(tweak) & 0xFFFFull)) #define STREAMFX_MAKE_VERSION(major,minor,patch,tweak) ((uint64_t(major) & 0xFFFFull) << 48ull) | ((uint64_t(minor) & 0xFFFFull) << 32ull) | ((uint64_t(patch) & 0xFFFFull) << 16ull) | ((uint64_t(tweak) & 0xFFFFull))

90
source/common.hpp Normal file
View file

@ -0,0 +1,90 @@
/*
* Modern effects for a modern Streamer
* Copyright (C) 2020 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
*/
#pragma once
// Common C includes
#include <cfloat>
#include <cinttypes>
#include <climits>
#include <clocale>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <ctime>
// Common C++ includes
#include <algorithm>
#include <limits>
#include <memory>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <utility>
// Common Plugin includes
#include "strings.hpp"
#include "util-profiler.hpp"
#include "util-threadpool.hpp"
#include "utility.hpp"
#include "version.hpp"
// Common OBS includes
extern "C" {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#include <obs-data.h>
#include <obs-encoder.h>
#include <obs-module.h>
#include <obs-properties.h>
#include <obs-source.h>
#include <util/platform.h>
#include <graphics/graphics.h>
#include <graphics/vec3.h>
#include <graphics/matrix4.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
// Common Global defines
/// Logging
#define LOG_(level, ...) blog(level, "[" PLUGIN_NAME "] " __VA_ARGS__)
#define LOG_ERROR(...) LOG_(LOG_ERROR, __VA_ARGS__)
#define LOG_WARNING(...) LOG_(LOG_WARNING, __VA_ARGS__)
#define LOG_INFO(...) LOG_(LOG_INFO, __VA_ARGS__)
#define LOG_DEBUG(...) LOG_(LOG_DEBUG, __VA_ARGS__)
/// Currrent function name (as const char*)
#ifdef _MSC_VER
// Microsoft Visual Studio
#define __FUNCTION_SIG__ __FUNCSIG__
#define __FUNCTION_NAME__ __func__
#elif defined(__GNUC__) || defined(__MINGW32__)
// GCC and MinGW
#define __FUNCTION_SIG__ __PRETTY_FUNCTION__
#define __FUNCTION_NAME__ __func__
#else
// Any other compiler
#define __FUNCTION_SIG__ __func__
#define __FUNCTION_NAME__ __func__
#endif

View file

@ -20,13 +20,12 @@
// SOFTWARE. // SOFTWARE.
#pragma once #pragma once
#include "common.hpp"
#include <condition_variable> #include <condition_variable>
#include <map> #include <map>
#include <memory>
#include <mutex> #include <mutex>
#include <queue> #include <queue>
#include <stack> #include <stack>
#include <string>
#include <thread> #include <thread>
#include <vector> #include <vector>
#include "ffmpeg/avframe-queue.hpp" #include "ffmpeg/avframe-queue.hpp"
@ -42,7 +41,6 @@ extern "C" {
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <libavutil/frame.h> #include <libavutil/frame.h>
#include <obs-properties.h> #include <obs-properties.h>
#include <obs.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif

View file

@ -20,16 +20,10 @@
// SOFTWARE. // SOFTWARE.
#pragma once #pragma once
#include "common.hpp"
#include <string>
#include "ffmpeg/hwapi/base.hpp" #include "ffmpeg/hwapi/base.hpp"
extern "C" { extern "C" {
#include <obs.h>
#include <obs-data.h>
#include <obs-encoder.h>
#include <obs-properties.h>
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4242 4244 4365) #pragma warning(disable : 4242 4244 4365)
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>

View file

@ -23,7 +23,6 @@
#include "handler.hpp" #include "handler.hpp"
extern "C" { extern "C" {
#include <obs-properties.h>
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4244) #pragma warning(disable : 4244)
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>

View file

@ -23,7 +23,6 @@
#include "handler.hpp" #include "handler.hpp"
extern "C" { extern "C" {
#include <obs-properties.h>
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4244) #pragma warning(disable : 4244)
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>

View file

@ -21,7 +21,6 @@
#pragma once #pragma once
#include <map> #include <map>
#include <string>
#include "handler.hpp" #include "handler.hpp"
#include "utility.hpp" #include "utility.hpp"
@ -31,7 +30,6 @@ extern "C" {
#pragma warning(disable : 4242 4244 4365) #pragma warning(disable : 4242 4244 4365)
#endif #endif
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>
#include <obs-properties.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#endif #endif

View file

@ -23,7 +23,6 @@
#include "handler.hpp" #include "handler.hpp"
extern "C" { extern "C" {
#include <obs-properties.h>
#pragma warning(push) #pragma warning(push)
#pragma warning(disable : 4244) #pragma warning(disable : 4244)
#include <libavcodec/avcodec.h> #include <libavcodec/avcodec.h>

View file

@ -20,6 +20,7 @@
// SOFTWARE. // SOFTWARE.
#pragma once #pragma once
#include "common.hpp"
#include <deque> #include <deque>
#include <mutex> #include <mutex>

View file

@ -20,11 +20,8 @@
// SOFTWARE. // SOFTWARE.
#pragma once #pragma once
#include "common.hpp"
#include <cinttypes>
#include <list> #include <list>
#include <memory>
#include <string>
#include <utility> #include <utility>
extern "C" { extern "C" {

View file

@ -19,6 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE. // SOFTWARE.
#pragma once
#include "base.hpp" #include "base.hpp"
extern "C++" { extern "C++" {

View file

@ -20,7 +20,7 @@
// SOFTWARE. // SOFTWARE.
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <utility> #include <utility>
extern "C" { extern "C" {

View file

@ -20,8 +20,8 @@
// SOFTWARE. // SOFTWARE.
#pragma once #pragma once
#include "common.hpp"
#include <functional> #include <functional>
#include <obs.h>
#include <string> #include <string>
#include <vector> #include <vector>

View file

@ -18,11 +18,11 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include <chrono> #include <chrono>
#include <functional> #include <functional>
#include <list> #include <list>
#include <map> #include <map>
#include <memory>
#include "gfx/blur/gfx-blur-base.hpp" #include "gfx/blur/gfx-blur-base.hpp"
#include "gfx/gfx-source-texture.hpp" #include "gfx/gfx-source-texture.hpp"
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"
@ -30,17 +30,6 @@
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/gs/gs-texture.hpp" #include "obs/gs/gs-texture.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace filter::blur { namespace filter::blur {
enum class mask_type : int64_t { enum class mask_type : int64_t {

View file

@ -18,14 +18,13 @@
*/ */
#pragma once #pragma once
#include <memory> #include "plugin.hpp"
#include <vector> #include <vector>
#include "obs/gs/gs-mipmapper.hpp" #include "obs/gs/gs-mipmapper.hpp"
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/gs/gs-texture.hpp" #include "obs/gs/gs-texture.hpp"
#include "obs/gs/gs-vertexbuffer.hpp" #include "obs/gs/gs-vertexbuffer.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp"
namespace filter::color_grade { namespace filter::color_grade {
enum class detection_mode { enum class detection_mode {

View file

@ -18,22 +18,9 @@
*/ */
#pragma once #pragma once
#include <memory> #include "common.hpp"
#include <string>
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs-source.h>
#include <util/platform.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace filter::displacement { namespace filter::displacement {
class displacement_instance : public obs::source_instance { class displacement_instance : public obs::source_instance {

View file

@ -18,27 +18,14 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include <list> #include <list>
#include <map> #include <map>
#include <memory>
#include <string>
#include "gfx/gfx-source-texture.hpp" #include "gfx/gfx-source-texture.hpp"
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "obs/obs-source-tracker.hpp" #include "obs/obs-source-tracker.hpp"
#include "obs/obs-source.hpp" #include "obs/obs-source.hpp"
#include "plugin.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs-source.h>
#include <util/platform.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace filter::dynamic_mask { namespace filter::dynamic_mask {
enum class channel : int8_t { Invalid = -1, Red, Green, Blue, Alpha }; enum class channel : int8_t { Invalid = -1, Red, Green, Blue, Alpha };

View file

@ -18,15 +18,13 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include <atomic> #include <atomic>
#include <memory>
#include <vector> #include <vector>
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/gs/gs-vertexbuffer.hpp" #include "obs/gs/gs-vertexbuffer.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp"
#include "util-profiler.hpp"
// Nvidia // Nvidia
#include "nvidia/ar/nvidia-ar.hpp" #include "nvidia/ar/nvidia-ar.hpp"

View file

@ -18,24 +18,13 @@
*/ */
#pragma once #pragma once
#include <memory> #include "common.hpp"
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/gs/gs-sampler.hpp" #include "obs/gs/gs-sampler.hpp"
#include "obs/gs/gs-texture.hpp" #include "obs/gs/gs-texture.hpp"
#include "obs/gs/gs-vertexbuffer.hpp" #include "obs/gs/gs-vertexbuffer.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace filter::sdf_effects { namespace filter::sdf_effects {
class sdf_effects_instance : public obs::source_instance { class sdf_effects_instance : public obs::source_instance {

View file

@ -18,15 +18,10 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include "gfx/shader/gfx-shader.hpp" #include "gfx/shader/gfx-shader.hpp"
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp"
extern "C" {
#include <obs.h>
}
namespace filter::shader { namespace filter::shader {
class shader_instance : public obs::source_instance { class shader_instance : public obs::source_instance {

View file

@ -18,14 +18,13 @@
*/ */
#pragma once #pragma once
#include <memory> #include "common.hpp"
#include <vector> #include <vector>
#include "obs/gs/gs-mipmapper.hpp" #include "obs/gs/gs-mipmapper.hpp"
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/gs/gs-texture.hpp" #include "obs/gs/gs-texture.hpp"
#include "obs/gs/gs-vertexbuffer.hpp" #include "obs/gs/gs-vertexbuffer.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp"
namespace filter::transform { namespace filter::transform {
class transform_instance : public obs::source_instance { class transform_instance : public obs::source_instance {

View file

@ -16,9 +16,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <cmath>
#include <memory>
#include "obs/gs/gs-texture.hpp" #include "obs/gs/gs-texture.hpp"
namespace gfx { namespace gfx {

View file

@ -16,8 +16,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <memory>
#include <mutex> #include <mutex>
#include "gfx-blur-base.hpp" #include "gfx-blur-base.hpp"
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"

View file

@ -16,8 +16,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <memory>
#include <mutex> #include <mutex>
#include "gfx-blur-base.hpp" #include "gfx-blur-base.hpp"
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"

View file

@ -16,8 +16,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <memory>
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include "gfx-blur-base.hpp" #include "gfx-blur-base.hpp"

View file

@ -16,6 +16,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include "common.hpp"
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include "gfx-blur-base.hpp" #include "gfx-blur-base.hpp"

View file

@ -16,6 +16,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include "common.hpp"
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include "gfx-blur-base.hpp" #include "gfx-blur-base.hpp"

View file

@ -16,23 +16,12 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include "common.hpp"
#include <map> #include <map>
#include <memory>
#include <string>
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/gs/gs-texture.hpp" #include "obs/gs/gs-texture.hpp"
#include "obs/obs-source.hpp" #include "obs/obs-source.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gfx { namespace gfx {
class source_texture { class source_texture {
std::shared_ptr<obs::deprecated_source> _parent; std::shared_ptr<obs::deprecated_source> _parent;

View file

@ -16,7 +16,7 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include <string> #include "common.hpp"
#include <vector> #include <vector>
#include "gfx-shader-param.hpp" #include "gfx-shader-param.hpp"
#include "obs/gs/gs-effect-parameter.hpp" #include "obs/gs/gs-effect-parameter.hpp"

View file

@ -16,22 +16,10 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include <list>
#include <string> #include <string>
#include <list>
#include "obs/gs/gs-effect-parameter.hpp" #include "obs/gs/gs-effect-parameter.hpp"
// OBS
extern "C" {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
namespace gfx { namespace gfx {
namespace shader { namespace shader {
enum class parameter_type { enum class parameter_type {

View file

@ -16,27 +16,14 @@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#pragma once #pragma once
#include "common.hpp"
#include <filesystem> #include <filesystem>
#include <list> #include <list>
#include <map> #include <map>
#include <random> #include <random>
#include <string>
#include "gfx/shader/gfx-shader-param.hpp" #include "gfx/shader/gfx-shader-param.hpp"
#include "obs/gs/gs-effect.hpp" #include "obs/gs/gs-effect.hpp"
// OBS
extern "C" {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#include <util/platform.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
namespace gfx { namespace gfx {
namespace shader { namespace shader {
enum class size_type { enum class size_type {

View file

@ -18,26 +18,10 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <memory>
#include <string>
#include "gs-sampler.hpp" #include "gs-sampler.hpp"
#include "gs-texture.hpp" #include "gs-texture.hpp"
// OBS
extern "C" {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#include <graphics/matrix4.h>
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
namespace gs { namespace gs {
class effect_parameter : public std::shared_ptr<gs_eparam_t> { class effect_parameter : public std::shared_ptr<gs_eparam_t> {
std::shared_ptr<gs_effect_t>* _effect_parent; std::shared_ptr<gs_effect_t>* _effect_parent;

View file

@ -18,23 +18,9 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <memory>
#include <string>
#include "gs-effect-parameter.hpp" #include "gs-effect-parameter.hpp"
// OBS
extern "C" {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
namespace gs { namespace gs {
class effect_pass : public std::shared_ptr<gs_epass_t> { class effect_pass : public std::shared_ptr<gs_epass_t> {
std::shared_ptr<gs_technique_t>* _parent; std::shared_ptr<gs_technique_t>* _parent;

View file

@ -18,23 +18,9 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <memory>
#include <string>
#include "gs-effect-pass.hpp" #include "gs-effect-pass.hpp"
// OBS
extern "C" {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
namespace gs { namespace gs {
class effect_technique : public std::shared_ptr<gs_technique_t> { class effect_technique : public std::shared_ptr<gs_technique_t> {
std::shared_ptr<gs_effect_t>* _parent; std::shared_ptr<gs_effect_t>* _parent;

View file

@ -18,26 +18,12 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <filesystem> #include <filesystem>
#include <list> #include <list>
#include <memory>
#include <string>
#include "gs-effect-parameter.hpp" #include "gs-effect-parameter.hpp"
#include "gs-effect-technique.hpp" #include "gs-effect-technique.hpp"
// OBS
extern "C" {
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
namespace gs { namespace gs {
class effect : public std::shared_ptr<gs_effect_t> { class effect : public std::shared_ptr<gs_effect_t> {
public: public:

View file

@ -18,20 +18,10 @@
*/ */
#pragma once #pragma once
#include <string> #include "common.hpp"
#include <vector> #include <vector>
#include "plugin.hpp" #include "plugin.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
class context { class context {
public: public:

View file

@ -18,19 +18,9 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <vector> #include <vector>
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
class index_buffer : public std::vector<uint32_t> { class index_buffer : public std::vector<uint32_t> {
public: public:

View file

@ -18,7 +18,7 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
namespace gs { namespace gs {
static const uint32_t MAXIMUM_VERTICES = 0xFFFFFFu; static const uint32_t MAXIMUM_VERTICES = 0xFFFFFFu;

View file

@ -18,21 +18,12 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include "gs-effect.hpp" #include "gs-effect.hpp"
#include "gs-rendertarget.hpp" #include "gs-rendertarget.hpp"
#include "gs-texture.hpp" #include "gs-texture.hpp"
#include "gs-vertexbuffer.hpp" #include "gs-vertexbuffer.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
class mipmapper { class mipmapper {
std::unique_ptr<gs::vertex_buffer> _vb; std::unique_ptr<gs::vertex_buffer> _vb;

View file

@ -18,20 +18,9 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <memory>
#include "gs-texture.hpp" #include "gs-texture.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
class rendertarget_op; class rendertarget_op;

View file

@ -18,17 +18,7 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
class sampler { class sampler {

View file

@ -18,20 +18,9 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <string>
#include "utility.hpp" #include "utility.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
class texture { class texture {
public: public:

View file

@ -18,20 +18,10 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <xmmintrin.h> #include <xmmintrin.h>
#include "gs-limits.hpp" #include "gs-limits.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/vec3.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
struct vertex { struct vertex {
vec3* position; vec3* position;

View file

@ -18,21 +18,11 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include "gs-limits.hpp" #include "gs-limits.hpp"
#include "gs-vertex.hpp" #include "gs-vertex.hpp"
#include "utility.hpp" #include "utility.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <graphics/graphics.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace gs { namespace gs {
class vertex_buffer { class vertex_buffer {
uint32_t _size; uint32_t _size;

View file

@ -18,12 +18,9 @@
*/ */
#pragma once #pragma once
#include <cstdint> #include "common.hpp"
#include <string>
#include "util-event.hpp" #include "util-event.hpp"
#include <obs.h>
namespace obs { namespace obs {
template<typename T> template<typename T>
class signal_handler_base { class signal_handler_base {

View file

@ -17,23 +17,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef STREAMFX_SOURCE_FACTORY_HPP
#define STREAMFX_SOURCE_FACTORY_HPP
#pragma once #pragma once
#include <stdexcept> #include "common.hpp"
#include "plugin.hpp" #include "plugin.hpp"
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs-source.h>
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace obs { namespace obs {
template<class _factory, typename _instance> template<class _factory, typename _instance>
class source_factory { class source_factory {
@ -610,5 +597,3 @@ namespace obs {
}; };
} // namespace obs } // namespace obs
#endif

View file

@ -18,19 +18,9 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include <functional> #include <functional>
#include <map> #include <map>
#include <memory>
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace obs { namespace obs {
class source_tracker { class source_tracker {

View file

@ -17,24 +17,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef OBS_STREAM_EFFECTS_OBS_SOURCE_HPP
#define OBS_STREAM_EFFECTS_OBS_SOURCE_HPP
#pragma once #pragma once
#include "common.hpp"
#include <cinttypes>
#include <string>
#include "util-event.hpp" #include "util-event.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace obs { namespace obs {
class deprecated_source { class deprecated_source {
obs_source_t* _self; obs_source_t* _self;
@ -149,5 +135,3 @@ namespace obs {
} events; } events;
}; };
} // namespace obs } // namespace obs
#endif

View file

@ -17,23 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#ifndef OBS_STREAM_EFFECTS_OBS_TOOLS_HPP
#define OBS_STREAM_EFFECTS_OBS_TOOLS_HPP
#pragma once #pragma once
#include "common.hpp"
#include <cinttypes>
#include <memory>
#include <string>
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace obs { namespace obs {
namespace tools { namespace tools {
@ -73,5 +58,3 @@ namespace obs {
obs_sceneitem_remove(v); obs_sceneitem_remove(v);
} }
} // namespace obs } // namespace obs
#endif

View file

@ -18,35 +18,7 @@
*/ */
#pragma once #pragma once
#include "strings.hpp" #include "common.hpp"
#include "version.hpp"
#include "util-threadpool.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include "obs-module.h"
#include "util/platform.h"
#ifdef _MSC_VER
#pragma warning(pop)
#endif
// Logging
#define LOG_(level, ...) blog(level, "[" PLUGIN_NAME "] " __VA_ARGS__)
#define LOG_ERROR(...) LOG_(LOG_ERROR, __VA_ARGS__)
#define LOG_WARNING(...) LOG_(LOG_WARNING, __VA_ARGS__)
#define LOG_INFO(...) LOG_(LOG_INFO, __VA_ARGS__)
#define LOG_DEBUG(...) LOG_(LOG_DEBUG, __VA_ARGS__)
#ifndef __FUNCTION_NAME__
#ifdef WIN32 // WINDOWS
#define __FUNCTION_NAME__ __FUNCTION__
#else // *NIX
#define __FUNCTION_NAME__ __func__
#endif
#endif
// Threadpool // Threadpool
std::shared_ptr<util::threadpool> get_global_threadpool(); std::shared_ptr<util::threadpool> get_global_threadpool();

View file

@ -18,8 +18,8 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include <condition_variable> #include <condition_variable>
#include <memory>
#include <mutex> #include <mutex>
#include <queue> #include <queue>
#include <thread> #include <thread>
@ -31,17 +31,6 @@
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "obs/obs-source.hpp" #include "obs/obs-source.hpp"
#include "obs/obs-tools.hpp" #include "obs/obs-tools.hpp"
#include "plugin.hpp"
// OBS
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4201)
#endif
#include <obs-source.h>
#ifdef _MSC_VER
#pragma warning(pop)
#endif
namespace source::mirror { namespace source::mirror {
struct mirror_audio_data { struct mirror_audio_data {

View file

@ -18,16 +18,12 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include "gfx/shader/gfx-shader.hpp" #include "gfx/shader/gfx-shader.hpp"
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp" #include "plugin.hpp"
extern "C" {
#include <obs.h>
}
namespace source::shader { namespace source::shader {
class shader_instance : public obs::source_instance { class shader_instance : public obs::source_instance {
std::shared_ptr<gfx::shader::shader> _fx; std::shared_ptr<gfx::shader::shader> _fx;

View file

@ -18,7 +18,7 @@
*/ */
#pragma once #pragma once
#include "plugin.hpp" #include "common.hpp"
#define PLUGIN_NAME "StreamFX" #define PLUGIN_NAME "StreamFX"

View file

@ -18,16 +18,12 @@
*/ */
#pragma once #pragma once
#include "common.hpp"
#include "gfx/shader/gfx-shader.hpp" #include "gfx/shader/gfx-shader.hpp"
#include "obs/gs/gs-rendertarget.hpp" #include "obs/gs/gs-rendertarget.hpp"
#include "obs/obs-source-factory.hpp" #include "obs/obs-source-factory.hpp"
#include "plugin.hpp" #include "plugin.hpp"
extern "C" {
#include <obs.h>
}
namespace transition::shader { namespace transition::shader {
class shader_instance : public obs::source_instance { class shader_instance : public obs::source_instance {
std::shared_ptr<gfx::shader::shader> _fx; std::shared_ptr<gfx::shader::shader> _fx;

View file

@ -21,6 +21,7 @@
#include <functional> #include <functional>
#include <list> #include <list>
#include <mutex> #include <mutex>
#include "common.hpp"
namespace util { namespace util {
template<typename... _args> template<typename... _args>

View file

@ -17,11 +17,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#pragma once
#include "common.hpp"
#include <chrono> #include <chrono>
#include <cmath>
#include <cstddef>
#include <map> #include <map>
#include <memory>
#include <mutex> #include <mutex>
namespace util { namespace util {

View file

@ -24,6 +24,7 @@
#include <list> #include <list>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <stdexcept>
#include <thread> #include <thread>
namespace util { namespace util {

View file

@ -18,11 +18,7 @@
*/ */
#pragma once #pragma once
#include <cinttypes> #include "common.hpp"
#include <limits>
#include <string>
#include <type_traits>
#include <utility>
extern "C" { extern "C" {
#ifdef _MSC_VER #ifdef _MSC_VER