VLC 4.0.0-dev
Loading...
Searching...
No Matches
Collaboration diagram for Playback control:

Macros

#define VLC_PLAYER_CAP_SEEK   (1<<0)
 Player capability: can seek.
 
#define VLC_PLAYER_CAP_PAUSE   (1<<1)
 Player capability: can pause.
 
#define VLC_PLAYER_CAP_CHANGE_RATE   (1<<2)
 Player capability: can change the rate.
 
#define VLC_PLAYER_CAP_REWIND   (1<<3)
 Player capability: can seek back.
 
#define VLC_PLAYER_TELETEXT_KEY_RED   ('r' << 16)
 Player teletext key: Red.
 
#define VLC_PLAYER_TELETEXT_KEY_GREEN   ('g' << 16)
 Player teletext key: Green.
 
#define VLC_PLAYER_TELETEXT_KEY_YELLOW   ('y' << 16)
 Player teletext key: Yellow.
 
#define VLC_PLAYER_TELETEXT_KEY_BLUE   ('b' << 16)
 Player teletext key: Blue.
 
#define VLC_PLAYER_TELETEXT_KEY_INDEX   ('i' << 16)
 Player teletext key: Index.
 

Enumerations

enum  vlc_player_state {
  VLC_PLAYER_STATE_STOPPED , VLC_PLAYER_STATE_STARTED , VLC_PLAYER_STATE_PLAYING , VLC_PLAYER_STATE_PAUSED ,
  VLC_PLAYER_STATE_STOPPING
}
 State of the player. More...
 
enum  vlc_player_error { VLC_PLAYER_ERROR_NONE , VLC_PLAYER_ERROR_GENERIC }
 Error of the player. More...
 
enum  vlc_player_seek_speed { VLC_PLAYER_SEEK_PRECISE , VLC_PLAYER_SEEK_FAST }
 Seek speed type. More...
 
enum  vlc_player_whence { VLC_PLAYER_WHENCE_ABSOLUTE , VLC_PLAYER_WHENCE_RELATIVE }
 Player seek/delay directive. More...
 
enum  vlc_player_nav {
  VLC_PLAYER_NAV_ACTIVATE , VLC_PLAYER_NAV_UP , VLC_PLAYER_NAV_DOWN , VLC_PLAYER_NAV_LEFT ,
  VLC_PLAYER_NAV_RIGHT , VLC_PLAYER_NAV_POPUP , VLC_PLAYER_NAV_MENU
}
 Menu (VCD/DVD/BD) and viewpoint navigations. More...
 
enum  vlc_player_abloop { VLC_PLAYER_ABLOOP_NONE , VLC_PLAYER_ABLOOP_A , VLC_PLAYER_ABLOOP_B }
 A to B loop state. More...
 
enum  vlc_player_restore_playback_pos { VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER , VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK , VLC_PLAYER_RESTORE_PLAYBACK_POS_ALWAYS }
 

Functions

int vlc_player_SetCurrentMedia (vlc_player_t *player, input_item_t *media)
 Set the current media.
 
void vlc_player_SetNextMedia (vlc_player_t *player, input_item_t *media)
 Set the next media.
 
input_item_tvlc_player_GetCurrentMedia (vlc_player_t *player)
 Get the current played media.
 
input_item_tvlc_player_GetNextMedia (vlc_player_t *player)
 Get the next played media.
 
static input_item_tvlc_player_HoldCurrentMedia (vlc_player_t *player)
 Helper that hold the current media.
 
int vlc_player_Start (vlc_player_t *player)
 Start the playback of the current media.
 
int vlc_player_Stop (vlc_player_t *player)
 Stop the playback of the current media.
 
void vlc_player_Pause (vlc_player_t *player)
 Pause the playback.
 
void vlc_player_Resume (vlc_player_t *player)
 Resume the playback from a pause.
 
void vlc_player_NextVideoFrame (vlc_player_t *player)
 Pause and display the next video frame.
 
enum vlc_player_state vlc_player_GetState (vlc_player_t *player)
 Get the state of the player.
 
enum vlc_player_error vlc_player_GetError (vlc_player_t *player)
 Get the error state of the player.
 
static bool vlc_player_IsStarted (vlc_player_t *player)
 Helper to get the started state.
 
static bool vlc_player_IsPaused (vlc_player_t *player)
 Helper to get the paused state.
 
static void vlc_player_TogglePause (vlc_player_t *player)
 Helper to toggle the pause state.
 
int vlc_player_GetCapabilities (vlc_player_t *player)
 Get the player capabilities.
 
