VLC 4.0.0-dev
Loading...
Searching...
No Matches
libvlc_media_player_cbs Struct Reference

struct defining callbacks for libvlc_media_player_new() More...

#include <libvlc_media_player.h>

Data Fields

uint32_t version
 Version of struct libvlc_media_player_cbs.
void(* on_media_changed )(void *opaque, libvlc_media_t *media)
 Callback prototype that notify when the player changed media.
void(* on_media_stopping )(void *opaque, libvlc_media_t *media, libvlc_stopping_reason_t stopping_reason)
 Callback prototype that notify when the player will stop the current media.
void(* on_state_changed )(void *opaque, libvlc_state_t state)
 Callback prototype that notify when the player state changed.
void(* on_buffering_changed )(void *opaque, float buffering)
 Callback prototype that notify when the player buffering changed.
void(* on_capabilities_changed )(void *opaque, libvlc_capability_t old_caps, libvlc_capability_t new_caps)
 Callback prototype that notify when the player capabilities changed.
void(* on_position_changed )(void *opaque, libvlc_time_t time, double pos)
 Callback prototype that notify when the player position changed.
void(* on_length_changed )(void *opaque, libvlc_time_t length)
 Callback prototype that notify when the player length changed.
void(* on_track_list_changed )(void *opaque, libvlc_list_action_t action, libvlc_track_type_t type, const char *id)
 Callback prototype that notify when the player added, removed or updated a track.
void(* on_track_selection_changed )(void *opaque, libvlc_track_type_t type, const char *unselected_id, const char *selected_id)
 Callback prototype that notify when a track is selected or unselected by the player.
void(* on_program_list_changed )(void *opaque, libvlc_list_action_t action, int group_id)
 Callback prototype that notify when the player added, removed or updated a program.
void(* on_program_selection_changed )(void *opaque, int unselected_group_id, int selected_group_id)
 Callback prototype that notify when a program is selected or unselected by the player.
void(* on_titles_changed )(void *opaque)
 Callback prototype that notify when the player changed titles.
void(* on_title_selection_changed )(void *opaque, const libvlc_title_description_t *title, unsigned idx)
 Callback prototype that notify when the player selected a new title.
void(* on_chapter_selection_changed )(void *opaque, const libvlc_title_description_t *title, unsigned title_idx, const libvlc_chapter_description_t *chapter, unsigned chapter_idx)
 Callback prototype that notify when the player selected a new chapter.
void(* on_recording_changed )(void *opaque, bool recording, const char *file_path)
 Callback prototype that notify when the player recording state changed.
void(* on_screenshot_taken )(void *opaque, const char *file_path)
 Callback prototype that notify when the player took a screenshot.
void(* on_media_parsed )(void *opaque, libvlc_media_t *media)
 Callback prototype that notify when the player parsed the current media.
void(* on_media_meta_changed )(void *opaque, libvlc_media_t *media)
 Callback prototype that notify when metadata were update by the player.
void(* on_media_subitems_changed )(void *opaque, libvlc_media_t *media)
 Callback prototype that notify when the player added new subitems to the current media.
void(* on_media_attachments_added )(void *opaque, libvlc_media_t *media, libvlc_picture_list_t *list)
 Callback prototype that notify when the player added new attachments to the current media.
void(* on_next_frame_status )(void *opaque, int status)
 Callback prototype that notify when the next frame, following a call to libvlc_media_player_next_frame(), is about to displayed.
void(* on_prev_frame_status )(void *opaque, int status)
 Callback prototype that notify when the previous frame, following a call to libvlc_media_player_previous_frame(), is about to be displayed.
void(* on_vout_changed )(void *opaque, unsigned vout_count)
 Callback prototype that notify when a new player vout is added or removed.
void(* on_cork_changed )(void *opaque, bool corked)
 Callback prototype that notify when the player is corked/uncorked.
void(* on_audio_volume_changed )(void *opaque, float volume)
 Callback prototype that notify when the audio volume has changed.
void(* on_audio_mute_changed )(void *opaque, bool muted)
 Callback prototype that notify when the audio mute state has changed.
void(* on_audio_device_changed )(void *opaque, const char *device)
 Callback prototype that notify when the audio device state has changed.

Detailed Description

struct defining callbacks for libvlc_media_player_new()

Field Documentation

◆ on_audio_device_changed

void(* libvlc_media_player_cbs::on_audio_device_changed) (void *opaque, const char *device)

Callback prototype that notify when the audio device state has changed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
devicethe device name

◆ on_audio_mute_changed

void(* libvlc_media_player_cbs::on_audio_mute_changed) (void *opaque, bool muted)

Callback prototype that notify when the audio mute state has changed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
mutedtrue if muted

