VLC 4.0.0-dev
|
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_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. 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... | |
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. |
Action when the player is stopped.
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 Manage(), 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, | ||
const struct vlc_player_media_provider * | media_provider, | ||
void * | media_provider_data | ||
) |
Create a new player instance.
parent | parent VLC object |
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_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().
void vlc_player_SetMediaStoppedAction | ( | vlc_player_t * | player, |
enum vlc_player_media_stopped_action | action | ||
) |
Setup an action when a media is stopped.
player | locked player instance |
action | action 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().
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 Manage(), 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().