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

Data Structures

struct  vlc_player_program
 Player program structure. More...
 

Functions

struct vlc_player_programvlc_player_program_Dup (const struct vlc_player_program *prgm)
 Duplicate a program.
 
void vlc_player_program_Delete (struct vlc_player_program *prgm)
 Delete a duplicated program.
 
size_t vlc_player_GetProgramCount (vlc_player_t *player)
 Get the number of programs.
 
const struct vlc_player_programvlc_player_GetProgramAt (vlc_player_t *player, size_t index)
 Get the program at a specific index.
 
const struct vlc_player_programvlc_player_GetProgram (vlc_player_t *player, int group_id)
 Get a program from an ES group identifier.
 
void vlc_player_SelectProgram (vlc_player_t *player, int group_id)
 Select a program from an ES group identifier.
 
void vlc_player_SelectNextProgram (vlc_player_t *player)
 Select the next program.
 
void vlc_player_SelectPrevProgram (vlc_player_t *player)
 Select the previous program.
 
static const struct vlc_player_programvlc_player_GetSelectedProgram (vlc_player_t *player)
 Helper to get the current selected program.
 

Detailed Description

Function Documentation

◆ vlc_player_GetProgram()

const struct vlc_player_program * vlc_player_GetProgram ( vlc_player_t player,
int  group_id 
)

Get a program from an ES group identifier.

Parameters
playerlocked player instance
group_ida program ID (retrieved from vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())
Returns
a valid program or NULL (if the program was terminated by the playback thread)

References vlc_player_input::player, vlc_player_input::program_vector, vlc_player_get_input_locked(), and vlc_player_program_vector_FindById().

◆ vlc_player_GetProgramAt()

const struct vlc_player_program * vlc_player_GetProgramAt ( vlc_player_t player,
size_t  index 
)

Get the program at a specific index.

Warning
The behaviour is undefined if the index is not valid.
The returned pointer becomes invalid when the player is unlocked. The referenced structure can be safely copied with vlc_player_program_Dup().
Parameters
playerlocked player instance
indexvalid index in the range [0; count[
Returns
a valid program (can't be NULL if vlc_player_GetProgramCount() returned a valid count)

References vlc_player_program_vector::data, vlc_player_input::player, vlc_player_input::program_vector, vlc_player_program_vector::size, and vlc_player_get_input_locked().

Referenced by vlc_player_CycleProgram(), and vlc_player_GetSelectedProgram().

◆ vlc_player_GetProgramCount()

size_t vlc_player_GetProgramCount ( vlc_player_t player)

Get the number of programs.

Warning
The returned size becomes invalid when the player is unlocked.
Parameters
playerlocked player instance
Returns
number of programs, or 0 (in case of error, or if the media is not started)

References vlc_player_input::player, vlc_player_input::program_vector, vlc_player_program_vector::size, and vlc_player_get_input_locked().

Referenced by vlc_player_CycleProgram(), and vlc_player_GetSelectedProgram().

◆ vlc_player_GetSelectedProgram()

static const struct vlc_player_program * vlc_player_GetSelectedProgram ( vlc_player_t player)
inlinestatic

Helper to get the current selected program.

References count, vlc_player_program::selected, vlc_player_GetProgramAt(), and vlc_player_GetProgramCount().

◆ vlc_player_program_Delete()

void vlc_player_program_Delete ( struct vlc_player_program prgm)

Delete a duplicated program.

References vlc_player_program::name.

Referenced by vlc_player_input_HandleProgramEvent().

◆ vlc_player_program_Dup()

struct vlc_player_program * vlc_player_program_Dup ( const struct vlc_player_program prgm)

Duplicate a program.

This function can be used to pass a program from a callback to an other context.

See also
vlc_player_cbs.on_program_list_changed
Returns
a duplicated program or NULL on allocation error

References vlc_player_program::group_id, vlc_player_program::name, vlc_player_program::scrambled, vlc_player_program::selected, and vlc_player_program_New().

◆ vlc_player_SelectNextProgram()

void vlc_player_SelectNextProgram ( vlc_player_t player)

Select the next program.

Parameters
playerlocked player instance

References vlc_player_CycleProgram().

◆ vlc_player_SelectPrevProgram()

void vlc_player_SelectPrevProgram ( vlc_player_t player)

Select the previous program.

Parameters
playerlocked player instance

References vlc_player_CycleProgram().

◆ vlc_player_SelectProgram()

void vlc_player_SelectProgram ( vlc_player_t player,
int  group_id 
)

Select a program from an ES group identifier.

This function can be used to pre-select a program by its id before starting the player. It has only effect for the current media. It can also be used when the player is already started.

Note
Selecting a non-existing program will cause the player to no select any programs. Therefore, all tracks will be disabled.
Parameters
playerlocked player instance
group_ida program ID (retrieved from vlc_player_cbs.on_program_list_changed or vlc_player_GetProgramAt())

References input_SetProgramId(), vlc_player_program::name, vlc_player_input::player, vlc_player_input::program_vector, vlc_player_input::thread, vlc_player_get_input_locked(), vlc_player_osd_Program(), and vlc_player_program_vector_FindById().

Referenced by vlc_player_CycleProgram().