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

Method rename_source

source/obs/obs-source-tracker.cpp:136–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134}
135
136void streamfx::obs::source_tracker::rename_source(std::string_view old_name, std::string_view new_name, obs_source_t* source)
137{
138 if (old_name == new_name) {
139 throw std::runtime_error("New and old name are identical.");
140 }
141
142 std::lock_guard<decltype(_mutex)> lock(_mutex);
143
144 // Remove the previously tracked entry.
145 if (auto kv = _sources.find(std::string{old_name}); kv != _sources.end()) {
146 _sources.erase(kv);
147 }
148
149 // And then add the new entry.
150 _sources.emplace(std::string{new_name}, ::streamfx::obs::weak_source{source});
151}
152
153bool streamfx::obs::source_tracker::filter_sources(std::string, ::streamfx::obs::source source)
154{

Callers 1

source_rename_handlerMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected