[vlc-commits] libVLC: rename libvlc_media_discoverer_services_get

Jean-Baptiste Kempf git at videolan.org
Thu Feb 11 17:59:34 CET 2016


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Thu Feb 11 17:57:35 2016 +0100| [d1458c92a805781d388ca7e71d563d536d99d59e] | committer: Jean-Baptiste Kempf

libVLC: rename libvlc_media_discoverer_services_get

to libvlc_media_discoverer_list_get and do the same for release

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d1458c92a805781d388ca7e71d563d536d99d59e
---

 NEWS                                  |    2 +-
 include/vlc/libvlc_media_discoverer.h |   29 +++++++++++++++--------------
 lib/libvlc.sym                        |    4 ++--
 lib/media_discoverer.c                |   18 +++++++++---------
 4 files changed, 27 insertions(+), 26 deletions(-)

diff --git a/NEWS b/NEWS
index 29845ba..4bed4c6 100644
--- a/NEWS
+++ b/NEWS
@@ -185,7 +185,7 @@ libVLC:
  * Add a new libvlc dialog API to forward dialogs requests to the applications:
    libvlc_dialog_set_context, libvlc_dialog_get_context, libvlc_dialog_set_callbacks,
    libvlc_dialog_dismiss, libvlc_dialog_post_action, libvlc_dialog_post_login
- * Add libvlc_media_discoverer_services_get to return a list of media discoverer services
+ * Add libvlc_media_discoverer_list_get|release to list the media discoverers
 
 Logging
  * Support for the SystemD Journal
diff --git a/include/vlc/libvlc_media_discoverer.h b/include/vlc/libvlc_media_discoverer.h
index 170da95..7b7cc29 100644
--- a/include/vlc/libvlc_media_discoverer.h
+++ b/include/vlc/libvlc_media_discoverer.h
@@ -31,8 +31,8 @@ extern "C" {
 # endif
 
 /**
- * Category of a media discoverer service
- * \see libvlc_media_discoverer_services_get()
+ * Category of a media discoverer
+ * \see libvlc_media_discoverer_list_get()
  */
 typedef enum {
     /** devices, like portable music player */
@@ -46,14 +46,14 @@ typedef enum {
 } libvlc_media_discoverer_category;
 
 /**
- * Media discoverer service
- * \see libvlc_media_discoverer_services_get()
+ * Media discoverer description
+ * \see libvlc_media_discoverer_list_get()
  */
 typedef struct {
     char *psz_name;
     char *psz_longname;
     libvlc_media_discoverer_category i_cat;
-} libvlc_media_discoverer_service;
+} libvlc_media_discoverer_description;
 
 /** \defgroup libvlc_media_discoverer LibVLC media discovery
  * \ingroup libvlc
@@ -92,7 +92,8 @@ libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
  * \see libvlc_media_discoverer_start
  *
  * \param p_inst libvlc instance
- * \param psz_name service name
+ * \param psz_name service name; use libvlc_media_discoverer_list_get() to get
+ * a list of the discoverer names available in this libVLC instance
  * \return media discover object or NULL in case of error
  * \version LibVLC 3.0.0 or later
  */
@@ -104,7 +105,7 @@ libvlc_media_discoverer_new( libvlc_instance_t * p_inst,
  * Start media discovery.
  *
  * To stop it, call libvlc_media_discoverer_stop() or
- * libvlc_media_discoverer_release() directly.
+ * libvlc_media_discoverer_list_release() directly.
  *
  * \see libvlc_media_discoverer_stop
  *
@@ -178,29 +179,29 @@ LIBVLC_API int
  * \param p_inst libvlc instance
  * \param i_cat category of services to fetch
  * \param ppp_services address to store an allocated array of media discoverer
- * services (must be freed with libvlc_media_discoverer_services_release() by
+ * services (must be freed with libvlc_media_discoverer_list_release() by
  * the caller) [OUT]
  *
  * \return the number of media discoverer services (zero on error)
  */
 LIBVLC_API unsigned int
-libvlc_media_discoverer_services_get( libvlc_instance_t *p_inst,
-                                      libvlc_media_discoverer_category i_cat,
-                                      libvlc_media_discoverer_service ***ppp_services );
+libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
+                                  libvlc_media_discoverer_category i_cat,
+                                  libvlc_media_discoverer_description ***ppp_services );
 
 /**
  * Release an array of media discoverer services
  *
  * \version LibVLC 3.0.0 and later.
  *
- * \see libvlc_media_discoverer_services_get()
+ * \see libvlc_media_discoverer_list_get()
  *
  * \param pp_services array to release
  * \param i_count number of elements in the array
  */
 LIBVLC_API void
-libvlc_media_discoverer_services_release( libvlc_media_discoverer_service **pp_services,
-                                          unsigned int i_count );
+libvlc_media_discoverer_list_release( libvlc_media_discoverer_description **pp_services,
+                                      unsigned int i_count );
 
 /**@} */
 
diff --git a/lib/libvlc.sym b/lib/libvlc.sym
index c7c2ba4..03e9a5e 100644
--- a/lib/libvlc.sym
+++ b/lib/libvlc.sym
@@ -84,8 +84,8 @@ libvlc_media_discoverer_media_list
 libvlc_media_discoverer_new
 libvlc_media_discoverer_new_from_name
 libvlc_media_discoverer_release
-libvlc_media_discoverer_services_get
-libvlc_media_discoverer_services_release
+libvlc_media_discoverer_list_get
+libvlc_media_discoverer_list_release
 libvlc_media_discoverer_start
 libvlc_media_discoverer_stop
 libvlc_media_duplicate
diff --git a/lib/media_discoverer.c b/lib/media_discoverer.c
index b64c452..d65fea9 100644
--- a/lib/media_discoverer.c
+++ b/lib/media_discoverer.c
@@ -387,8 +387,8 @@ libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis )
 }
 
 void
