VLC 4.0.0-dev
LibVLC media discovery

LibVLC media discovery finds available media via various means. More...

Collaboration diagram for LibVLC media discovery:

Files

file  libvlc_media_discoverer.h
 LibVLC media discovery external API.
 

Typedefs

typedef struct libvlc_media_discoverer_t libvlc_media_discoverer_t
 

Functions

LIBVLC_API libvlc_media_discoverer_tlibvlc_media_discoverer_new (libvlc_instance_t *p_inst, const char *psz_name)
 Create a media discoverer object by name. More...
 
LIBVLC_API int libvlc_media_discoverer_start (libvlc_media_discoverer_t *p_mdis)
 Start media discovery. More...
 
LIBVLC_API void libvlc_media_discoverer_stop (libvlc_media_discoverer_t *p_mdis)
 Stop media discovery. More...
 
LIBVLC_API void libvlc_media_discoverer_release (libvlc_media_discoverer_t *p_mdis)
 Release media discover object. More...
 
LIBVLC_API libvlc_media_list_tlibvlc_media_discoverer_media_list (libvlc_media_discoverer_t *p_mdis)
 Get media service discover media list. More...
 
LIBVLC_API bool libvlc_media_discoverer_is_running (libvlc_media_discoverer_t *p_mdis)
 Query if media service discover object is running. More...
 
LIBVLC_API size_t libvlc_media_discoverer_list_get (libvlc_instance_t *p_inst, libvlc_media_discoverer_category_t i_cat, libvlc_media_discoverer_description_t ***ppp_services)
 Get media discoverer services by category. More...
 
LIBVLC_API void libvlc_media_discoverer_list_release (libvlc_media_discoverer_description_t **pp_services, size_t i_count)
 Release an array of media discoverer services. More...
 

Detailed Description

LibVLC media discovery finds available media via various means.

This corresponds to the service discovery functionality in VLC media player. Different plugins find potential medias locally (e.g. user media directory), from peripherals (e.g. video capture device), on the local network (e.g. SAP) or on the Internet (e.g. Internet radios).

Typedef Documentation

◆ libvlc_media_discoverer_t

Function Documentation

◆ libvlc_media_discoverer_is_running()

LIBVLC_API bool libvlc_media_discoverer_is_running ( libvlc_media_discoverer_t p_mdis)

Query if media service discover object is running.

Parameters
p_mdismedia service discover object
Return values
truerunning
falsenot running

◆ libvlc_media_discoverer_list_get()

LIBVLC_API size_t libvlc_media_discoverer_list_get ( libvlc_instance_t p_inst,
libvlc_media_discoverer_category_t  i_cat,
libvlc_media_discoverer_description_t ***  ppp_services 
)

Get media discoverer services by category.

Version
LibVLC 3.0.0 and later.
Parameters
p_instlibvlc instance
i_catcategory of services to fetch
ppp_servicesaddress to store an allocated array of media discoverer services (must be freed with libvlc_media_discoverer_list_release() by the caller) [OUT]
Returns
the number of media discoverer services (0 on error)

◆ libvlc_media_discoverer_list_release()

LIBVLC_API void libvlc_media_discoverer_list_release ( libvlc_media_discoverer_description_t **  pp_services,
size_t  i_count 
)

Release an array of media discoverer services.

Version
LibVLC 3.0.0 and later.
See also
libvlc_media_discoverer_list_get()
Parameters
pp_servicesarray to release
i_countnumber of elements in the array

◆ libvlc_media_discoverer_media_list()

LIBVLC_API libvlc_media_list_t * libvlc_media_discoverer_media_list ( libvlc_media_discoverer_t p_mdis)

Get media service discover media list.

Parameters
p_mdismedia service discover object
Returns
list of media items

◆ libvlc_media_discoverer_new()

LIBVLC_API libvlc_media_discoverer_t * libvlc_media_discoverer_new ( 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 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 also
libvlc_media_discoverer_media_list
libvlc_media_discoverer_start
Parameters
p_instlibvlc instance
psz_nameservice name; use libvlc_media_discoverer_list_get() to get a list of the discoverer names available in this libVLC instance
Returns
media discover object or NULL in case of error
Version
LibVLC 3.0.0 or later

◆ libvlc_media_discoverer_release()

LIBVLC_API void libvlc_media_discoverer_release ( libvlc_media_discoverer_t p_mdis)

Release media discover object.

If the reference count reaches 0, then the object will be released.

Parameters
p_mdismedia service discover object

◆ libvlc_media_discoverer_start()

LIBVLC_API int libvlc_media_discoverer_start ( libvlc_media_discoverer_t p_mdis)

Start media discovery.

To stop it, call libvlc_media_discoverer_stop() or libvlc_media_discoverer_list_release() directly.

See also
libvlc_media_discoverer_stop
Parameters
p_mdismedia discover object
Returns
-1 in case of error, 0 otherwise
Version
LibVLC 3.0.0 or later

◆ libvlc_media_discoverer_stop()

LIBVLC_API void libvlc_media_discoverer_stop ( libvlc_media_discoverer_t p_mdis)

Stop media discovery.

See also
libvlc_media_discoverer_start
Parameters
p_mdismedia discover object
Version
LibVLC 3.0.0 or later