| 212 | } |
| 213 | |
| 214 | void streamfx::obs::source_tracker::source_rename_handler(void* ptr, calldata_t* data) noexcept |
| 215 | { |
| 216 | auto* self = reinterpret_cast<streamfx::obs::source_tracker*>(ptr); |
| 217 | try { |
| 218 | obs_source_t* source = nullptr; |
| 219 | if (calldata_get_ptr(data, "source", &source); !source) { |
| 220 | throw std::runtime_error("Missing 'source' parameter."); |
| 221 | } |
| 222 | |
| 223 | const char* old_name = nullptr; |
| 224 | if (calldata_get_string(data, "prev_name", &old_name); !old_name) { |
| 225 | throw std::runtime_error("Missing 'prev_name' parameter."); |
| 226 | } |
| 227 | |
| 228 | const char* new_name = nullptr; |
| 229 | if (calldata_get_string(data, "new_name", &new_name); !new_name) { |
| 230 | throw std::runtime_error("Missing 'new_name' parameter."); |
| 231 | } |
| 232 | |
| 233 | self->rename_source(old_name, new_name, source); |
| 234 | } catch (...) { |
| 235 | DLOG_ERROR("Unexpected exception in function '%s'.", __FUNCTION_NAME__); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | std::shared_ptr<streamfx::obs::source_tracker> streamfx::obs::source_tracker::instance() |
| 240 | { |
nothing calls this directly
no test coverage detected