]> git.sesse.net Git - vlc/blobdiff - include/vlc/libvlc_media_discoverer.h
mediacodec: don't loop in GetOutput
[vlc] / include / vlc / libvlc_media_discoverer.h
index be1e3c291f38b7d886f872b72e1e5e908f809f78..26268025e8722b913307709b62228c5c31e97a48 100644 (file)
@@ -1,26 +1,26 @@
 /*****************************************************************************
- * libvlc.h:  libvlc external API
+ * libvlc_media_discoverer.h:  libvlc external API
  *****************************************************************************
- * Copyright (C) 1998-2009 the VideoLAN team
+ * Copyright (C) 1998-2009 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
  *          Jean-Paul Saman <jpsaman@videolan.org>
  *          Pierre d'Herbemont <pdherbemont@videolan.org>
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 /**
@@ -48,15 +48,61 @@ extern "C" {
 typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t;
 
 /**
- * Discover media service by name.
+ * \deprecated Use libvlc_media_discoverer_new() and libvlc_media_discoverer_start().
+ */
+LIBVLC_DEPRECATED LIBVLC_API libvlc_media_discoverer_t *
+libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
+                                       const char * psz_name );
+
+/**
+ * Create a media discoverer object by name.
+ *
+ * After this object is created, you should attach to events in order to be
+ * notified of the discoverer state.
+ * You should also attach to media_list events in order to be notified of new
+ * items discovered.
+ *
+ * You need to call libvlc_media_discoverer_start() in order to start the
+ * discovery.
+ *
+ * \see libvlc_media_discoverer_media_list
+ * \see libvlc_media_discoverer_event_manager
+ * \see libvlc_media_discoverer_start
  *
  * \param p_inst libvlc instance
  * \param psz_name service name
  * \return media discover object or NULL in case of error
+ * \version LibVLC 3.0.0 or later
  */
 LIBVLC_API libvlc_media_discoverer_t *
-libvlc_media_discoverer_new_from_name( libvlc_instance_t * p_inst,
-                                       const char * psz_name );
+libvlc_media_discoverer_new( libvlc_instance_t * p_inst,
+                             const char * psz_name );
+
+/**
+ * Start media discovery.
+ *
+ * To stop it, call libvlc_media_discoverer_stop() or
+ * libvlc_media_discoverer_release() directly.
+ *
+ * \see libvlc_media_discoverer_stop
+ *
+ * \param p_mdis media discover object
+ * \return -1 in case of error, 0 otherwise
+ * \version LibVLC 3.0.0 or later
+ */
+LIBVLC_API int
+libvlc_media_discoverer_start( libvlc_media_discoverer_t * p_mdis );
+
+/**
+ * Stop media discovery.
+ *
+ * \see libvlc_media_discoverer_start
+ *
+ * \param p_mdis media discover object
+ * \version LibVLC 3.0.0 or later
+ */
+LIBVLC_API void
+libvlc_media_discoverer_stop( libvlc_media_discoverer_t * p_mdis );
 
 /**
  * Release media discover object. If the reference count reaches 0, then
@@ -96,6 +142,8 @@ LIBVLC_API libvlc_event_manager_t *
  *
  * \param p_mdis media service discover object
  * \return true if running, false if not
+ *
+ * \libvlc_return_bool
  */
 LIBVLC_API int
         libvlc_media_discoverer_is_running( libvlc_media_discoverer_t * p_mdis );