2020-04-02 15:02:01 +00:00
|
|
|
/*
|
|
|
|
* 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>
|
2020-10-06 10:18:35 +00:00
|
|
|
#include <array>
|
2020-04-02 15:02:01 +00:00
|
|
|
#include <limits>
|
2020-06-07 19:56:45 +00:00
|
|
|
#include <map>
|
2020-04-02 15:02:01 +00:00
|
|
|
#include <memory>
|
2020-06-07 19:56:45 +00:00
|
|
|
#include <set>
|
2020-04-02 15:02:01 +00:00
|
|
|
#include <stdexcept>
|
|
|
|
#include <string>
|
2020-05-13 06:38:05 +00:00
|
|
|
#include <string_view>
|
2020-04-02 15:02:01 +00:00
|
|
|
#include <type_traits>
|
|
|
|
#include <utility>
|
2020-06-07 19:56:45 +00:00
|
|
|
#include <vector>
|
2020-04-02 15:02:01 +00:00
|
|
|
|
|
|
|
// Common Plugin includes
|
2020-08-09 23:37:01 +00:00
|
|
|
#include "config.hpp"
|
2020-04-02 15:02:01 +00:00
|
|
|
#include "strings.hpp"
|
2020-04-02 18:29:00 +00:00
|
|
|
#include "version.hpp"
|
2020-11-05 05:35:31 +00:00
|
|
|
#include "util/util-bitmask.hpp"
|
2020-08-09 20:47:33 +00:00
|
|
|
#include "util/util-library.hpp"
|
2020-07-12 16:41:50 +00:00
|
|
|
#include "util/util-math.hpp"
|
|
|
|
#include "util/util-profiler.hpp"
|
|
|
|
#include "util/util-threadpool.hpp"
|
|
|
|
#include "util/utility.hpp"
|
2020-04-02 15:02:01 +00:00
|
|
|
|
|
|
|
// Common OBS includes
|
|
|
|
extern "C" {
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable : 4201)
|
|
|
|
#endif
|
|
|
|
#include <obs.h>
|
2020-04-02 18:29:00 +00:00
|
|
|
|
|
|
|
#include <obs-config.h>
|
2020-04-02 15:02:01 +00:00
|
|
|
#include <obs-data.h>
|
|
|
|
#include <obs-encoder.h>
|
|
|
|
#include <obs-module.h>
|
|
|
|
#include <obs-properties.h>
|
|
|
|
#include <obs-source.h>
|
2020-04-02 18:29:00 +00:00
|
|
|
|
2020-04-02 15:02:01 +00:00
|
|
|
#include <graphics/graphics.h>
|
2020-04-02 18:29:00 +00:00
|
|
|
|
|
|
|
#include <graphics/effect.h>
|
2020-04-02 15:02:01 +00:00
|
|
|
#include <graphics/matrix4.h>
|
2020-04-02 18:29:00 +00:00
|
|
|
#include <graphics/vec2.h>
|
|
|
|
#include <graphics/vec3.h>
|
|
|
|
#include <graphics/vec4.h>
|
|
|
|
|
|
|
|
#include <util/platform.h>
|
2020-04-22 20:49:57 +00:00
|
|
|
|
|
|
|
// Fix libOBS's global defines
|
|
|
|
#undef strtoll
|
|
|
|
|
2020-04-02 15:02:01 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
#pragma warning(pop)
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
// Common Global defines
|
|
|
|
/// Logging
|
2021-06-08 02:16:33 +00:00
|
|
|
#define DLOG_(level, ...) blog(level, "[" S_PLUGIN_NAME "] " __VA_ARGS__)
|
2020-07-25 14:51:22 +00:00
|
|
|
#define DLOG_ERROR(...) DLOG_(LOG_ERROR, __VA_ARGS__)
|
|
|
|
#define DLOG_WARNING(...) DLOG_(LOG_WARNING, __VA_ARGS__)
|
|
|
|
#define DLOG_INFO(...) DLOG_(LOG_INFO, __VA_ARGS__)
|
|
|
|
#define DLOG_DEBUG(...) DLOG_(LOG_DEBUG, __VA_ARGS__)
|
2020-04-02 15:02:01 +00:00
|
|
|
/// 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
|
2022-05-26 00:58:26 +00:00
|
|
|
/// Forceful inlining
|
|
|
|
#ifndef FORCE_INLINE
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
#define FORCE_INLINE __force_inline
|
|
|
|
#elif defined(__GNUC__) || defined(__MINGW32__)
|
|
|
|
#define FORCE_INLINE __attribute__((always_inline))
|
|
|
|
#else
|
|
|
|
#define FORCE_INLINE inline
|
|
|
|
#endif
|
|
|
|
#endif
|