Add a new event notifying when the current media is stopping.
The media can be stopping without the player being stopping, ie. when
the media is finished and the player prepares the next one, but also
when the player changes media while having the player in the
VLC_PLAYER_STATE_PLAYING state.
The event will also be fired when the player is simply stopping, in
which case we expect that VLC_PLAYER_STATE_STOPPING is signaled before
the input is actually stop, which is coherent with the current
behaviour.
include/vlc_player.h:2238: warning: The following parameter of vlc_player_AddMetadataListener(vlc_player_t *player, enum vlc_player_metadata_option option, const union vlc_player_metadata_cbs *cbs, void *cbs_data) is not documented:
parameter 'option'
include/vlc_player.h:132: warning: The following parameter of 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) is not documented:
parameter 'lock_type'
include/vlc_player.h:897: warning: The following parameters of vlc_player_GetSignal(vlc_player_t *player, float *quality, float *strength) are not documented:
parameter 'quality'
parameter 'strength'
include/vlc_player.h:790: warning: The following parameter of vlc_player_SetAtoBLoop(vlc_player_t *player, enum vlc_player_abloop abloop) is not documented:
parameter 'abloop'
include/vlc_player.h:1010: warning: The following parameter of vlc_player_title_list_GetAt(vlc_player_title_list *titles, size_t idx) is not documented:
parameter 'titles'
When the input is stopped or an error occurred, the capabilities
should reflect that, so that on_capabilities_changed is invoked
as expected.
Fix#27047
And use the loudness measurement as a first use case.
The main difference between metadata listeners the player listeners are:
- The information returned by metadata events is mainly useful for the UI, it
should not be used to control the player.
- It's not possible to call or lock the player from metadata events
- Registering a metadata could cost some CPU cycle since it may spawn a
measurement filter to get the requested metadata. Such cost should be
explained in the comment of vlc_player_metadata_option enum.
Some player events could be moved to metadata events, like the statistics one.
Any interface or control modules could request a timer from the player. This
player timer is like the player event listener except that:
- It is only used to receive time update points0:
- The timer is not locked by the player lock. Indeed the player lock can be
too "slow" (it can be recursive, it is used by the playlist, and is it held
when sending all events). So it's not a good idea to hold this lock for
every frame/sample updates.
- The minimum delay between each updates can be configured: it avoids to flood
the UI when playing a media file with very high fps or very low audio sample
size.
The time updated is the output time, unlike the on_position_changed event that
use the input time. It can fixes a very big delay between the UI time widgets
and the outputted content (depending on the audio output module, this delay
could be close to 2seconds).
The vlc_player_timer_point struct is used by timer update callbacks. This
public struct hold all the informations to interpolate a time at a given date.
It could be done with the vlc_player_timer_point_Interpolate() helper. That
way, it is now possible to get the last player time without holding any locks.
There are two timer types:
- vlc_player_AddTimer(): update are sent only when a frame or a sample is outputted. Users of
this timer should take into account that the delay between each updates is
not regular and can be up to 1seconds (depending of the input). In that
case, they should use their own timer (from their mainloop) and use
vlc_player_timer_point_Interpolate() to get the last time.
- vlc_player_AddSmpteTimer(): send a SMPTE timecode each time a frame is
rendered. This timer use a different callback struct and data struct:
vlc_player_timer_smpte_timecode. It's not possible to interpolate it, the UI
should update its widgets once it receive the new timecode update. This
SMPTE timer handle NTSC 29.97 and 59.94 drop frames and is frame accurate.
Document that vlc_player_t functions should not be called from these callbacks.
A player function could trigger an action on the vout/aout and cause a callback
to be called => deadlock.
Remove the vlc_player_t * argument, it was never used.
Add the audio_output_t *argument for aout callbacks. It's not currently used,
it is added as symmetry with vout callbacks.
Group every struct/enum/functions by group instead of having all structs, all
enums then all functions.
Split the header by the following doxygen groups:
- Player instance
- Playback control
- Title and chapter control
- Program control
- Tracks control
- Tracks synchronisation (delay)
- Teletext control
- External renderer control
- Audio output control
- Video output control
- Player events
No functional changes.
vlc_player_GetVoutFromEsId() can now return the vout used by an SPU es_id.
It also returns the vout order.
The on_vout_changed callback is also used for SPU es_ids. Users could check the
category of the es_id to know if the vout is attached to a VIDEO es or an SPU
one.
A new function vlc_player_SelectEsIdList() and implement
VLC_PLAYER_SELECT_SIMULTANEOUS.
vlc_player_SelectEsId() now returns the number of tracks selected for the track
category.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
It was only used by hotkeys that has now its own implementation.
This API is too confusing and hard to mantain, specially with the dual track
support comming.
No real functional changes. Changes the callback and enum names to reflect the
real event: vout are now started and stopped. The same vout can be started and
stopped several time.
The capabilities are stored in a bitset. When it changes, it may be
useful to know its old value, to know which capability changed.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
There were helpers for retrieving the selected title, chapter or track,
but a helper for the selected program was missing.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>