diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-04-11 19:46:29 +0100 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-04-11 19:46:29 +0100 |
commit | 5c29923095c53ae9788bf77b7b6d416a689434e6 (patch) | |
tree | 18d5e32560d83ee2c37d5a444094c06ddf129017 /src/xine-engine/load_plugins.c | |
parent | 41573e618cf0989673677daefd1be7871506d0ef (diff) | |
download | xine-lib-5c29923095c53ae9788bf77b7b6d416a689434e6.tar.gz xine-lib-5c29923095c53ae9788bf77b7b6d416a689434e6.tar.bz2 |
Add a function for listing video output plugins of the given type(s).
Diffstat (limited to 'src/xine-engine/load_plugins.c')
-rw-r--r-- | src/xine-engine/load_plugins.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/xine-engine/load_plugins.c b/src/xine-engine/load_plugins.c index 0188fb01d..30077a38e 100644 --- a/src/xine-engine/load_plugins.c +++ b/src/xine-engine/load_plugins.c @@ -1665,6 +1665,36 @@ const char *const *xine_list_video_output_plugins (xine_t *xine) { return catalog->ids; } +const char *const *xine_list_video_output_plugins_typed(xine_t *xine, uint64_t typemask) +{ + plugin_catalog_t *catalog = xine->plugin_catalog; + plugin_node_t *node; + int list_id, list_size, i; + + pthread_mutex_lock (&catalog->lock); + + list_size = xine_sarray_size (catalog->plugin_lists[PLUGIN_VIDEO_OUT - 1]); + + for (list_id = i = 0; list_id < list_size; list_id++) + { + node = xine_sarray_get (catalog->plugin_lists[PLUGIN_VIDEO_OUT - 1], list_id); + if (typemask & (1ULL << ((vo_info_t *)node->info->special_info)->visual_type)) + { + const char *id = node->info->id; + int j = i; + while (--j >= 0) + if (!strcmp (catalog->ids[j], id)) + goto ignore; /* already listed */ + catalog->ids[i++] = id; + } + ignore: ; + } + catalog->ids[i] = NULL; + + pthread_mutex_unlock (&catalog->lock); + return catalog->ids; +} + static ao_driver_t *_load_audio_driver (xine_t *this, plugin_node_t *node, void *data) { |