static bool vlc_player_CanSeek (vlc_player_t *player)
 Helper to get the seek capability.
 
static bool vlc_player_CanPause (vlc_player_t *player)
 Helper to get the pause capability.
 
static bool vlc_player_CanChangeRate (vlc_player_t *player)
 Helper to get the change-rate capability.
 
static bool vlc_player_CanRewind (vlc_player_t *player)
 Helper to get the rewindable capability.
 
float vlc_player_GetRate (vlc_player_t *player)
 Get the rate of the player.
 
void vlc_player_ChangeRate (vlc_player_t *player, float rate)
 Change the rate of the player.
 
void vlc_player_IncrementRate (vlc_player_t *player)
 Increment the rate of the player (faster)
 
void vlc_player_DecrementRate (vlc_player_t *player)
 Decrement the rate of the player (Slower)
 
vlc_tick_t vlc_player_GetLength (vlc_player_t *player)
 Get the length of the current media.
 
vlc_tick_t vlc_player_GetTime (vlc_player_t *player)
 Get the time of the current media.
 
double vlc_player_GetPosition (vlc_player_t *player)
 Get the position of the current media.
 
void vlc_player_SeekByPos (vlc_player_t *player, double position, enum vlc_player_seek_speed speed, enum vlc_player_whence whence)
 Seek the current media by position.
 
void vlc_player_SeekByTime (vlc_player_t *player, vlc_tick_t time, enum vlc_player_seek_speed speed, enum vlc_player_whence whence)
 Seek the current media by time.
 
static void vlc_player_SetPosition (vlc_player_t *player, double position)
 Helper to set the absolute position precisely.
 
static void vlc_player_SetPositionFast (vlc_player_t *player, double position)
 Helper to set the absolute position fast.
 
static void vlc_player_JumpPos (vlc_player_t *player, double jumppos)
 Helper to jump the position precisely.
 
static void vlc_player_SetTime (vlc_player_t *player, vlc_tick_t time)
 Helper to set the absolute time precisely.
 
static void vlc_player_SetTimeFast (vlc_player_t *player, vlc_tick_t time)
 Helper to set the absolute time fast.
 
static void vlc_player_JumpTime (vlc_player_t *player, vlc_tick_t jumptime)
 Helper to jump the time precisely.
 
void vlc_player_DisplayPosition (vlc_player_t *player)
 Display the player position on the vout OSD.
 
int vlc_player_SetAtoBLoop (vlc_player_t *player, enum vlc_player_abloop abloop)
 Enable A to B loop of the current media.
 
enum vlc_player_abloop vlc_player_GetAtoBLoop (vlc_player_t *player, vlc_tick_t *a_time, double *a_pos, vlc_tick_t *b_time, double *b_pos)
 Get the A to B loop status.
 
void vlc_player_Navigate (vlc_player_t *player, enum vlc_player_nav nav)
 Navigate (for DVD/Bluray menus or viewpoint)
 
void vlc_player_UpdateViewpoint (vlc_player_t *player, const vlc_viewpoint_t *viewpoint, enum vlc_player_whence whence)
 Update the viewpoint.
 
bool vlc_player_IsRecording (vlc_player_t *player)
 Check if the playing is recording.
 
void vlc_player_SetRecordingEnabled (vlc_player_t *player, bool enabled, const char *dir_path)
 Enable or disable recording for the current media.
 
static void vlc_player_ToggleRecording (vlc_player_t *player)
 Helper to toggle the recording state.
 
int vlc_player_AddAssociatedMedia (vlc_player_t *player, enum es_format_category_e cat, const char *uri, bool select, bool notify, bool check_ext)
 Add an associated (or external) media to the current media.
 
int vlc_player_GetSignal (vlc_player_t *player, float *quality, float *strength)
 Get the signal quality and strength of the current media.
 
const struct input_stats_tvlc_player_GetStatistics (vlc_player_t *player)
 Get the statistics of the current media.
 
void vlc_player_RestorePlaybackPos (vlc_player_t *player)
 Restore the previous playback position of the current media.
 
vlc_object_tvlc_player_GetV4l2Object (vlc_player_t *player)
 Get the V4L2 object used to do controls.
 

Detailed Description

Macro Definition Documentation

◆ VLC_PLAYER_CAP_CHANGE_RATE

#define VLC_PLAYER_CAP_CHANGE_RATE   (1<<2)

Player capability: can change the rate.

◆ VLC_PLAYER_CAP_PAUSE

