[vlc-devel] [PATCHv3 00/17] libvlc: new track list and new track selection

Romain Vimont rom1v at videolabs.io
Wed Jun 10 16:44:11 CEST 2020


On Wed, Jun 10, 2020 at 02:57:39PM +0200, Thomas Guillem wrote:
> The full branch is available here: https://code.videolan.org/tguillem/vlc/commits/libvlc-tracks/6
> 
> Change since v2
> 
>  - libvlc_media_tracklist_at() doesn't return a const media anymore. The media
>    need to be writable by the user so that he can update the selected state
>    (via libvlc_media_player_update_tracklist()).
>  - Improved lib_media_player tests
>  - Added lib_media_player tracks API test
> 
> There is a problem with libvlc_media_tracklist_at() not returning const. The
> user might want to use libvlc_media_track_release() on a single track coming
> from the list (when he should use libvlc_media_tracklist_release()). The API &
> documentation says that it's illegal, but I'm not sure if it is enough. I could
> add assert/abort or change the way to update the track selection. What do you
> think ?

I think that it is ok (returning a const pointer implies that it must
not be deleted by the caller, but returning a non-const pointer does not
imply the opposite).

However, _release() suggests that it's refcounted. IMO
libvlc_media_track_delete() is better in that case.

> The old track API will be removed later (but before 4.0 release), when all
> major VLC ports are updated. Cf.
> https://code.videolan.org/tguillem/vlc/commits/libvlc-tracks-remove-deprecated
> for the branch without the old track API.
> 
> Best regards,
> Thomas Guillem (17):
>   lib: media: factorize track type conversion
>   lib: move libvlc_media_track_t to a specific header
>   lib: move track in media_track.c
>   lib: add libvlc_media_tracklist API
>   lib: add libvlc_media_get_tracklist()
>   lib: media_track: add new members
>   lib: add libvlc_media_track_release
>   core: fix vlc_es_id_IsStrIdStable not exposed
>   lib: add new player track API
>   lib: update media_player track events
>   test: media: use libvlc_media_get_tracklist
>   lib: video: use libvlc_media_player_get_selected_track()
>   test: media_player: use "mock://"
>   lib: media_player: fix wrong assert
>   test: lib: media_player: pause can now be always tested
>   test: lib: media_player: add event_ctx
>   test: lib: media_player: test track API
> 
>  include/vlc/libvlc_events.h       |  23 +-
>  include/vlc/libvlc_media.h        | 129 +++--------
>  include/vlc/libvlc_media_player.h | 138 ++++++++++++
>  include/vlc/libvlc_media_track.h  | 220 ++++++++++++++++++
>  lib/Makefile.am                   |   2 +
>  lib/libvlc.sym                    |  11 +
>  lib/media.c                       | 113 ++--------
>  lib/media_internal.h              |  58 +++++
>  lib/media_player.c                | 193 ++++++++++++++--
>  lib/media_player_internal.h       |   1 +
>  lib/media_track.c                 | 264 ++++++++++++++++++++++
>  lib/video.c                       |  22 +-
>  src/libvlccore.sym                |   1 +
>  test/libvlc/media.c               |  31 ++-
>  test/libvlc/media_list_player.c   |  20 +-
>  test/libvlc/media_player.c        | 362 ++++++++++++++++++++++++++++--
>  test/libvlc/test.h                |   5 +-
>  17 files changed, 1328 insertions(+), 265 deletions(-)
>  create mode 100644 include/vlc/libvlc_media_track.h
>  create mode 100644 lib/media_track.c
> 
> -- 
> 2.20.1
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list