-libvlc_media_discoverer_services_release( libvlc_media_discoverer_service **pp_services,
-                                          unsigned int i_count )
+libvlc_media_discoverer_list_release( libvlc_media_discoverer_description **pp_services,
+                                      unsigned int i_count )
 {
     if( i_count > 0 )
     {
@@ -403,9 +403,9 @@ libvlc_media_discoverer_services_release( libvlc_media_discoverer_service **pp_s
 }
 
 unsigned int
-libvlc_media_discoverer_services_get( libvlc_instance_t *p_inst,
-                                      libvlc_media_discoverer_category i_cat,
-                                      libvlc_media_discoverer_service ***ppp_services )
+libvlc_media_discoverer_list_get( libvlc_instance_t *p_inst,
+                                  libvlc_media_discoverer_category i_cat,
+                                  libvlc_media_discoverer_description ***ppp_services )
 {
     assert( p_inst != NULL && ppp_services != NULL );
 
@@ -452,7 +452,7 @@ libvlc_media_discoverer_services_get( libvlc_instance_t *p_inst,
             i_nb_services++;
     }
 
-    libvlc_media_discoverer_service **pp_services = NULL, *p_services = NULL;
+    libvlc_media_discoverer_description **pp_services = NULL, *p_services = NULL;
     if( i_nb_services > 0 )
     {
         /* Double alloc here, so that the caller iterates through pointers of
@@ -460,9 +460,9 @@ libvlc_media_discoverer_services_get( libvlc_instance_t *p_inst,
          * without breaking the API. */
 
         pp_services = malloc( i_nb_services
-                              * sizeof(libvlc_media_discoverer_service *) );
+                              * sizeof(libvlc_media_discoverer_description *) );
         p_services = malloc( i_nb_services
-                             * sizeof(libvlc_media_discoverer_service) );
+                             * sizeof(libvlc_media_discoverer_description) );
         if( pp_services == NULL || p_services == NULL )
         {
             free( pp_services );
@@ -480,7 +480,7 @@ libvlc_media_discoverer_services_get( libvlc_instance_t *p_inst,
     ppsz_name = ppsz_names;
     p_category = p_categories;
     unsigned int i_service_idx = 0;
-    libvlc_media_discoverer_service *p_service = p_services;
+    libvlc_media_discoverer_description *p_service = p_services;
     for( ; *ppsz_name != NULL; ppsz_name++, ppsz_longname++, p_category++,
             p_service++ )
     {



More information about the vlc-commits mailing list