#define VLC_PLAYER_CAP_PAUSE   (1<<1)

Player capability: can pause.

◆ VLC_PLAYER_CAP_REWIND

#define VLC_PLAYER_CAP_REWIND   (1<<3)

Player capability: can seek back.

◆ VLC_PLAYER_CAP_SEEK

#define VLC_PLAYER_CAP_SEEK   (1<<0)

Player capability: can seek.

◆ VLC_PLAYER_TELETEXT_KEY_BLUE

#define VLC_PLAYER_TELETEXT_KEY_BLUE   ('b' << 16)

Player teletext key: Blue.

◆ VLC_PLAYER_TELETEXT_KEY_GREEN

#define VLC_PLAYER_TELETEXT_KEY_GREEN   ('g' << 16)

Player teletext key: Green.

◆ VLC_PLAYER_TELETEXT_KEY_INDEX

#define VLC_PLAYER_TELETEXT_KEY_INDEX   ('i' << 16)

Player teletext key: Index.

◆ VLC_PLAYER_TELETEXT_KEY_RED

#define VLC_PLAYER_TELETEXT_KEY_RED   ('r' << 16)

Player teletext key: Red.

◆ VLC_PLAYER_TELETEXT_KEY_YELLOW

#define VLC_PLAYER_TELETEXT_KEY_YELLOW   ('y' << 16)

Player teletext key: Yellow.

Enumeration Type Documentation

◆ vlc_player_abloop

A to B loop state.

Enumerator
VLC_PLAYER_ABLOOP_NONE 
VLC_PLAYER_ABLOOP_A 
VLC_PLAYER_ABLOOP_B 

◆ vlc_player_error

Error of the player.

See also
vlc_player_GetError()
Enumerator
VLC_PLAYER_ERROR_NONE 
VLC_PLAYER_ERROR_GENERIC 

◆ vlc_player_nav

Menu (VCD/DVD/BD) and viewpoint navigations.

See also
vlc_player_Navigate()
Enumerator
VLC_PLAYER_NAV_ACTIVATE 

Activate the navigation item selected.

VLC_PLAYER_NAV_UP 

Select a navigation item above or move the viewpoint up.

VLC_PLAYER_NAV_DOWN 

Select a navigation item under or move the viewpoint down.

VLC_PLAYER_NAV_LEFT 

Select a navigation item on the left or move the viewpoint left.

VLC_PLAYER_NAV_RIGHT 

Select a navigation item on the right or move the viewpoint right.

VLC_PLAYER_NAV_POPUP 

Activate the popup Menu (for BD)

VLC_PLAYER_NAV_MENU 

Activate disc Root Menu.

◆ vlc_player_restore_playback_pos

Enumerator
VLC_PLAYER_RESTORE_PLAYBACK_POS_NEVER 
VLC_PLAYER_RESTORE_PLAYBACK_POS_ASK 
VLC_PLAYER_RESTORE_PLAYBACK_POS_ALWAYS 

◆ vlc_player_seek_speed

Seek speed type.

See also
vlc_player_SeekByPos()
vlc_player_SeekByTime()
Enumerator
VLC_PLAYER_SEEK_PRECISE 

Do a precise seek.

VLC_PLAYER_SEEK_FAST 

Do a fast seek.

◆ vlc_player_state

State of the player.

During a normal playback (no errors), the user is expected to receive all events in the following order: STARTED, PLAYING, STOPPING, STOPPED.

Note
When playing more than one media in a row, the player stay at the PLAYING state when doing the transition from the current media to the next media (that can be gapless). This means that STOPPING, STOPPED states (for the current media) and STARTED, PLAYING states (for the next one) won't be sent. Nevertheless, the vlc_player_cbs.on_current_media_changed callback will be called during this transition.
Enumerator
VLC_PLAYER_STATE_STOPPED 

The player is stopped.

Initial state, or triggered by an internal transition from the STOPPING state.

VLC_PLAYER_STATE_STARTED 

The player is started.

Triggered by vlc_player_Start()

VLC_PLAYER_STATE_PLAYING 

The player is playing.

Triggered by vlc_player_Resume() or by an internal transition from the STARTED state.

VLC_PLAYER_STATE_PAUSED 

The player is paused.

Triggered by vlc_player_Pause().

VLC_PLAYER_STATE_STOPPING 

The player is stopping.

Triggered by vlc_player_Stop(), vlc_player_SetCurrentMedia() or by an internal transition (when the media reach the end of file for example).

◆ vlc_player_whence

Player seek/delay directive.

