File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -82,12 +82,28 @@ def gather_device_info(dev_type, hook):
8282 SINKS = gather_device_info ("sinks" , "device_sink_api" )
8383
8484
85- plugin_devices = {name : api for name , api in plugins .get_hook ().device_source_api ()}
86- SOURCES = {k : check_plugin (plugin_devices , k , v ) for k , v in get_devices ("sources" )}
85+ def _list_devices (devs , mtype ):
86+ return [
87+ dev
88+ for dev , info in devs .items ()
89+ if "list" in info and any ((k .startswith (mtype ) for k in info ["list" ].keys ()))
90+ ]
8791
88- plugin_devices = {name : api for name , api in plugins .get_hook ().device_sink_api ()}
89- SINKS = {k : check_plugin (plugin_devices , k , v ) for k , v in get_devices ("sinks" )}
9092
93+ def list_video_sources ():
94+ return _list_devices (SOURCES , "v" )
95+
96+
97+ def list_audio_sources ():
98+ return _list_devices (SOURCES , "a" )
99+
100+
101+ def list_video_sinks ():
102+ return _list_devices (SINKS , "v" )
103+
104+
105+ def list_audio_sinks ():
106+ return _list_devices (SINKS , "a" )
91107
92108def resolve_source (url , opts ):
93109 try :
You can’t perform that action at this time.
0 commit comments