Question / Help Create callback in python script to use in "obs_source_enum_filters"

AronHetLam

New Member
Hi

I'm trying to list filters on a source in a python script I'm working on, but i can't figure out how to get the callback working in:
Code:
obs_source_enum_filters(obs_source_t *source, obs_source_enum_proc_t callback, void *param)
I get this error:
Code:
TypeError: in method 'obs_source_enum_filters', argument 2 of type 'obs_source_enum_proc_t'
When running this code:
Python:
def lsit_filters(source_name):
    source = obs.obs_get_source_by_name(source_name)
    if source is not None:
        obs.obs_source_enum_filters(source, print_filter, None)

def print_filter(source, filter_, param):
    if source is not None:
        print("source name: " + source.obs_source_get_name)
    if filter_ is not None:
        print("filter name: " + filter_.obs_source_get_name)
I don't see another way to get hold of the filters on a source, and i can't get around this issue.
 
Top