◆ on_audio_volume_changed

void(* libvlc_media_player_cbs::on_audio_volume_changed) (void *opaque, float volume)

Callback prototype that notify when the audio volume has changed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
volumevolume in the range [0;2.f]

◆ on_buffering_changed

void(* libvlc_media_player_cbs::on_buffering_changed) (void *opaque, float buffering)

Callback prototype that notify when the player buffering changed.

Note
Optional (can be NULL), available since version 0

This event is always called with the 0 and 1 values before a playback (in case of success). Values in between depends on the media type.

Parameters
opaqueopaque pointer set by libvlc_media_player_new()
bufferingbuffering in the range [0:1]

◆ on_capabilities_changed

void(* libvlc_media_player_cbs::on_capabilities_changed) (void *opaque, libvlc_capability_t old_caps, libvlc_capability_t new_caps)

Callback prototype that notify when the player capabilities changed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
old_capsold player capabilities
new_capsnew player capabilities

◆ on_chapter_selection_changed

void(* libvlc_media_player_cbs::on_chapter_selection_changed) (void *opaque, const libvlc_title_description_t *title, unsigned title_idx, const libvlc_chapter_description_t *chapter, unsigned chapter_idx)

Callback prototype that notify when the player selected a new chapter.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
titledescription of the new selected title, valid only from this callback, do not release
title_idxindex of the title
chapterdescription of the new selected chapter, valid only from this callback, do not release
chapter_idxindex of the new selected chapter

◆ on_cork_changed

void(* libvlc_media_player_cbs::on_cork_changed) (void *opaque, bool corked)

Callback prototype that notify when the player is corked/uncorked.

Note
Optional (can be NULL), available since version 0

The player can be corked when the audio output loose focus or when a renderer was paused from the outside.

Parameters
opaqueopaque pointer set by libvlc_media_player_new()
corkedtrue if the player is corked. In that case, the user should pause the player and release all external resource needed by the player

◆ on_length_changed

void(* libvlc_media_player_cbs::on_length_changed) (void *opaque, libvlc_time_t length)

Callback prototype that notify when the player length changed.

Note
Optional (can be NULL), available since version 0

May be called when the media is opening or during playback. A started and playing media doesn't have necessarily a valid length.

Parameters
opaqueopaque pointer set by libvlc_media_player_new()
lengtha valid length or 0

◆ on_media_attachments_added

void(* libvlc_media_player_cbs::on_media_attachments_added) (void *opaque, libvlc_media_t *media, libvlc_picture_list_t *list)

Callback prototype that notify when the player added new attachments to the current media.

Note
It can be called several times for one playback. The array contains only new elements after a second call. Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
mediamedia being played/parsed
listlist of pictures, the list is only valid from this callback, each pictures can be held separatly with libvlc_picture_retain().

◆ on_media_changed

void(* libvlc_media_player_cbs::on_media_changed) (void *opaque, libvlc_media_t *media)

Callback prototype that notify when the player changed media.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
medianew played media

◆ on_media_meta_changed

void(* libvlc_media_player_cbs::on_media_meta_changed) (void *opaque, libvlc_media_t *media)

Callback prototype that notify when metadata were update by the player.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
mediamedia being played/parsed, call libvlc_media_get_meta() to get new metadata

◆ on_media_parsed

void(* libvlc_media_player_cbs::on_media_parsed) (void *opaque, libvlc_media_t *media)

Callback prototype that notify when the player parsed the current media.

Called once per media, this won't be called if the media has already been parsed by the parser, use on_media_meta_changed() to get notified when media meta is updated.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
mediamedia being played/parsed

◆ on_media_stopping

void(* libvlc_media_player_cbs::on_media_stopping) (void *opaque, libvlc_media_t *media, libvlc_stopping_reason_t stopping_reason)

Callback prototype that notify when the player will stop the current media.

Note
Optional (can be NULL), available since version 0

This can be called from the PLAYING state, before the player requests the next media, or from the STOPPING state, ie. when the player is stopping, or by an internal transition (e.g., when the media reaches the end of file or errors out).

Parameters
opaqueopaque pointer set by libvlc_media_player_new()
mediastopping media
stopping_reasonreason why the media is stopping

◆ on_media_subitems_changed

void(* libvlc_media_player_cbs::on_media_subitems_changed) (void *opaque, libvlc_media_t *media)

Callback prototype that notify when the player added new subitems to the current media.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
mediamedia being played/parsed, call libvlc_media_subitems() to get sub items

◆ on_next_frame_status

void(* libvlc_media_player_cbs::on_next_frame_status) (void *opaque, int status)

Callback prototype that notify when the next frame, following a call to libvlc_media_player_next_frame(), is about to displayed.

