VLC  4.0.0-dev
Macros | Enumerations | Functions
Collaboration diagram for Playback control:

Macros

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

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

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

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

VLC_EXPORT 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
catAUDIO_ES or SPU_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 AUDIO_ES, 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_AUDIO, 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()

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

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

VLC_EXPORT 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_PLAYER_WHENCE_ABSOLUTE.

◆ vlc_player_GetAtoBLoop()

VLC_EXPORT enum vlc_player_abloop vlc_player_GetAtoBLoop ( vlc_player_t player,
vlc_tick_t a_time,
float *  a_pos,
vlc_tick_t b_time,
float *  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()

VLC_EXPORT int vlc_player_GetCapabilities ( vlc_player_t player)

◆ vlc_player_GetCurrentMedia()

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

VLC_EXPORT 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_EXPORT 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_GetPosition()

VLC_EXPORT float 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(), and vlc_player_input_GetPos().

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

◆ vlc_player_GetRate()

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

VLC_EXPORT 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

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

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

VLC_EXPORT 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_EXPORT 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(), and VLC_TICK_INVALID.

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

◆ vlc_player_GetV4l2Object()

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

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

VLC_EXPORT void vlc_player_InvalidateNextMedia ( vlc_player_t player)

Invalidate the next media.

This function can be used to invalidate the media returned by the vlc_player_media_provider.get_next callback. This can be used when the next item from a playlist was changed by the user.

Calling this function will trigger the vlc_player_media_provider.get_next callback to be called again.

Parameters
playerlocked player instance

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

Referenced by vlc_player_SetCurrentMedia(), vlc_player_Stop(), vlc_playlist_Expand(), vlc_playlist_Insert(), vlc_playlist_Move(), and vlc_playlist_Remove().

◆ vlc_player_IsPaused()

static bool vlc_player_IsPaused ( vlc_player_t player)
inlinestatic

◆ vlc_player_IsRecording()

VLC_EXPORT 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,
float  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_EXPORT void vlc_player_Navigate ( vlc_player_t player,
enum vlc_player_nav  nav 
)

◆ vlc_player_NextVideoFrame()

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

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

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

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

VLC_EXPORT void vlc_player_SeekByPos ( vlc_player_t player,
float  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 INPUT_CONTROL_JUMP_POSITION, INPUT_CONTROL_SET_POSITION, input_ControlPush(), vlc_player_input::player, vlc_player_input::position, vlc_player_input::thread, vlc_player_assert_seek_params(), vlc_player_get_input_locked(), vlc_player_osd_Position(), VLC_PLAYER_WHENCE_ABSOLUTE, VLC_SUCCESS, and VLC_TICK_INVALID.

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

◆ vlc_player_SeekByTime()

VLC_EXPORT 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 INPUT_CONTROL_JUMP_TIME, INPUT_CONTROL_SET_TIME, input_ControlPush(), vlc_player_input::player, vlc_player_input::thread, vlc_player_input::time, vlc_player_assert_seek_params(), vlc_player_get_input_locked(), vlc_player_osd_Position(), VLC_PLAYER_WHENCE_ABSOLUTE, and VLC_SUCCESS.

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

◆ vlc_player_SetAtoBLoop()

VLC_EXPORT 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 current the current time/position when called. The B time must be higher than the A time.

Parameters
playerlocked player instance
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()

VLC_EXPORT 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.
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_t::next_media_requested, 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_SetPosition()

static void vlc_player_SetPosition ( vlc_player_t player,
float  position 
)
inlinestatic

◆ vlc_player_SetPositionFast()

static void vlc_player_SetPositionFast ( vlc_player_t player,
float  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()

VLC_EXPORT void vlc_player_SetRecordingEnabled ( vlc_player_t player,
bool  enabled 
)

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

References _, INPUT_CONTROL_SET_RECORD_STATE, input_ControlPushHelper(), vlc_player_input::player, 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_EXPORT int vlc_player_Start ( vlc_player_t player)

◆ vlc_player_Stop()

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

VLC_EXPORT 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
Returns
VLC_SUCCESS or a VLC error code

References INPUT_CONTROL_SET_VIEWPOINT, INPUT_CONTROL_UPDATE_VIEWPOINT, input_ControlPush(), vlc_player_input::player, vlc_player_input::thread, input_control_param_t::viewpoint, vlc_player_get_input_locked(), and VLC_PLAYER_WHENCE_ABSOLUTE.