VLC 4.0.0-dev
|
Typedefs | |
typedef struct vlc_player_t | vlc_player_t |
Player opaque structure. | |
Enumerations | |
enum | vlc_player_lock_type { VLC_PLAYER_LOCK_NORMAL , VLC_PLAYER_LOCK_REENTRANT } |
Player lock type (normal or reentrant) More... | |
Functions | |
vlc_player_t * | vlc_player_New (vlc_object_t *parent, enum vlc_player_lock_type lock_type) |
Create a new player instance. | |
void | vlc_player_Delete (vlc_player_t *player) |
Delete a player instance. | |
void | vlc_player_Lock (vlc_player_t *player) |
Lock the player. | |
void | vlc_player_Unlock (vlc_player_t *player) |
Unlock the player. | |
void | vlc_player_CondWait (vlc_player_t *player, vlc_cond_t *cond) |
Wait on a condition variable. | |
void | vlc_player_SetStartPaused (vlc_player_t *player, bool start_paused) |
Ask to start in a paused state. | |
void | vlc_player_SetPauseOnCork (vlc_player_t *player, bool enabled) |
Enable or disable pause on cork event. | |
typedef struct vlc_player_t vlc_player_t |
Player opaque structure.
enum 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. |
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.
player | locked player instance |
cond | external condition |
References vlc_player_t::lock, vlc_player_input::player, vlc_cond_wait(), and vlc_player_assert_locked().
void vlc_player_Delete | ( | vlc_player_t * | player | ) |
Delete a player instance.
This function stop any playback previously started and wait for their termination.
player | unlocked player instance created by vlc_player_New() |
References vlc_player_t::aout_listeners, vlc_player_t::audio_string_ids, vlc_player_t::deleting, vlc_player_t::destructor, vlc_player_t::input, input_item_Release(), input_resource_Release(), vlc_player_t::listeners, vlc_player_t::lock, vlc_player_t::media, vlc_player_t::metadata_listeners, vlc_player_t::next_media, vlc_player_input::player, vlc_player_t::renderer, vlc_player_t::resource, vlc_player_t::sub_string_ids, vlc_player_t::thread, var_DelCallback(), var_Destroy(), var_GetAddress(), vlc_player_t::video_string_ids, vlc_cond_signal(), vlc_http_cookies_destroy(), vlc_join(), vlc_list_is_empty(), vlc_mutex_held(), vlc_mutex_lock(), vlc_mutex_unlock(), vlc_object_delete, vlc_player_aout_Deinit(), vlc_player_CorkCallback(), vlc_player_DestroyTimer(), vlc_player_destructor_AddInput(), vlc_renderer_item_release(), vlc_player_t::vout_listeners, and vlc_player_t::wait.
Referenced by vlc_playlist_PlayerDestroy(), vlc_playlist_PlayerInit(), vlm_MediaInstanceDelete(), and vlm_MediaInstanceNew().
void vlc_player_Lock | ( | vlc_player_t * | player | ) |
Lock the player.
All player functions (except vlc_player_Delete()) need to be called while the player lock is held.
player | unlocked player instance |
References vlc_player_t::aout_listeners_lock, vlc_player_timer::lock, vlc_player_t::lock, vlc_player_t::metadata_listeners_lock, vlc_player_input::player, vlc_player_t::timer, vlc_mutex_held(), vlc_mutex_lock(), and vlc_player_t::vout_listeners_lock.
Referenced by vlc_player_CorkCallback(), vlc_player_destructor_Thread(), vlc_playlist_Lock(), vlc_playlist_PlayerDestroy(), vlc_playlist_PlayerInit(), vlm_ControlMediaInstanceGets(), vlm_ControlMediaInstanceGetTimePosition(), vlm_ControlMediaInstancePause(), vlm_ControlMediaInstanceSetTimePosition(), vlm_ControlMediaInstanceStart(), vlm_MediaInstanceDelete(), and vlm_MediaInstanceNew().
vlc_player_t * vlc_player_New | ( | vlc_object_t * | parent, |
enum vlc_player_lock_type | lock_type | ||
) |
Create a new player instance.
parent | parent VLC object |
lock_type | whether the player lock is reentrant or not |
media_provider | pointer to a media_provider structure or NULL, the structure must be valid during the lifetime of the player |
media_provider_data | opaque data used by provider callbacks |
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_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::metadata_listeners, vlc_player_t::next_media, 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_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().
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.
player | locked player instance |
enabled | true to enable |
References vlc_player_t::pause_on_cork, vlc_player_input::player, and vlc_player_assert_locked().
Referenced by PlaylistConfigureFromVariables().
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()
player | locked player instance |
start_paused | true 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().
void vlc_player_Unlock | ( | vlc_player_t * | player | ) |
Unlock the player.
player | locked player instance |
References vlc_player_t::lock, vlc_player_input::player, and vlc_mutex_unlock().
Referenced by vlc_player_CorkCallback(), vlc_player_destructor_Thread(), vlc_playlist_PlayerDestroy(), vlc_playlist_PlayerInit(), vlc_playlist_Unlock(), vlm_ControlMediaInstanceGets(), vlm_ControlMediaInstanceGetTimePosition(), vlm_ControlMediaInstancePause(), vlm_ControlMediaInstanceSetTimePosition(), vlm_ControlMediaInstanceStart(), vlm_MediaInstanceDelete(), and vlm_MediaInstanceNew().