VLC 4.0.0-dev
LibVLC renderer discoverer

LibVLC renderer discoverer finds available renderers available on the local network. More...

Collaboration diagram for LibVLC renderer discoverer:

Files

file  libvlc_renderer_discoverer.h
 LibVLC renderer discoverer external API.
 

Data Structures

struct  libvlc_rd_description_t
 Renderer discoverer description. More...
 

Macros

#define LIBVLC_RENDERER_CAN_AUDIO   0x0001
 The renderer can render audio. More...
 
#define LIBVLC_RENDERER_CAN_VIDEO   0x0002
 The renderer can render video. More...
 

Typedefs

typedef struct libvlc_renderer_discoverer_t libvlc_renderer_discoverer_t
 
typedef struct libvlc_rd_description_t libvlc_rd_description_t
 Renderer discoverer description. More...
 
typedef struct libvlc_renderer_item_t libvlc_renderer_item_t
 Renderer item. More...
 

Functions

LIBVLC_API libvlc_renderer_item_tlibvlc_renderer_item_hold (libvlc_renderer_item_t *p_item)
 Hold a renderer item, i.e. More...
 
LIBVLC_API void libvlc_renderer_item_release (libvlc_renderer_item_t *p_item)
 Releases a renderer item, i.e. More...
 
LIBVLC_API const char * libvlc_renderer_item_name (const libvlc_renderer_item_t *p_item)
 Get the human readable name of a renderer item. More...
 
LIBVLC_API const char * libvlc_renderer_item_type (const libvlc_renderer_item_t *p_item)
 Get the type (not translated) of a renderer item. More...
 
LIBVLC_API const char * libvlc_renderer_item_icon_uri (const libvlc_renderer_item_t *p_item)
 Get the icon uri of a renderer item. More...
 
LIBVLC_API int libvlc_renderer_item_flags (const libvlc_renderer_item_t *p_item)
 Get the flags of a renderer item. More...
 
LIBVLC_API libvlc_renderer_discoverer_tlibvlc_renderer_discoverer_new (libvlc_instance_t *p_inst, const char *psz_name)
 Create a renderer discoverer object by name. More...
 
LIBVLC_API void libvlc_renderer_discoverer_release (libvlc_renderer_discoverer_t *p_rd)
 Release a renderer discoverer object. More...
 
LIBVLC_API int libvlc_renderer_discoverer_start (libvlc_renderer_discoverer_t *p_rd)
 Start renderer discovery. More...
 
LIBVLC_API void libvlc_renderer_discoverer_stop (libvlc_renderer_discoverer_t *p_rd)
 Stop renderer discovery. More...
 
LIBVLC_API libvlc_event_manager_tlibvlc_renderer_discoverer_event_manager (libvlc_renderer_discoverer_t *p_rd)
 Get the event manager of the renderer discoverer. More...
 
LIBVLC_API size_t libvlc_renderer_discoverer_list_get (libvlc_instance_t *p_inst, libvlc_rd_description_t ***ppp_services)
 Get media discoverer services. More...
 
LIBVLC_API void libvlc_renderer_discoverer_list_release (libvlc_rd_description_t **pp_services, size_t i_count)
 Release an array of media discoverer services. More...
 

Detailed Description

LibVLC renderer discoverer finds available renderers available on the local network.

Macro Definition Documentation

◆ LIBVLC_RENDERER_CAN_AUDIO

#define LIBVLC_RENDERER_CAN_AUDIO   0x0001

The renderer can render audio.

◆ LIBVLC_RENDERER_CAN_VIDEO

#define LIBVLC_RENDERER_CAN_VIDEO   0x0002

The renderer can render video.

Typedef Documentation

◆ libvlc_rd_description_t

Renderer discoverer description.

See also
libvlc_renderer_discoverer_list_get()

◆ libvlc_renderer_discoverer_t

◆ libvlc_renderer_item_t

Renderer item.

This struct is passed by a libvlc_event_t when a new renderer is added or deleted.

An item is valid until the libvlc_RendererDiscovererItemDeleted event is called with the same pointer.

See also
libvlc_renderer_discoverer_event_manager()

Function Documentation

◆ libvlc_renderer_discoverer_event_manager()

LIBVLC_API libvlc_event_manager_t * libvlc_renderer_discoverer_event_manager ( libvlc_renderer_discoverer_t p_rd)

Get the event manager of the renderer discoverer.

The possible events to attach are libvlc_RendererDiscovererItemAdded and libvlc_RendererDiscovererItemDeleted.

The libvlc_renderer_item_t struct passed to event callbacks is owned by VLC, users should take care of holding/releasing this struct for their internal usage.

