VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Player events:

Data Structures

struct  vlc_player_cbs
 Player callbacks. More...
 

Typedefs

typedef struct vlc_player_listener_id vlc_player_listener_id
 Player listener opaque structure.
 

Enumerations

enum  vlc_player_list_action { VLC_PLAYER_LIST_ADDED , VLC_PLAYER_LIST_REMOVED , VLC_PLAYER_LIST_UPDATED }
 Action of vlc_player_cbs.on_track_list_changed, vlc_player_cbs.on_program_list_changed callbacks. More...
 

Functions

vlc_player_listener_idvlc_player_AddListener (vlc_player_t *player, const struct vlc_player_cbs *cbs, void *cbs_data)
 Add a listener callback.
 
void vlc_player_RemoveListener (vlc_player_t *player, vlc_player_listener_id *listener_id)
 Remove a listener callback.
 

Detailed Description

Typedef Documentation

◆ vlc_player_listener_id

Player listener opaque structure.

This opaque structure is returned by vlc_player_AddListener() and can be used to remove the listener via vlc_player_RemoveListener().

Enumeration Type Documentation

◆ vlc_player_list_action

Action of vlc_player_cbs.on_track_list_changed, vlc_player_cbs.on_program_list_changed callbacks.

Enumerator
VLC_PLAYER_LIST_ADDED 
VLC_PLAYER_LIST_REMOVED 
VLC_PLAYER_LIST_UPDATED 

Function Documentation

◆ vlc_player_AddListener()

vlc_player_listener_id * vlc_player_AddListener ( vlc_player_t player,
const struct vlc_player_cbs cbs,
void *  cbs_data 
)

Add a listener callback.

Note
Every registered callbacks need to be removed by the caller with vlc_player_RemoveListener().
Parameters
playerlocked player instance
cbspointer to a vlc_player_cbs structure, the structure must be valid during the lifetime of the player
cbs_dataopaque pointer used by the callbacks
Returns
a valid listener id, or NULL in case of allocation error

References vlc_player_listener_id::cbs, vlc_player_listener_id::cbs_data, vlc_player_t::listeners, vlc_player_listener_id::node, vlc_player_input::player, vlc_list_append(), and vlc_player_assert_locked().

Referenced by vlc_playlist_PlayerInit(), and vlm_MediaInstanceNew().

◆ vlc_player_RemoveListener()

void vlc_player_RemoveListener ( vlc_player_t player,
vlc_player_listener_id listener_id 
)

Remove a listener callback.

Parameters
playerlocked player instance
listener_idlistener id returned by vlc_player_AddListener()

References vlc_player_listener_id::node, vlc_player_input::player, vlc_list_remove(), and vlc_player_assert_locked().

Referenced by vlc_playlist_PlayerDestroy(), and vlm_MediaInstanceDelete().