diff --git a/source/gfx/gfx-source-texture.cpp b/source/gfx/gfx-source-texture.cpp index 78bd908..62a945f 100644 --- a/source/gfx/gfx-source-texture.cpp +++ b/source/gfx/gfx-source-texture.cpp @@ -34,7 +34,7 @@ gfx::source_texture::source_texture(obs_source_t* parent) if (!parent) { throw std::invalid_argument("_parent must not be null"); } - _parent = std::make_shared(parent, false, false); + _parent = std::make_shared(parent, false, false); _rt = std::make_shared(GS_RGBA, GS_ZS_NONE); } @@ -46,7 +46,7 @@ gfx::source_texture::source_texture(obs_source_t* _source, obs_source_t* _parent if (!obs_source_add_active_child(_parent, _source)) { throw std::runtime_error("_parent is contained in _child"); } - _child = std::make_shared(_source, true, true); + _child = std::make_shared(_source, true, true); } gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) : source_texture(_parent) @@ -54,7 +54,7 @@ gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) : if (!_name) { throw std::invalid_argument("name must not be null"); } - _child = std::make_shared(_name, true, true); + _child = std::make_shared(_name, true, true); if (!obs_source_add_active_child(_parent, _child->get())) { throw std::runtime_error("_parent is contained in _child"); } @@ -63,8 +63,8 @@ gfx::source_texture::source_texture(const char* _name, obs_source_t* _parent) : gfx::source_texture::source_texture(std::string _name, obs_source_t* _parent) : source_texture(_name.c_str(), _parent) {} -gfx::source_texture::source_texture(std::shared_ptr pchild, - std::shared_ptr pparent) +gfx::source_texture::source_texture(std::shared_ptr pchild, + std::shared_ptr pparent) { if (!pchild) { throw std::invalid_argument("_child must not be null"); @@ -80,8 +80,8 @@ gfx::source_texture::source_texture(std::shared_ptr pchi this->_rt = std::make_shared(GS_RGBA, GS_ZS_NONE); } -gfx::source_texture::source_texture(std::shared_ptr _child, obs_source_t* _parent) - : source_texture(_child, std::make_shared(_parent, false, false)) +gfx::source_texture::source_texture(std::shared_ptr _child, obs_source_t* _parent) + : source_texture(_child, std::make_shared(_parent, false, false)) {} obs_source_t* gfx::source_texture::get_object() diff --git a/source/gfx/gfx-source-texture.hpp b/source/gfx/gfx-source-texture.hpp index a56c00b..d2e562f 100644 --- a/source/gfx/gfx-source-texture.hpp +++ b/source/gfx/gfx-source-texture.hpp @@ -24,8 +24,8 @@ namespace gfx { class source_texture { - std::shared_ptr _parent; - std::shared_ptr _child; + std::shared_ptr _parent; + std::shared_ptr _child; std::shared_ptr _rt; @@ -37,8 +37,9 @@ namespace gfx { source_texture(const char* name, obs_source_t* parent); source_texture(std::string name, obs_source_t* parent); - source_texture(std::shared_ptr child, std::shared_ptr parent); - source_texture(std::shared_ptr child, obs_source_t* parent); + source_texture(std::shared_ptr child, + std::shared_ptr parent); + source_texture(std::shared_ptr child, obs_source_t* parent); public /*copy*/: source_texture(source_texture const& other) = delete; diff --git a/source/gfx/shader/gfx-shader.cpp b/source/gfx/shader/gfx-shader.cpp index 13971d4..761e70d 100644 --- a/source/gfx/shader/gfx-shader.cpp +++ b/source/gfx/shader/gfx-shader.cpp @@ -262,7 +262,7 @@ bool gfx::shader::shader::on_refresh_properties(obs_properties_t* props, obs_pro { // Clear parameter options. auto grp = obs_property_group_content(obs_properties_get(props, ST_PARAMETERS)); for (auto p = obs_properties_first(grp); p != nullptr; p = obs_properties_first(grp)) { - obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p)); + streamfx::obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p)); } // Rebuild new parameters. @@ -299,7 +299,7 @@ bool gfx::shader::shader::on_shader_or_technique_modified(obs_properties_t* prop // Clear parameter options. auto grp = obs_property_group_content(obs_properties_get(props, ST_PARAMETERS)); for (auto p = obs_properties_first(grp); p != nullptr; p = obs_properties_first(grp)) { - obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p)); + streamfx::obs::tools::obs_properties_remove_by_name(grp, obs_property_name(p)); } // Rebuild new parameters. diff --git a/source/obs/obs-encoder-factory.hpp b/source/obs/obs-encoder-factory.hpp index 668a3b9..9a3c748 100644 --- a/source/obs/obs-encoder-factory.hpp +++ b/source/obs/obs-encoder-factory.hpp @@ -21,7 +21,7 @@ #include "common.hpp" #include "plugin.hpp" -namespace obs { +namespace streamfx::obs { template class encoder_factory { public: @@ -350,4 +350,4 @@ namespace obs { virtual void get_video_info(struct video_scale_info* info) {} }; -} // namespace obs +} // namespace streamfx::obs diff --git a/source/obs/obs-signal-handler.hpp b/source/obs/obs-signal-handler.hpp index a3c4ca7..1dd290d 100644 --- a/source/obs/obs-signal-handler.hpp +++ b/source/obs/obs-signal-handler.hpp @@ -21,7 +21,7 @@ #include "common.hpp" #include "util/util-event.hpp" -namespace obs { +namespace streamfx::obs { template class signal_handler_base { protected: @@ -91,4 +91,4 @@ namespace obs { streamfx::util::event, const struct audio_data*, bool> event; }; -} // namespace obs +} // namespace streamfx::obs diff --git a/source/obs/obs-source-factory.hpp b/source/obs/obs-source-factory.hpp index fa93d33..474b36b 100644 --- a/source/obs/obs-source-factory.hpp +++ b/source/obs/obs-source-factory.hpp @@ -21,7 +21,7 @@ #include "common.hpp" #include "plugin.hpp" -namespace obs { +namespace streamfx::obs { template class source_factory { protected: @@ -640,4 +640,4 @@ namespace obs { } }; -} // namespace obs +} // namespace streamfx::obs diff --git a/source/obs/obs-source-tracker.cpp b/source/obs/obs-source-tracker.cpp index fe632a6..6236cc6 100644 --- a/source/obs/obs-source-tracker.cpp +++ b/source/obs/obs-source-tracker.cpp @@ -22,11 +22,11 @@ #include "obs/obs-tools.hpp" #include "plugin.hpp" -static std::shared_ptr source_tracker_instance; +static std::shared_ptr source_tracker_instance; -void obs::source_tracker::source_create_handler(void* ptr, calldata_t* data) noexcept +void streamfx::obs::source_tracker::source_create_handler(void* ptr, calldata_t* data) noexcept try { - obs::source_tracker* self = reinterpret_cast(ptr); + streamfx::obs::source_tracker* self = reinterpret_cast(ptr); obs_source_t* target = nullptr; calldata_get_ptr(data, "source", &target); @@ -47,15 +47,15 @@ try { { std::unique_lock ul(self->_lock); - self->_sources.insert({std::string(name), {weak, obs::obs_weak_source_deleter}}); + self->_sources.insert({std::string(name), {weak, streamfx::obs::obs_weak_source_deleter}}); } } catch (...) { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::source_tracker::source_destroy_handler(void* ptr, calldata_t* data) noexcept +void streamfx::obs::source_tracker::source_destroy_handler(void* ptr, calldata_t* data) noexcept try { - obs::source_tracker* self = reinterpret_cast(ptr); + streamfx::obs::source_tracker* self = reinterpret_cast(ptr); obs_source_t* target = nullptr; calldata_get_ptr(data, "source", &target); @@ -81,9 +81,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::source_tracker::source_rename_handler(void* ptr, calldata_t* data) noexcept +void streamfx::obs::source_tracker::source_rename_handler(void* ptr, calldata_t* data) noexcept try { - obs::source_tracker* self = reinterpret_cast(ptr); + streamfx::obs::source_tracker* self = reinterpret_cast(ptr); obs_source_t* target = nullptr; const char* prev_name = nullptr; @@ -106,7 +106,7 @@ try { if (!weak) { return; } - self->_sources.insert({new_name, {weak, obs::obs_weak_source_deleter}}); + self->_sources.insert({new_name, {weak, streamfx::obs::obs_weak_source_deleter}}); return; } @@ -118,22 +118,22 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::source_tracker::initialize() +void streamfx::obs::source_tracker::initialize() { - source_tracker_instance = std::make_shared(); + source_tracker_instance = std::make_shared(); } -void obs::source_tracker::finalize() +void streamfx::obs::source_tracker::finalize() { source_tracker_instance.reset(); } -std::shared_ptr obs::source_tracker::get() +std::shared_ptr streamfx::obs::source_tracker::get() { return source_tracker_instance; } -obs::source_tracker::source_tracker() +streamfx::obs::source_tracker::source_tracker() { auto osi = obs_get_signal_handler(); signal_handler_connect(osi, "source_create", &source_create_handler, this); @@ -141,7 +141,7 @@ obs::source_tracker::source_tracker() signal_handler_connect(osi, "source_rename", &source_rename_handler, this); } -obs::source_tracker::~source_tracker() +streamfx::obs::source_tracker::~source_tracker() { auto osi = obs_get_signal_handler(); if (osi) { @@ -153,7 +153,7 @@ obs::source_tracker::~source_tracker() this->_sources.clear(); } -void obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb) +void streamfx::obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb) { // Need func-local copy, otherwise we risk corruption if a new source is created or destroyed. decltype(_sources) _clone; @@ -163,8 +163,8 @@ void obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb) } for (auto kv : _clone) { - auto source = - std::shared_ptr(obs_weak_source_get_source(kv.second.get()), obs::obs_source_deleter); + auto source = std::shared_ptr(obs_weak_source_get_source(kv.second.get()), + streamfx::obs::obs_source_deleter); if (!source) { continue; } @@ -183,29 +183,29 @@ void obs::source_tracker::enumerate(enumerate_cb_t ecb, filter_cb_t fcb) } } -bool obs::source_tracker::filter_sources(std::string, obs_source_t* source) +bool streamfx::obs::source_tracker::filter_sources(std::string, obs_source_t* source) { return (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); } -bool obs::source_tracker::filter_audio_sources(std::string, obs_source_t* source) +bool streamfx::obs::source_tracker::filter_audio_sources(std::string, obs_source_t* source) { uint32_t flags = obs_source_get_output_flags(source); return !(flags & OBS_SOURCE_AUDIO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); } -bool obs::source_tracker::filter_video_sources(std::string, obs_source_t* source) +bool streamfx::obs::source_tracker::filter_video_sources(std::string, obs_source_t* source) { uint32_t flags = obs_source_get_output_flags(source); return !(flags & OBS_SOURCE_VIDEO) || (obs_source_get_type(source) != OBS_SOURCE_TYPE_INPUT); } -bool obs::source_tracker::filter_transitions(std::string, obs_source_t* source) +bool streamfx::obs::source_tracker::filter_transitions(std::string, obs_source_t* source) { return (obs_source_get_type(source) != OBS_SOURCE_TYPE_TRANSITION); } -bool obs::source_tracker::filter_scenes(std::string, obs_source_t* source) +bool streamfx::obs::source_tracker::filter_scenes(std::string, obs_source_t* source) { return (obs_source_get_type(source) != OBS_SOURCE_TYPE_SCENE); } diff --git a/source/obs/obs-source-tracker.hpp b/source/obs/obs-source-tracker.hpp index c291364..bff87c3 100644 --- a/source/obs/obs-source-tracker.hpp +++ b/source/obs/obs-source-tracker.hpp @@ -23,7 +23,7 @@ #include #include -namespace obs { +namespace streamfx::obs { class source_tracker { std::map> _sources; std::mutex _lock; @@ -33,9 +33,9 @@ namespace obs { static void source_rename_handler(void* ptr, calldata_t* data) noexcept; public: // Singleton - static void initialize(); - static void finalize(); - static std::shared_ptr get(); + static void initialize(); + static void finalize(); + static std::shared_ptr get(); public: source_tracker(); @@ -69,4 +69,4 @@ namespace obs { static bool filter_transitions(std::string name, obs_source_t* source); static bool filter_scenes(std::string name, obs_source_t* source); }; -} // namespace obs +} // namespace streamfx::obs diff --git a/source/obs/obs-source.cpp b/source/obs/obs-source.cpp index ffc9ddb..f578f58 100644 --- a/source/obs/obs-source.cpp +++ b/source/obs/obs-source.cpp @@ -21,9 +21,9 @@ #include #include "plugin.hpp" -void obs::deprecated_source::handle_destroy(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_destroy(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); obs_source_t* source; if (!calldata_get_ptr(calldata, "source", &source)) { @@ -44,9 +44,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_remove(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_remove(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.remove) { return; } @@ -57,9 +57,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_save(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_save(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.save) { return; } @@ -70,9 +70,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_load(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_load(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.load) { return; } @@ -83,9 +83,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_activate(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_activate(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.activate) { return; } @@ -96,9 +96,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_deactivate(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_deactivate(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.deactivate) { return; } @@ -109,9 +109,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_show(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_show(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.show) { return; } @@ -122,9 +122,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_hide(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_hide(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.hide) { return; } @@ -135,9 +135,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_enable(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_enable(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.enable) { return; } @@ -154,9 +154,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_push_to_mute_changed(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_push_to_mute_changed(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.push_to_mute_changed) { return; } @@ -173,9 +173,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_push_to_mute_delay(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_push_to_mute_delay(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.push_to_mute_delay) { return; } @@ -192,9 +192,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_push_to_talk_changed(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_push_to_talk_changed(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.push_to_talk_changed) { return; } @@ -211,9 +211,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_push_to_talk_delay(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_push_to_talk_delay(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.push_to_talk_delay) { return; } @@ -230,9 +230,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_rename(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_rename(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.enable) { return; } @@ -254,9 +254,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_update_properties(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_update_properties(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.update_properties) { return; } @@ -267,9 +267,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_update_flags(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_update_flags(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.update_flags) { return; } @@ -286,9 +286,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_mute(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_mute(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.mute) { return; } @@ -305,9 +305,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_volume(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_volume(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.volume) { return; } @@ -326,9 +326,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_audio_sync(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_audio_sync(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.audio_sync) { return; } @@ -347,9 +347,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_audio_mixers(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_audio_mixers(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.audio_mixers) { return; } @@ -368,9 +368,10 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_audio_data(void* p, obs_source_t*, const audio_data* audio, bool muted) noexcept +void streamfx::obs::deprecated_source::handle_audio_data(void* p, obs_source_t*, const audio_data* audio, + bool muted) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.audio) { return; } @@ -382,9 +383,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_filter_add(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_filter_add(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.filter_add) { return; } @@ -401,9 +402,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_filter_remove(void* p, calldata_t* calldata) noexcept +void streamfx::obs::deprecated_source::handle_filter_remove(void* p, calldata_t* calldata) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.filter_remove) { return; } @@ -420,9 +421,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_reorder_filters(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_reorder_filters(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.reorder_filters) { return; } @@ -433,9 +434,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_transition_start(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_transition_start(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.transition_start) { return; } @@ -446,9 +447,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_transition_video_stop(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_transition_video_stop(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.transition_video_stop) { return; } @@ -459,9 +460,9 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -void obs::deprecated_source::handle_transition_stop(void* p, calldata_t*) noexcept +void streamfx::obs::deprecated_source::handle_transition_stop(void* p, calldata_t*) noexcept try { - obs::deprecated_source* self = reinterpret_cast(p); + streamfx::obs::deprecated_source* self = reinterpret_cast(p); if (!self->events.transition_stop) { return; } @@ -472,7 +473,7 @@ try { DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); } -obs::deprecated_source::~deprecated_source() +streamfx::obs::deprecated_source::~deprecated_source() { #ifdef auto_signal_d #undef auto_signal_d @@ -513,7 +514,7 @@ obs::deprecated_source::~deprecated_source() this->_self = nullptr; } -obs::deprecated_source::deprecated_source() +streamfx::obs::deprecated_source::deprecated_source() { #ifdef auto_signal_c #undef auto_signal_c @@ -553,18 +554,20 @@ obs::deprecated_source::deprecated_source() this->events.audio.set_listen_callback([this]() noexcept { if (!this->_self) return; - obs_source_add_audio_capture_callback(this->_self, obs::deprecated_source::handle_audio_data, this); + obs_source_add_audio_capture_callback(this->_self, streamfx::obs::deprecated_source::handle_audio_data, + this); }); this->events.audio.set_silence_callback([this]() noexcept { if (!this->_self) return; - obs_source_remove_audio_capture_callback(this->_self, obs::deprecated_source::handle_audio_data, this); + obs_source_remove_audio_capture_callback(this->_self, streamfx::obs::deprecated_source::handle_audio_data, + this); }); } } -obs::deprecated_source::deprecated_source(std::string name, bool ptrack_ownership, bool add_reference) - : ::obs::deprecated_source::deprecated_source() +streamfx::obs::deprecated_source::deprecated_source(std::string name, bool ptrack_ownership, bool add_reference) + : ::streamfx::obs::deprecated_source::deprecated_source() { this->_self = obs_get_source_by_name(name.c_str()); if (!this->_self) { @@ -577,8 +580,8 @@ obs::deprecated_source::deprecated_source(std::string name, bool ptrack_ownershi } } -obs::deprecated_source::deprecated_source(obs_source_t* source, bool ptrack_ownership, bool add_reference) - : ::obs::deprecated_source::deprecated_source() +streamfx::obs::deprecated_source::deprecated_source(obs_source_t* source, bool ptrack_ownership, bool add_reference) + : ::streamfx::obs::deprecated_source::deprecated_source() { this->_self = source; if (!this->_self) { @@ -689,7 +692,7 @@ obs::deprecated_source& obs::deprecated_source::operator=(deprecated_source cons } */ -obs::deprecated_source::deprecated_source(deprecated_source&& other) +streamfx::obs::deprecated_source::deprecated_source(deprecated_source&& other) : _self(std::move(other._self)), _track_ownership(std::move(other._track_ownership)) { // Clean out other source @@ -730,7 +733,7 @@ obs::deprecated_source::deprecated_source(deprecated_source&& other) #undef auto_signal_c } -obs::deprecated_source& obs::deprecated_source::operator=(deprecated_source&& other) +streamfx::obs::deprecated_source& streamfx::obs::deprecated_source::operator=(deprecated_source&& other) { if (this != &other) { return *this; @@ -782,7 +785,7 @@ obs::deprecated_source& obs::deprecated_source::operator=(deprecated_source&& ot return *this; } -obs_source_type obs::deprecated_source::type() +obs_source_type streamfx::obs::deprecated_source::type() { if (!_self) { return static_cast(-1); @@ -790,7 +793,7 @@ obs_source_type obs::deprecated_source::type() return obs_source_get_type(_self); } -void* obs::deprecated_source::type_data() +void* streamfx::obs::deprecated_source::type_data() { if (!_self) { return nullptr; @@ -798,7 +801,7 @@ void* obs::deprecated_source::type_data() return obs_source_get_type_data(_self); } -uint32_t obs::deprecated_source::width() +uint32_t streamfx::obs::deprecated_source::width() { if (!_self) { return 0; @@ -806,7 +809,7 @@ uint32_t obs::deprecated_source::width() return obs_source_get_width(_self); } -uint32_t obs::deprecated_source::height() +uint32_t streamfx::obs::deprecated_source::height() { if (!_self) { return 0; @@ -814,17 +817,17 @@ uint32_t obs::deprecated_source::height() return obs_source_get_height(_self); } -bool obs::deprecated_source::destroyed() +bool streamfx::obs::deprecated_source::destroyed() { return _self == nullptr; } -void obs::deprecated_source::clear() +void streamfx::obs::deprecated_source::clear() { _self = nullptr; } -obs_source_t* obs::deprecated_source::get() +obs_source_t* streamfx::obs::deprecated_source::get() { return _self; } diff --git a/source/obs/obs-source.hpp b/source/obs/obs-source.hpp index 937d46b..4e461eb 100644 --- a/source/obs/obs-source.hpp +++ b/source/obs/obs-source.hpp @@ -21,7 +21,7 @@ #include "common.hpp" #include "util/util-event.hpp" -namespace obs { +namespace streamfx::obs { class deprecated_source { obs_source_t* _self; bool _track_ownership = false; @@ -89,49 +89,49 @@ namespace obs { public: // Events struct { // Destroy and Remove - streamfx::util::event destroy; - streamfx::util::event remove; + streamfx::util::event destroy; + streamfx::util::event remove; // Saving, Loading and Update - streamfx::util::event save; - streamfx::util::event load; - streamfx::util::event update_properties; + streamfx::util::event save; + streamfx::util::event load; + streamfx::util::event update_properties; // Activate, Deactivate - streamfx::util::event activate; - streamfx::util::event deactivate; + streamfx::util::event activate; + streamfx::util::event deactivate; // Show Hide - streamfx::util::event show; - streamfx::util::event hide; + streamfx::util::event show; + streamfx::util::event hide; // Other - streamfx::util::event enable; - streamfx::util::event rename; - streamfx::util::event update_flags; + streamfx::util::event enable; + streamfx::util::event rename; + streamfx::util::event update_flags; // Hotkeys (PtM, PtT) - streamfx::util::event push_to_mute_changed; - streamfx::util::event push_to_mute_delay; - streamfx::util::event push_to_talk_changed; - streamfx::util::event push_to_talk_delay; + streamfx::util::event push_to_mute_changed; + streamfx::util::event push_to_mute_delay; + streamfx::util::event push_to_talk_changed; + streamfx::util::event push_to_talk_delay; // Audio - streamfx::util::event mute; - streamfx::util::event volume; - streamfx::util::event audio_sync; - streamfx::util::event audio_mixers; - streamfx::util::event audio; + streamfx::util::event mute; + streamfx::util::event volume; + streamfx::util::event audio_sync; + streamfx::util::event audio_mixers; + streamfx::util::event audio; // Filters - streamfx::util::event filter_add; - streamfx::util::event filter_remove; - streamfx::util::event reorder_filters; + streamfx::util::event filter_add; + streamfx::util::event filter_remove; + streamfx::util::event reorder_filters; // Transition - streamfx::util::event transition_start; - streamfx::util::event transition_video_stop; - streamfx::util::event transition_stop; + streamfx::util::event transition_start; + streamfx::util::event transition_video_stop; + streamfx::util::event transition_stop; } events; }; -} // namespace obs +} // namespace streamfx::obs diff --git a/source/obs/obs-tools.cpp b/source/obs/obs-tools.cpp index 6731a66..0b4ff37 100644 --- a/source/obs/obs-tools.cpp +++ b/source/obs/obs-tools.cpp @@ -74,7 +74,7 @@ static bool scs_contains(scs_searchdata& sd, obs_source_t* source) return true; } -bool obs::tools::scene_contains_source(obs_scene_t* scene, obs_source_t* source) +bool streamfx::obs::tools::scene_contains_source(obs_scene_t* scene, obs_source_t* source) { scs_searchdata sd; sd.source = source; @@ -113,7 +113,7 @@ struct _hack_obs_properties { }; } -bool obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const char* name) +bool streamfx::obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const char* name) { // Due to a bug in obs_properties_remove_by_name, calling it on the first or last element of a group corrupts the // obs_properties_t's first and last pointers, which now point at nonsense. @@ -161,7 +161,7 @@ bool obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const ch } if (el_cur->type == OBS_PROPERTY_GROUP) { - if (obs::tools::obs_properties_remove_by_name( + if (streamfx::obs::tools::obs_properties_remove_by_name( obs_property_group_content(reinterpret_cast(el_cur)), name)) return true; } @@ -170,7 +170,7 @@ bool obs::tools::obs_properties_remove_by_name(obs_properties_t* props, const ch return false; } -obs::tools::child_source::child_source(obs_source_t* parent, std::shared_ptr child) +streamfx::obs::tools::child_source::child_source(obs_source_t* parent, std::shared_ptr child) : _parent(parent), _child(child) { if (!obs_source_add_active_child(_parent, _child.get())) { @@ -178,12 +178,12 @@ obs::tools::child_source::child_source(obs_source_t* parent, std::shared_ptr obs::tools::child_source::get() +std::shared_ptr streamfx::obs::tools::child_source::get() { return _child; } diff --git a/source/obs/obs-tools.hpp b/source/obs/obs-tools.hpp index 38bb7c8..7391761 100644 --- a/source/obs/obs-tools.hpp +++ b/source/obs/obs-tools.hpp @@ -20,7 +20,7 @@ #pragma once #include "common.hpp" -namespace obs { +namespace streamfx::obs { namespace tools { bool scene_contains_source(obs_scene_t* scene, obs_source_t* source); @@ -96,4 +96,4 @@ namespace obs { { obs_data_release(v); } -} // namespace obs +} // namespace streamfx::obs diff --git a/source/plugin.cpp b/source/plugin.cpp index 4b6055f..75666bc 100644 --- a/source/plugin.cpp +++ b/source/plugin.cpp @@ -87,7 +87,7 @@ try { _threadpool = std::make_shared(); // Initialize Source Tracker - obs::source_tracker::initialize(); + streamfx::obs::source_tracker::initialize(); // GS Stuff { @@ -242,7 +242,7 @@ try { } // Finalize Source Tracker - obs::source_tracker::finalize(); + streamfx::obs::source_tracker::finalize(); // // Auto-Updater //#ifdef ENABLE_UPDATER diff --git a/source/sources/source-mirror.cpp b/source/sources/source-mirror.cpp index 1e5c107..4fb966b 100644 --- a/source/sources/source-mirror.cpp +++ b/source/sources/source-mirror.cpp @@ -359,7 +359,8 @@ obs_properties_t* mirror_factory::get_properties2(mirror_instance* data) OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Unknown)), static_cast(SPEAKERS_UNKNOWN)); - obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Mono)), static_cast(SPEAKERS_MONO)); + obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Mono)), + static_cast(SPEAKERS_MONO)); obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(Stereo)), static_cast(SPEAKERS_STEREO)); obs_property_list_add_int(p, D_TRANSLATE(ST_I18N_SOURCE_AUDIO_LAYOUT_(StereoLFE)),