VLC  4.0.0-dev
Data Structures | Typedefs | Enumerations | Functions
Collaboration diagram for Player instance:

Data Structures

struct  vlc_player_media_provider
 Callbacks for the owner of the player. More...


typedef struct vlc_player_t vlc_player_t
 Player opaque structure. More...


 Player lock type (normal or reentrant) More...
 Action when the player is stopped. More...


VLC_EXPORT vlc_player_tvlc_player_New (vlc_object_t *parent, enum vlc_player_lock_type lock_type, const struct vlc_player_media_provider *media_provider, void *media_provider_data)
 Create a new player instance. More...
VLC_EXPORT void vlc_player_Delete (vlc_player_t *player)
 Delete a player instance. More...
VLC_EXPORT void vlc_player_Lock (vlc_player_t *player)
 Lock the player. More...
VLC_EXPORT void vlc_player_Unlock (vlc_player_t *player)
 Unlock the player. More...
VLC_EXPORT void vlc_player_CondWait (vlc_player_t *player, vlc_cond_t *cond)
 Wait on a condition variable. More...
VLC_EXPORT void vlc_player_SetMediaStoppedAction (vlc_player_t *player, enum vlc_player_media_stopped_action action)
 Setup an action when a media is stopped. More...
VLC_EXPORT void vlc_player_SetStartPaused (vlc_player_t *player, bool start_paused)
 Ask to start in a paused state. More...
VLC_EXPORT void vlc_player_SetPauseOnCork (vlc_player_t *player, bool enabled)
 Enable or disable pause on cork event. More...

Detailed Description

Typedef Documentation

◆ vlc_player_t

typedef struct vlc_player_t vlc_player_t

Player opaque structure.

Enumeration Type Documentation

◆ vlc_player_lock_type

Player lock type (normal or reentrant)


Normal lock.

If the player is already locked, subsequent calls to vlc_player_Lock() will deadlock.


Reentrant lock.

If the player is already locked, subsequent calls to vlc_player_Lock() will still succeed. To unlock the player, one call to vlc_player_Unlock() per vlc_player_Lock() is necessary.

◆ vlc_player_media_stopped_action

Action when the player is stopped.

See also

Continue (or stop if there is no next media), default behavior.


Pause when reaching the end of file.


Stop, even if there is a next media to play.


Exit VLC.

Function Documentation

◆ vlc_player_CondWait()

VLC_EXPORT void vlc_player_CondWait ( vlc_player_t player,
vlc_cond_t cond 

Wait on a condition variable.

This call allow users to use their own condition with the player mutex.

playerlocked player instance
condexternal condition

References vlc_player_t::lock, vlc_player_input::player, vlc_cond_wait(), and vlc_player_assert_locked().

◆ vlc_player_Delete()

VLC_EXPORT void vlc_player_Delete ( vlc_player_t player)

◆ vlc_player_Lock()

VLC_EXPORT void vlc_player_Lock ( vlc_player_t player)

◆ vlc_player_New()

VLC_EXPORT vlc_player_t* vlc_player_New ( vlc_object_t parent,
enum vlc_player_lock_type  lock_type,
const struct vlc_player_media_provider media_provider,
void *  media_provider_data 

Create a new player instance.

parentparent VLC object
media_providerpointer to a media_provider structure or NULL, the structure must be valid during the lifetime of the player
media_provider_dataopaque data used by provider callbacks
a pointer to a valid player instance or NULL in case of error

References vlc_player_t::aout_listeners, vlc_player_t::audio_string_ids, vlc_player_t::corked, vlc_player_t::deleting, vlc_player_t::destructor, vlc_player_input::error, vlc_player_t::error_count, vlc_player_media_provider::get_next, vlc_player_t::global_state, vlc_player_t::input, input_resource_New(), input_resource_Release(), vlc_player_t::inputs, vlc_player_t::joinable_inputs, likely, vlc_player_t::listeners, vlc_player_t::media, vlc_player_t::media_provider, vlc_player_t::media_provider_data, vlc_player_t::media_stopped_action, vlc_player_t::metadata_listeners, vlc_player_t::next_media, vlc_player_t::next_media_requested, vlc_value_t::p_address, vlc_player_t::pause_on_cork, vlc_player_input::player, vlc_player_t::releasing_media, vlc_player_t::renderer, vlc_player_t::resource, vlc_player_t::start_paused, vlc_player_t::started, vlc_player_t::stopping_inputs, vlc_player_t::sub_string_ids, vlc_player_t::thread, var_AddCallback(), VAR_CREATE, var_DelCallback(), var_SetChecked(), vlc_player_t::video_string_ids, vlc_clone(), vlc_custom_create, vlc_http_cookies_new(), vlc_list_init(), VLC_OBJECT, vlc_object_delete, vlc_player_aout_Deinit(), vlc_player_aout_Init(), vlc_player_CorkCallback(), vlc_player_DestroyTimer(), vlc_player_destructor_Thread(), vlc_player_InitLocks(), vlc_player_InitTimer(), VLC_PLAYER_MEDIA_STOPPED_CONTINUE, VLC_PLAYER_STATE_STOPPED, VLC_THREAD_PRIORITY_LOW, VLC_VAR_ADDRESS, VLC_VAR_BOOL, VLC_VAR_DOINHERIT, VLC_VAR_FLOAT, VLC_VAR_INTEGER, VLC_VAR_STRING, and vlc_player_t::vout_listeners.

Referenced by vlc_playlist_PlayerInit(), and vlm_MediaInstanceNew().

◆ vlc_player_SetMediaStoppedAction()

VLC_EXPORT void vlc_player_SetMediaStoppedAction ( vlc_player_t player,
enum vlc_player_media_stopped_action  action 

Setup an action when a media is stopped.

playerlocked player instance
actionaction to do when a media is stopped

References vlc_player_t::media_stopped_action, vlc_player_input::player, var_SetBool(), vlc_player_assert_locked(), VLC_PLAYER_MEDIA_STOPPED_PAUSE, and vlc_player_SendEvent.

Referenced by PlaylistConfigureFromVariables().

◆ vlc_player_SetPauseOnCork()

VLC_EXPORT void vlc_player_SetPauseOnCork ( vlc_player_t player,
bool  enabled 

Enable or disable pause on cork event.

If enabled, the player will automatically pause and resume on cork events. In that case, cork events won't be propagated via callbacks.

See also
playerlocked player instance
enabledtrue to enable

References vlc_player_t::pause_on_cork, vlc_player_input::player, and vlc_player_assert_locked().

Referenced by PlaylistConfigureFromVariables().

◆ vlc_player_SetStartPaused()

VLC_EXPORT void vlc_player_SetStartPaused ( vlc_player_t player,
bool  start_paused 

Ask to start in a paused state.

This function can be used before vlc_player_Start()

playerlocked player instance
start_pausedtrue to start in a paused state, false to cancel it

References vlc_player_input::player, vlc_player_t::start_paused, and vlc_player_assert_locked().

Referenced by PlaylistConfigureFromVariables().

◆ vlc_player_Unlock()

VLC_EXPORT void vlc_player_Unlock ( vlc_player_t player)