See also
vlc_player_SeekByPos()
vlc_player_SeekByTime()
vlc_player_SetCategoryDelay()
Enumerator
VLC_PLAYER_WHENCE_ABSOLUTE 

Given time/position.

VLC_PLAYER_WHENCE_RELATIVE 

The current position +/- the given time/position.

Function Documentation

◆ vlc_player_AddAssociatedMedia()

int vlc_player_AddAssociatedMedia ( vlc_player_t player,
enum es_format_category_e  cat,
const char *  uri,
bool  select,
bool  notify,
bool  check_ext 
)

Add an associated (or external) media to the current media.

Parameters
playerlocked player instance
catSPU_ES or UNKNOWN_ES
uriabsolute uri of the external media
selecttrue to select the track of this external media
notifytrue to notify the OSD
check_exttrue to check subtitles extension

References input_item_slave::b_forced, INPUT_CONTROL_ADD_SLAVE, input_ControlPushHelper(), input_item_slave_New(), vlc_value_t::p_address, vlc_player_input::player, SLAVE_PRIORITY_USER, SLAVE_TYPE_GENERIC, SLAVE_TYPE_SPU, SPU_ES, subtitles_Filter(), vlc_player_input::thread, VLC_EGENERIC, VLC_ENOMEM, vlc_gettext(), vlc_player_get_input_locked(), vlc_player_osd_Message(), and VLC_SUCCESS.

◆ vlc_player_CanChangeRate()

static bool vlc_player_CanChangeRate ( vlc_player_t player)
inlinestatic

Helper to get the change-rate capability.

References VLC_PLAYER_CAP_CHANGE_RATE, and vlc_player_GetCapabilities().

◆ vlc_player_CanPause()

static bool vlc_player_CanPause ( vlc_player_t player)
inlinestatic

Helper to get the pause capability.

References VLC_PLAYER_CAP_PAUSE, and vlc_player_GetCapabilities().

◆ vlc_player_CanRewind()

static bool vlc_player_CanRewind ( vlc_player_t player)
inlinestatic

Helper to get the rewindable capability.

References VLC_PLAYER_CAP_REWIND, and vlc_player_GetCapabilities().

◆ vlc_player_CanSeek()

static bool vlc_player_CanSeek ( vlc_player_t player)
inlinestatic

Helper to get the seek capability.

References VLC_PLAYER_CAP_SEEK, and vlc_player_GetCapabilities().

Referenced by vlc_player_GetAtoBLoop(), and vlc_player_SetAtoBLoop().

◆ vlc_player_ChangeRate()

void vlc_player_ChangeRate ( vlc_player_t player,
float  rate 
)

Change the rate of the player.

Note
The rate is saved across several medias
Parameters
playerlocked player instance
ratenew rate (< 1.f is slower, > 1.f is faster)

References INPUT_CONTROL_SET_RATE, input_ControlPushHelper(), vlc_player_input::player, vlc_player_input::rate, vlc_player_input::thread, var_SetFloat(), vlc_player_get_input_locked(), vlc_player_osd_Message(), vlc_player_SendEvent, and VLC_SUCCESS.

Referenced by vlc_player_ChangeRateOffset(), and vlc_player_input_RestoreMlStates().

◆ vlc_player_DecrementRate()

void vlc_player_DecrementRate ( vlc_player_t player)

Decrement the rate of the player (Slower)

Parameters
playerlocked player instance

References vlc_player_input::player, and vlc_player_ChangeRateOffset().

◆ vlc_player_DisplayPosition()

void vlc_player_DisplayPosition ( vlc_player_t player)

Display the player position on the vout OSD.

Parameters
playerlocked player instance

References vlc_player_input::player, vlc_player_get_input_locked(), vlc_player_input_GetPos(), vlc_player_input_GetTime(), vlc_player_osd_Position(), and vlc_tick_now().

◆ vlc_player_GetAtoBLoop()

enum vlc_player_abloop vlc_player_GetAtoBLoop ( vlc_player_t player,
vlc_tick_t a_time,
double *  a_pos,
vlc_tick_t b_time,
double *  b_pos 
)

Get the A to B loop status.