Note
Optional (can be NULL), available since version 0
See also
libvlc_media_player_next_frame()
Note
This callback is sent just before the frame is sent to the video output, use libvlc_media_player_watch_time() if you need to know exactly when the frame is displayed.
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
status0 in case of success, -EAGAIN on first call (paused), -EBUSY in case of video error, -ENOTSUP if can't pause, -EINVAL in case of invalid state

◆ on_position_changed

void(* libvlc_media_player_cbs::on_position_changed) (void *opaque, libvlc_time_t time, double pos)

Callback prototype that notify when the player position changed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
timea valid time or 0
posa valid position

◆ on_prev_frame_status

void(* libvlc_media_player_cbs::on_prev_frame_status) (void *opaque, int status)

Callback prototype that notify when the previous frame, following a call to libvlc_media_player_previous_frame(), is about to be displayed.

Note
Optional (can be NULL), available since version 0
See also
libvlc_media_player_previous_frame()
Note
This callback is sent just before the frame is sent to the video output, use libvlc_media_player_watch_time() if you need to know exactly when the frame is displayed.
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
status0 in case of success, -EAGAIN on first call (paused), -EBUSY in case of video error, -ENOTSUP if can't pause, -EINVAL in case of invalid state, -ERANGE if the player could not seek back

◆ on_program_list_changed

void(* libvlc_media_player_cbs::on_program_list_changed) (void *opaque, libvlc_list_action_t action, int group_id)

Callback prototype that notify when the player added, removed or updated a program.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
actionadded, removed or updated
group_idvalid group id, call libvlc_media_player_get_program_from_id() to get the program description.

◆ on_program_selection_changed

void(* libvlc_media_player_cbs::on_program_selection_changed) (void *opaque, int unselected_group_id, int selected_group_id)

Callback prototype that notify when a program is selected or unselected by the player.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
unselected_group_idvalid group id
selected_group_idvalid group id, call libvlc_media_player_get_program_from_id() to get the program description.

◆ on_recording_changed

void(* libvlc_media_player_cbs::on_recording_changed) (void *opaque, bool recording, const char *file_path)

Callback prototype that notify when the player recording state changed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
recordingtrue if recording is enabled
file_pathfile path of the recording, only valid when the recording ends (recording == false)

◆ on_screenshot_taken

void(* libvlc_media_player_cbs::on_screenshot_taken) (void *opaque, const char *file_path)

Callback prototype that notify when the player took a screenshot.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
file_pathfile path of the screenshot

◆ on_state_changed

void(* libvlc_media_player_cbs::on_state_changed) (void *opaque, libvlc_state_t state)

Callback prototype that notify when the player state changed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
statenew player state

◆ on_title_selection_changed

void(* libvlc_media_player_cbs::on_title_selection_changed) (void *opaque, const libvlc_title_description_t *title, unsigned idx)

Callback prototype that notify when the player selected a new title.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
titledescription of the new selected title, valid only from this callback, do not release
idxindex of the new title

◆ on_titles_changed

void(* libvlc_media_player_cbs::on_titles_changed) (void *opaque)

Callback prototype that notify when the player changed titles.

Note
Optional (can be NULL), available since version 0

Call libvlc_media_player_get_full_title_descriptions() to get the description of new titles.

Parameters
opaqueopaque pointer set by libvlc_media_player_new()

◆ on_track_list_changed

void(* libvlc_media_player_cbs::on_track_list_changed) (void *opaque, libvlc_list_action_t action, libvlc_track_type_t type, const char *id)

Callback prototype that notify when the player added, removed or updated a track.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
actionadded, removed or updated
typetype of the track
idvalid track id, call libvlc_media_player_get_track_from_id() to get the track description.

◆ on_track_selection_changed

void(* libvlc_media_player_cbs::on_track_selection_changed) (void *opaque, libvlc_track_type_t type, const char *unselected_id, const char *selected_id)

Callback prototype that notify when a track is selected or unselected by the player.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
typetype of tracks being unselected or selected
unselected_idvalid track id or NULL (when nothing is unselected)
selected_idvalid track id or NULL (when nothing is selected), call libvlc_media_player_get_track_from_id() to get the track description.

◆ on_vout_changed

void(* libvlc_media_player_cbs::on_vout_changed) (void *opaque, unsigned vout_count)

Callback prototype that notify when a new player vout is added or removed.

Note
Optional (can be NULL), available since version 0
Parameters
opaqueopaque pointer set by libvlc_media_player_new()
vout_countnumber of active vouts

◆ version

uint32_t libvlc_media_player_cbs::version

Version of struct libvlc_media_player_cbs.


The documentation for this struct was generated from the following file: