Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion obs-studio-server/source/osn-filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,17 @@ void osn::Filter::Types(void *data, const int64_t id, const std::vector<ipc::val
rval.push_back(ipc::value((uint64_t)ErrorCode::Ok));
const char *typeId = nullptr;
for (size_t idx = 0; obs_enum_filter_types(idx, &typeId); idx++) {
rval.push_back(ipc::value(typeId ? typeId : ""));
if (!typeId)
continue;
uint32_t caps = obs_get_source_output_flags(typeId);
Comment thread
Copilot marked this conversation as resolved.
if ((caps & OBS_SOURCE_DEPRECATED) != 0)
continue;
if ((caps & OBS_SOURCE_CAP_DISABLED) != 0)
continue;
if ((caps & OBS_SOURCE_CAP_OBSOLETE) != 0)
continue;

rval.push_back(ipc::value(typeId));
}
AUTO_DEBUG;
}
Expand Down
17 changes: 17 additions & 0 deletions tests/osn-tests/src/test_osn_filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,4 +195,21 @@ describe(testName, () => {
filter.release();
});
});

it('Verify obsolete filters are not returned to the caller', () => {
// These v1 filters are superseded by v2 equivalents and marked OBS_SOURCE_CAP_OBSOLETE.
const knownObsoleteFilters = [
'color_filter',
'color_key_filter',
'chroma_key_filter',
'sharpness_filter',
'mask_filter',
'luma_key_filter',
'noise_suppress_filter',
];

knownObsoleteFilters.forEach(function(id) {
expect(obs.filterTypes).to.not.include(id, `Obsolete filter '${id}' should not be returned to the caller`);
});
});
});
Loading