[vlc-devel] [PATCH] libvlc: Add a libvlc_media_discoverer_list_get function

Hugo Beauzée-Luyssen hugo at beauzee.fr
Mon Aug 3 14:30:12 CEST 2015


This helps listing the modules available for use with
libvlc_media_discoverer_new_from_name
---
 include/vlc/libvlc.h | 18 ++++++++++++++++--
 lib/core.c           |  5 +++++
 lib/libvlc.sym       |  1 +
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/include/vlc/libvlc.h b/include/vlc/libvlc.h
index 68023ef..b5e4482 100644
--- a/include/vlc/libvlc.h
+++ b/include/vlc/libvlc.h
@@ -618,7 +618,21 @@ libvlc_module_description_t *libvlc_audio_filter_list_get( libvlc_instance_t *p_
 LIBVLC_API
 libvlc_module_description_t *libvlc_video_filter_list_get( libvlc_instance_t *p_instance );
 
-/** @} */
+/**
+ * Returns a list of media discoverer modules that are available.
+ *
+ * \param p_instance libvlc instance
+ *
+ * \return a list of module descriptions. It should be freed with libvlc_module_description_list_release().
+ *         In case of an error, NULL is returned.
+ *
+ * \see libvlc_module_description_t
+ * \see libvlc_module_description_list_release
+ */
+LIBVLC_API
+libvlc_module_description_t *libvlc_media_discoverer_list_get( libvlc_instance_t *p_instance );
+
+/** @} */
 
 /** \defgroup libvlc_clock LibVLC time
  * These functions provide access to the LibVLC time/clock.
@@ -647,7 +661,7 @@ static inline int64_t libvlc_delay(int64_t pts)
     return pts - libvlc_clock();
 }
 
-/** @} */
+/** @} */
 
 # ifdef __cplusplus
 }
diff --git a/lib/core.c b/lib/core.c
index fa5c4de..175520b 100644
--- a/lib/core.c
+++ b/lib/core.c
@@ -253,6 +253,11 @@ libvlc_module_description_t *libvlc_video_filter_list_get( libvlc_instance_t *p_
     return module_description_list_get( p_instance, "video filter2" );
 }
 
+libvlc_module_description_t *libvlc_media_discoverer_list_get( libvlc_instance_t *p_instance )
+{
+    return module_description_list_get( p_instance, "services_discovery" );
+}
+
 int64_t libvlc_clock(void)
 {
     return mdate();
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index 03577c7..60ff849 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -280,4 +280,5 @@ libvlc_set_exit_handler
 libvlc_wait
 libvlc_audio_filter_list_get
 libvlc_video_filter_list_get
+libvlc_media_discoverer_list_get
 libvlc_module_description_list_release
-- 
2.1.4




More information about the vlc-devel mailing list