mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-28 14:23:01 +00:00
54859e9f14
Allows us to pass an obs_module_t into util::library::load() for cleaner code. This requires an additional flag so we don't unload a module that is still in use by libOBS.
33 lines
827 B
C++
33 lines
827 B
C++
// AUTOGENERATED COPYRIGHT HEADER START
|
|
// Copyright (C) 2020-2023 Michael Fabian 'Xaymar' Dirks <info@xaymar.com>
|
|
// AUTOGENERATED COPYRIGHT HEADER END
|
|
|
|
#pragma once
|
|
#include "warning-disable.hpp"
|
|
#include <filesystem>
|
|
#include <memory>
|
|
#include <string_view>
|
|
|
|
#include <obs.h>
|
|
#include "warning-enable.hpp"
|
|
|
|
namespace streamfx::util {
|
|
class library {
|
|
void* _library;
|
|
bool _owner;
|
|
|
|
public:
|
|
library(std::filesystem::path file);
|
|
library(obs_module_t* library);
|
|
~library();
|
|
|
|
void* load_symbol(std::string_view name);
|
|
|
|
public:
|
|
static std::shared_ptr<::streamfx::util::library> load(std::filesystem::path file);
|
|
|
|
static std::shared_ptr<::streamfx::util::library> load(std::string_view name);
|
|
|
|
static std::shared_ptr<::streamfx::util::library> load(obs_module_t* instance);
|
|
};
|
|
} // namespace streamfx::util
|