VLC 4.0.0-dev
Collaboration diagram for Player instance:

Data Structures

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

Typedefs

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

Enumerations

enum  vlc_player_lock_type { VLC_PLAYER_LOCK_NORMAL , VLC_PLAYER_LOCK_REENTRANT }
 Player lock type (normal or reentrant) More...
 
enum  vlc_player_media_stopped_action { VLC_PLAYER_MEDIA_STOPPED_CONTINUE , VLC_PLAYER_MEDIA_STOPPED_PAUSE , VLC_PLAYER_MEDIA_STOPPED_STOP , VLC_PLAYER_MEDIA_STOPPED_EXIT }
 Action when the player is stopped. More...
 

Functions

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...
 
void vlc_player_Delete (vlc_player_t *player)
 Delete a player instance. More...
 
void vlc_player_Lock (vlc_player_t *player)
 Lock the player. More...
 
void vlc_player_Unlock (vlc_player_t *player)
 Unlock the player. More...
 
void vlc_player_CondWait (vlc_player_t *player, vlc_cond_t *cond)
 Wait on a condition variable. More...
 
void vlc_player_SetMediaStoppedAction (vlc_player_t *player, enum vlc_player_media_stopped_action action)
 Setup an action when a media is stopped. More...
 
void vlc_player_SetStartPaused (vlc_player_t *player, bool start_paused)
 Ask to start in a paused state. More...
 
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)

Enumerator
VLC_PLAYER_LOCK_NORMAL 

Normal lock.

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

VLC_PLAYER_LOCK_REENTRANT 

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
vlc_player_SetMediaStoppedAction()
Enumerator
VLC_PLAYER_MEDIA_STOPPED_CONTINUE 

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

VLC_PLAYER_MEDIA_STOPPED_PAUSE 

Pause when reaching the end of file.

VLC_PLAYER_MEDIA_STOPPED_STOP 

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

VLC_PLAYER_MEDIA_STOPPED_EXIT 

Exit VLC.

Function Documentation

◆ vlc_player_CondWait()

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.

Parameters
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_player_Lock()

◆ vlc_player_New()

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.

Parameters
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
Returns
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_t::eos_burst_count, vlc_player_input::error, 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, vlc_player_t::last_eos, 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_TICK_INVALID, 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()

void vlc_player_SetMediaStoppedAction ( vlc_player_t player,
enum vlc_player_media_stopped_action  action 
)

Setup an action when a media is stopped.

Parameters
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()

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
vlc_player_cbs.on_cork_changed
Parameters
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()

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()

Parameters
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()