MCPcopy Create free account
hub / github.com/Vhonowslend/StreamFX-Public / source_rename_handler

Method source_rename_handler

source/obs/obs-source-tracker.cpp:214–237  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

212}
213
214void 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
239std::shared_ptr<streamfx::obs::source_tracker> streamfx::obs::source_tracker::instance()
240{

Callers

nothing calls this directly

Calls 1

rename_sourceMethod · 0.95

Tested by

no test coverage detected