Note
If the returned status is VLC_PLAYER_ABLOOP_A, then a_time and a_pos will be valid. If the returned status is VLC_PLAYER_ABLOOP_B, then all output parameters are valid. If the returned status is VLC_PLAYER_ABLOOP_NONE, then all output parameters are invalid.
See also
vlc_player_cbs.on_atobloop_changed
Parameters
playerlocked player instance
a_timeA time or VLC_TICK_INVALID (if the media doesn't have valid times)
a_posA position
b_timeB time or VLC_TICK_INVALID (if the media doesn't have valid times)
b_posB position
Returns
A to B loop status

References vlc_player_input::abloop_state, vlc_player_input::player, vlc_player_input::pos, vlc_player_input::set, vlc_player_input::time, VLC_PLAYER_ABLOOP_A, VLC_PLAYER_ABLOOP_B, VLC_PLAYER_ABLOOP_NONE, vlc_player_CanSeek(), and vlc_player_get_input_locked().

◆ vlc_player_GetCapabilities()

int vlc_player_GetCapabilities ( vlc_player_t player)

◆ vlc_player_GetCurrentMedia()

input_item_t * vlc_player_GetCurrentMedia ( vlc_player_t player)

Get the current played media.

See also
vlc_player_cbs.on_current_media_changed
Parameters
playerlocked player instance
Returns
a valid media or NULL (if no media is set)

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

Referenced by on_player_media_length_changed(), vlc_player_HoldCurrentMedia(), vlc_strfplayer(), vlm_ControlMediaInstanceStart(), and vlm_MediaInstanceDelete().

◆ vlc_player_GetError()

enum vlc_player_error vlc_player_GetError ( vlc_player_t player)

Get the error state of the player.

See also
vlc_player_cbs.on_capabilities_changed
Parameters
playerlocked player instance
Returns
the current error state

References vlc_player_input::error, vlc_player_input::player, VLC_PLAYER_ERROR_NONE, and vlc_player_get_input_locked().

Referenced by player_on_state_changed().

◆ vlc_player_GetLength()

vlc_tick_t vlc_player_GetLength ( vlc_player_t player)

Get the length of the current media.

Note
A started and playing media doesn't have necessarily a valid length.
See also
vlc_player_cbs.on_length_changed
Parameters
playerlocked player instance
Returns
a valid length or VLC_TICK_INVALID (if no media is set, playback is not yet started or in case of error)

References vlc_player_input::length, vlc_player_input::player, vlc_player_get_input_locked(), and VLC_TICK_INVALID.

Referenced by vlc_strfplayer(), and vlm_ControlMediaInstanceGets().

◆ vlc_player_GetNextMedia()

input_item_t * vlc_player_GetNextMedia ( vlc_player_t player)

Get the next played media.

This function return the media set by vlc_player_SetNextMedia()

Parameters
playerlocked player instance
Returns
a valid media or NULL (if no next media is set)

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

◆ vlc_player_GetPosition()

double vlc_player_GetPosition ( vlc_player_t player)

Get the position of the current media.

See also
vlc_player_cbs.on_position_changed
Parameters
playerlocked player instance
Returns
a valid position in the range [0.f;1.f] or -1.f (if no media is set,if playback is not yet started or in case of error)

References vlc_player_input::player, vlc_player_get_input_locked(), vlc_player_input_GetPos(), and vlc_tick_now().

Referenced by vlc_player_SetAtoBLoop(), vlc_strfplayer(), vlm_ControlMediaInstanceGets(), and vlm_ControlMediaInstanceGetTimePosition().

◆ vlc_player_GetRate()

float vlc_player_GetRate ( vlc_player_t player)

Get the rate of the player.

See also
vlc_player_cbs.on_rate_changed
Parameters
playerlocked player instance
Returns
rate of the player (< 1.f is slower, > 1.f is faster)

References vlc_player_input::player, vlc_player_input::rate, var_GetFloat(), and vlc_player_get_input_locked().

Referenced by vlc_player_ChangeRateOffset(), vlc_strfplayer(), and vlm_ControlMediaInstanceGets().

◆ vlc_player_GetSignal()

int vlc_player_GetSignal ( vlc_player_t player,
float *  quality,
float *  strength 
)

Get the signal quality and strength of the current media.

Parameters
playerlocked player instance
qualitya pointer that will be assigned with the signal quality
strengtha pointer that will be assigned with the signal strength
Return values
VLC_SUCCESSwhen quality and strength have been assigned
VLC_EGENERICin case of error (strength and quality are not assigned)

References vlc_player_input::player, vlc_player_input::signal_quality, vlc_player_input::signal_strength, VLC_EGENERIC, vlc_player_get_input_locked(), and VLC_SUCCESS.

◆ vlc_player_GetState()

enum vlc_player_state vlc_player_GetState ( vlc_player_t player)

Get the state of the player.

Note
Since all players actions are asynchronous, this function won't reflect the new state immediately. Wait for the vlc_players_cbs.on_state_changed event to be notified.
See also
vlc_player_state
vlc_player_cbs.on_state_changed
Parameters
playerlocked player instance
Returns
the current player state

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

Referenced by vlc_player_IsPaused(), and vlc_player_IsStarted().

◆ vlc_player_GetStatistics()

const struct input_stats_t * vlc_player_GetStatistics ( vlc_player_t player)

Get the statistics of the current media.

Warning
The returned pointer becomes invalid when the player is unlocked. The referenced structure can be safely copied.
See also
vlc_player_cbs.on_statistics_changed
Parameters
playerlocked player instance
Returns
pointer to the player stats structure or NULL

References vlc_player_input::player, vlc_player_input::stats, and vlc_player_get_input_locked().

◆ vlc_player_GetTime()

vlc_tick_t vlc_player_GetTime ( vlc_player_t player)

Get the time of the current media.

Note
A started and playing media doesn't have necessarily a valid time.
See also
vlc_player_cbs.on_position_changed
Parameters
playerlocked player instance
Returns
a valid time or VLC_TICK_INVALID (if no media is set, the media doesn't have any time, if playback is not yet started or in case of error)

References vlc_player_input::player, vlc_player_get_input_locked(), vlc_player_input_GetTime(), VLC_TICK_INVALID, and vlc_tick_now().

Referenced by vlc_player_SetAtoBLoop(), vlc_strfplayer(), vlm_ControlMediaInstanceGets(), and vlm_ControlMediaInstanceGetTimePosition().

◆ vlc_player_GetV4l2Object()

vlc_object_t * vlc_player_GetV4l2Object ( vlc_player_t player)

Get the V4L2 object used to do controls.

Parameters
playerlocked player instance
Returns
the V4L2 object or NULL if not any. This object must be used with the player lock held.

References vlc_player_input::player, vlc_player_input::thread, var_Type(), VLC_OBJECT, and vlc_player_get_input_locked().

◆ vlc_player_HoldCurrentMedia()

static input_item_t * vlc_player_HoldCurrentMedia ( vlc_player_t player)
inlinestatic

Helper that hold the current media.

References input_item_Hold(), and vlc_player_GetCurrentMedia().

◆ vlc_player_IncrementRate()

void vlc_player_IncrementRate ( vlc_player_t player)

Increment the rate of the player (faster)

Parameters
playerlocked player instance

References vlc_player_input::player, and vlc_player_ChangeRateOffset().

◆ vlc_player_IsPaused()

static bool vlc_player_IsPaused ( vlc_player_t player)
inlinestatic

◆ vlc_player_IsRecording()

bool vlc_player_IsRecording ( vlc_player_t player)

Check if the playing is recording.

See also
vlc_player_cbs.on_recording_changed
Parameters
playerlocked player instance
Returns
true if the player is recording

References vlc_player_input::player, vlc_player_input::recording, and vlc_player_get_input_locked().

Referenced by vlc_player_ToggleRecording().

◆ vlc_player_IsStarted()

static bool vlc_player_IsStarted ( vlc_player_t player)
inlinestatic

◆ vlc_player_JumpPos()

static void vlc_player_JumpPos ( vlc_player_t player,
double  jumppos 
)
inlinestatic

Helper to jump the position precisely.

References VLC_PLAYER_SEEK_PRECISE, vlc_player_SeekByPos(), and VLC_PLAYER_WHENCE_RELATIVE.

◆ vlc_player_JumpTime()

static void vlc_player_JumpTime ( vlc_player_t player,
vlc_tick_t  jumptime 
)
inlinestatic

Helper to jump the time precisely.

References VLC_PLAYER_SEEK_PRECISE, vlc_player_SeekByTime(), and VLC_PLAYER_WHENCE_RELATIVE.

◆ vlc_player_Navigate()

◆ vlc_player_NextVideoFrame()

void vlc_player_NextVideoFrame ( vlc_player_t player)

Pause and display the next video frame.

Parameters
playerlocked player instance

References _, INPUT_CONTROL_SET_FRAME_NEXT, input_ControlPushHelper(), vlc_player_input::player, vlc_player_input::thread, vlc_player_get_input_locked(), vlc_player_osd_Message(), and VLC_SUCCESS.

◆ vlc_player_Pause()

void vlc_player_Pause ( vlc_player_t player)

Pause the playback.

Parameters
playerlocked player instance

References vlc_player_input::player, and vlc_player_SetPause().

Referenced by vlc_player_CorkCallback(), vlc_player_TogglePause(), and vlc_playlist_Pause().

◆ vlc_player_RestorePlaybackPos()

void vlc_player_RestorePlaybackPos ( vlc_player_t player)

Restore the previous playback position of the current media.

References vlc_player_t::input, and vlc_player_input_RestoreMlStates().

◆ vlc_player_Resume()

void vlc_player_Resume ( vlc_player_t player)

Resume the playback from a pause.

Parameters
playerlocked player instance

References vlc_player_input::player, and vlc_player_SetPause().

Referenced by vlc_player_CorkCallback(), vlc_player_TogglePause(), vlc_playlist_Resume(), and vlm_ControlMediaInstanceStart().

◆ vlc_player_SeekByPos()

void vlc_player_SeekByPos ( vlc_player_t player,
double  position,
enum vlc_player_seek_speed  speed,
enum vlc_player_whence  whence 
)

Seek the current media by position.

Note
This function can be called before vlc_player_Start() in order to set a starting position.
Parameters
playerlocked player instance
positionposition in the range [0.f;1.f]
speedprecise of fast
whenceabsolute or relative

References vlc_player_input::player, vlc_player_input::position, vlc_player_get_input_locked(), and vlc_player_input_SeekByPos().

Referenced by vlc_player_JumpPos(), vlc_player_SetPosition(), and vlc_player_SetPositionFast().

◆ vlc_player_SeekByTime()

void vlc_player_SeekByTime ( vlc_player_t player,
vlc_tick_t  time,
enum vlc_player_seek_speed  speed,
enum vlc_player_whence  whence 
)

Seek the current media by time.

Note
This function can be called before vlc_player_Start() in order to set a starting position.
Warning
This function has an effect only if the media has a valid length.
Parameters
playerlocked player instance
timea time in the range [0;length]
speedprecise of fast
whenceabsolute or relative

References vlc_player_input::player, vlc_player_input::time, vlc_player_get_input_locked(), and vlc_player_input_SeekByTime().

Referenced by vlc_player_JumpTime(), vlc_player_SetTime(), and vlc_player_SetTimeFast().

◆ vlc_player_SetAtoBLoop()

int vlc_player_SetAtoBLoop ( vlc_player_t player,
enum vlc_player_abloop  abloop 
)

Enable A to B loop of the current media.

This function need to be called 2 times with VLC_PLAYER_ABLOOP_A and VLC_PLAYER_ABLOOP_B to setup an A to B loop. It uses and stores the current time/position when called. The B time must be higher than the A time.

Parameters
playerlocked player instance
abloopselect which A/B cursor to set
Returns
VLC_SUCCESS or a VLC error code

References vlc_player_input::abloop_state, vlc_player_input::player, vlc_player_input::pos, vlc_player_input::set, vlc_player_input::time, vlc_assert_unreachable, VLC_EGENERIC, VLC_PLAYER_ABLOOP_A, VLC_PLAYER_ABLOOP_B, VLC_PLAYER_ABLOOP_NONE, vlc_player_CanSeek(), vlc_player_get_input_locked(), vlc_player_GetPosition(), vlc_player_GetTime(), vlc_player_SendEvent, vlc_player_SetPosition(), vlc_player_SetTime(), VLC_SUCCESS, and VLC_TICK_INVALID.

◆ vlc_player_SetCurrentMedia()

int vlc_player_SetCurrentMedia ( vlc_player_t player,
input_item_t media 
)

Set the current media.

This function replaces the current and next medias.

Note
A successful call will always result of vlc_player_cbs.on_current_media_changed being called. This function is not blocking. If a media is currently being played, this media will be stopped and the requested media will be set after.
The function will open the media, without starting it, allowing the user to send controls (like seek requests) before Starting the player.
Warning
This function is either synchronous (if the player state is STOPPED) or asynchronous. In the later case, vlc_player_GetCurrentMedia() will return the old media, even after this call, and until the vlc_player_cbs.on_current_media_changed is called.
Parameters
playerlocked player instance
medianew media to play (will be held by the player)
Returns
VLC_SUCCESS or a VLC error code

References vlc_player_t::input, input_item_Hold(), vlc_player_t::media, vlc_player_t::next_media, vlc_player_input::player, vlc_player_t::releasing_media, vlc_player_assert_locked(), vlc_player_CancelWaitError(), vlc_player_destructor_AddInput(), vlc_player_destructor_IsEmpty(), vlc_player_InvalidateNextMedia(), vlc_player_OpenNextMedia(), and VLC_SUCCESS.

Referenced by vlc_playlist_Clear(), vlc_playlist_SetCurrentMedia(), and vlm_ControlMediaInstanceStart().

◆ vlc_player_SetNextMedia()

void vlc_player_SetNextMedia ( vlc_player_t player,
input_item_t media 
)

Set the next media.

This function replaces the next media to be played. The user should set the next media from the vlc_player_cbs.current_media_changed callback or anytime before the current media is stopped.

Note
The media won't be opened directly by this function. If there is no current media, the next media will be opened from vlc_player_Start(). If there is a current playing media, the next media will be opened and played automatically.
Parameters
playerlocked player instance
medianext media to play (will be held by the player)

References input_item_Hold(), input_item_Release(), vlc_player_t::next_media, vlc_player_input::player, and vlc_player_assert_locked().

Referenced by vlc_playlist_UpdateNextMedia().

◆ vlc_player_SetPosition()

static void vlc_player_SetPosition ( vlc_player_t player,
double  position 
)
inlinestatic

◆ vlc_player_SetPositionFast()

static void vlc_player_SetPositionFast ( vlc_player_t player,
double  position 
)
inlinestatic

Helper to set the absolute position fast.

References VLC_PLAYER_SEEK_FAST, vlc_player_SeekByPos(), and VLC_PLAYER_WHENCE_ABSOLUTE.

◆ vlc_player_SetRecordingEnabled()

void vlc_player_SetRecordingEnabled ( vlc_player_t player,
bool  enabled,
const char *  dir_path 
)

Enable or disable recording for the current media.

Note
A successful call will trigger the vlc_player_cbs.on_recording_changed event.
Parameters
playerlocked player instance
enabledtrue to enable recording
dir_pathpath of the recording directory or NULL (use default path), has only an effect when first enabling recording.

References _, INPUT_CONTROL_SET_RECORD_STATE, input_ControlPush(), vlc_player_input::player, input_control_param_t::record_state, strdup(), vlc_player_input::thread, vlc_player_get_input_locked(), vlc_player_osd_Message(), and VLC_SUCCESS.

Referenced by vlc_player_ToggleRecording().

◆ vlc_player_SetTime()

static void vlc_player_SetTime ( vlc_player_t player,
vlc_tick_t  time 
)
inlinestatic

◆ vlc_player_SetTimeFast()

static void vlc_player_SetTimeFast ( vlc_player_t player,
vlc_tick_t  time 
)
inlinestatic

Helper to set the absolute time fast.

References VLC_PLAYER_SEEK_FAST, vlc_player_SeekByTime(), and VLC_PLAYER_WHENCE_ABSOLUTE.

◆ vlc_player_Start()

◆ vlc_player_Stop()

int vlc_player_Stop ( vlc_player_t player)

Stop the playback of the current media.

Note
This function is asynchronous. In case of success, the user should wait for the STOPPED state event to know when the stop is finished.
Parameters
playerlocked player instance
Returns
VLC_SUCCESS if the player is being stopped, VLC_EGENERIC otherwise (no-op)

References vlc_player_t::input, vlc_player_input::player, vlc_player_t::started, VLC_EGENERIC, vlc_player_CancelWaitError(), vlc_player_destructor_AddInput(), vlc_player_get_input_locked(), vlc_player_InvalidateNextMedia(), and VLC_SUCCESS.

Referenced by vlc_playlist_Stop(), vlm_ControlMediaInstanceStart(), and vlm_MediaInstanceDelete().

◆ vlc_player_TogglePause()

static void vlc_player_TogglePause ( vlc_player_t player)
inlinestatic

Helper to toggle the pause state.

References vlc_player_IsPaused(), vlc_player_IsStarted(), vlc_player_Pause(), and vlc_player_Resume().

Referenced by vlm_ControlMediaInstancePause().

◆ vlc_player_ToggleRecording()

static void vlc_player_ToggleRecording ( vlc_player_t player)
inlinestatic

Helper to toggle the recording state.

References vlc_player_IsRecording(), and vlc_player_SetRecordingEnabled().

◆ vlc_player_UpdateViewpoint()

void vlc_player_UpdateViewpoint ( vlc_player_t player,
const vlc_viewpoint_t viewpoint,
enum vlc_player_whence  whence 
)

Update the viewpoint.

Parameters
playerlocked player instance
viewpointthe viewpoint value
whenceabsolute or relative

References vlc_player_input::player, vlc_player_get_input_locked(), and vlc_player_input_UpdateViewpoint().