See also
libvlc_event_t.u.renderer_discoverer_item_added.item
libvlc_event_t.u.renderer_discoverer_item_removed.item
Version
LibVLC 3.0.0 or later
Returns
a valid event manager (can't fail)

◆ libvlc_renderer_discoverer_list_get()

LIBVLC_API size_t libvlc_renderer_discoverer_list_get ( libvlc_instance_t p_inst,
libvlc_rd_description_t ***  ppp_services 
)

Get media discoverer services.

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

◆ libvlc_renderer_discoverer_list_release()

LIBVLC_API void libvlc_renderer_discoverer_list_release ( libvlc_rd_description_t **  pp_services,
size_t  i_count 
)

Release an array of media discoverer services.

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

◆ libvlc_renderer_discoverer_new()

LIBVLC_API libvlc_renderer_discoverer_t * libvlc_renderer_discoverer_new ( libvlc_instance_t p_inst,
const char *  psz_name 
)

Create a renderer discoverer object by name.

After this object is created, you should attach to events in order to be notified of the discoverer events.

You need to call libvlc_renderer_discoverer_start() in order to start the discovery.

See also
libvlc_renderer_discoverer_event_manager()
libvlc_renderer_discoverer_start()
Version
LibVLC 3.0.0 or later
Parameters
p_instlibvlc instance
psz_nameservice name; use libvlc_renderer_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

◆ libvlc_renderer_discoverer_release()

LIBVLC_API void libvlc_renderer_discoverer_release ( libvlc_renderer_discoverer_t p_rd)

Release a renderer discoverer object.

Version
LibVLC 3.0.0 or later
Parameters
p_rdrenderer discoverer object

◆ libvlc_renderer_discoverer_start()

LIBVLC_API int libvlc_renderer_discoverer_start ( libvlc_renderer_discoverer_t p_rd)

Start renderer discovery.

To stop it, call libvlc_renderer_discoverer_stop() or libvlc_renderer_discoverer_release() directly.

See also
libvlc_renderer_discoverer_stop()
Version
LibVLC 3.0.0 or later
Parameters
p_rdrenderer discoverer object
Returns
-1 in case of error, 0 otherwise

◆ libvlc_renderer_discoverer_stop()

LIBVLC_API void libvlc_renderer_discoverer_stop ( libvlc_renderer_discoverer_t p_rd)

Stop renderer discovery.

See also
libvlc_renderer_discoverer_start()
Version
LibVLC 3.0.0 or later
Parameters
p_rdrenderer discoverer object

◆ libvlc_renderer_item_flags()

LIBVLC_API int libvlc_renderer_item_flags ( const libvlc_renderer_item_t p_item)

Get the flags of a renderer item.

See also
LIBVLC_RENDERER_CAN_AUDIO
LIBVLC_RENDERER_CAN_VIDEO
Version
LibVLC 3.0.0 or later
Returns
bitwise flag: capabilities of the renderer, see

◆ libvlc_renderer_item_hold()

LIBVLC_API libvlc_renderer_item_t * libvlc_renderer_item_hold ( libvlc_renderer_item_t p_item)

Hold a renderer item, i.e.

creates a new reference

This functions need to called from the libvlc_RendererDiscovererItemAdded callback if the libvlc user wants to use this item after. (for display or for passing it to the mediaplayer for example).

Version
LibVLC 3.0.0 or later
Returns
the current item

◆ libvlc_renderer_item_icon_uri()

LIBVLC_API const char * libvlc_renderer_item_icon_uri ( const libvlc_renderer_item_t p_item)

Get the icon uri of a renderer item.

Version
LibVLC 3.0.0 or later
Returns
the uri of the item's icon (can be NULL, must not be freed)

◆ libvlc_renderer_item_name()

LIBVLC_API const char * libvlc_renderer_item_name ( const libvlc_renderer_item_t p_item)

Get the human readable name of a renderer item.

Version
LibVLC 3.0.0 or later
Returns
the name of the item (can't be NULL, must not be freed)

◆ libvlc_renderer_item_release()

LIBVLC_API void libvlc_renderer_item_release ( libvlc_renderer_item_t p_item)

Releases a renderer item, i.e.

decrements its reference counter

Version
LibVLC 3.0.0 or later

◆ libvlc_renderer_item_type()

LIBVLC_API const char * libvlc_renderer_item_type ( const libvlc_renderer_item_t p_item)

Get the type (not translated) of a renderer item.

For now, the type can only be "chromecast" ("upnp", "airplay" may come later).

Version
LibVLC 3.0.0 or later
Returns
the type of the item (can't be NULL, must not be freed)