| 91 | } |
| 92 | |
| 93 | void streamfx::obs::source_tracker::insert_source(obs_source_t* source) |
| 94 | { |
| 95 | const char* name = obs_source_get_name(source); |
| 96 | |
| 97 | // Don't track unnamed sources. |
| 98 | if (!name || (strnlen(name, 1) == 0)) { |
| 99 | D_LOG_DEBUG("Unnamed source '0x%08zX' left untracked.", source); |
| 100 | return; |
| 101 | } |
| 102 | |
| 103 | // Insert the newly tracked source into the map. |
| 104 | std::lock_guard<decltype(_mutex)> lock(_mutex); |
| 105 | _sources.emplace(std::string{name}, ::streamfx::obs::weak_source{source}); |
| 106 | } |
| 107 | |
| 108 | void streamfx::obs::source_tracker::remove_source(obs_source_t* source) |
| 109 | { |
no outgoing calls
no test coverage detected