[vlc-devel] [RFC PATCH 6/6] lib: add a new libvlc_media_player track selection API

Rémi Denis-Courmont remi at remlab.net
Wed Jun 3 18:12:54 CEST 2020


Le tiistaina 2. kesäkuuta 2020, 23.02.10 EEST Thomas Guillem a écrit :
> ---
>  include/vlc/libvlc_media_player.h |  89 ++++++++++++++++++++++++++
>  include/vlc/libvlc_media_track.h  |   4 ++
>  lib/media_internal.h              |  19 ++++++
>  lib/media_player.c                | 103 ++++++++++++++++++++++++++++++
>  lib/media_player_internal.h       |   3 +
>  lib/media_track.c                 |  48 ++++++++++++++
>  6 files changed, 266 insertions(+)
> 
> diff --git a/include/vlc/libvlc_media_player.h
> b/include/vlc/libvlc_media_player.h index a6f5fbf8e5..ad4ae7e88e 100644
> --- a/include/vlc/libvlc_media_player.h
> +++ b/include/vlc/libvlc_media_player.h
> @@ -1284,6 +1284,95 @@ LIBVLC_API void libvlc_media_player_navigate(
> libvlc_media_player_t* p_mi, */
>  LIBVLC_API void libvlc_media_player_set_video_title_display(
> libvlc_media_player_t *p_mi, libvlc_position_t position, unsigned int
> timeout );
> 
> +/**
> + * Get the track list for one type
> + *
> + * \version LibVLC 4.0.0 and later.
> + *
> + * \note You need to call libvlc_media_parse_with_options() or play the
> media + * at least once before calling this function.  Not doing this will
> result in + * an empty list.
> + *
> + * \note This track list is a snapshot of the current tracks when this
> function + * is called. If a track is updated after this call, the user
> will need to call + * this function again to get the updated track.
> + *
> + *
> + * The track list can be used to get track informations and to select
> specific + * tracks.
> + *
> + * \param p_mi the media player
> + * \param type type of the track list to request
> + *
> + * \return a valid libvlc_media_tracklist_t or NULL in case of error, if
> there + * is no track for a category, the returned list will have a size of
> 0, delete + * with libvlc_media_tracklist_release()
> + */
> +LIBVLC_API libvlc_media_tracklist_t *
> +libvlc_media_player_get_tracklist( libvlc_media_player_t *p_mi,
> +                                   libvlc_track_type_t type );
> +
> +
> +/**
> + * Get the selected track for one type
> + *
> + * \version LibVLC 4.0.0 and later.
> + *
> + * \warning More than one tracks can be selected for one type. In that
> case, + * libvlc_media_player_get_tracklist() should be used.
> + *
> + * \param p_mi the media player
> + * \param type type of the selected track
> + *
> + * \return a valid track or NULL if there is no selected tracks for this
> type, + * the returned track can only be used to get track informations
> (selection is + * not possible) and is valid until the next call to
> + * libvlc_media_player_get_selected_track()

What happens to the last track when the media player is deleted?

Also weird/long sentence construction.

Doc aside, the set looks good.


-- 
レミ・デニ-クールモン
http://www.remlab.net/





More information about the vlc-devel mailing list