Commit Graph

709 Commits

Author SHA1 Message Date
Rémi Denis-Courmont cc129a71d7 Remove old mail address from sources 2019-09-04 22:11:04 +03:00
Thomas Guillem 5ca9d7ea53 preparser: merge item locks
Since input_preparser_Push() is necessarilly called from vlc_MetadataRequest().
2019-08-26 09:27:10 +02:00
Thomas Guillem b063dca4d2 prepaser: change options handling
Reminder of the current behavior: the meta fetcher is either always triggered
after the preparser is finished or manually.

This commit aims to give more controls so that the meta fetcher is not
necessarily triggered after a preparsng.

The current behavior of macOS/playlist/mediatree is unchanged (the components
touching the preparser).

Here are the API changes for

libvlc_MetadataRequest():

 - Can't be called without a valid META_REQUEST_OPTION_SCOPE_* flag

 - The flag META_REQUEST_OPTION_SCOPE_* is not fetching meta anymore. Use
   (META_REQUEST_OPTION_SCOPE_*|META_REQUEST_OPTION_FETCH_*) to fetch meta when
   the preparsing ends.

libvlc_ArtRequest():

 - Can't be called without a valid META_REQUEST_OPTION_FETCH_* flag.

 - The META_REQUEST_OPTION_FETCH_NETWORK flag will now only fetch meta via
   network.

libvlc_media_parse_with_options():

 - The flag libvlc_media_parse_* is not fetching meta anymore. Use
   libvlc_media_fetch_* to fetch meta when the preparsing ends.
 - The libvlc_media_fetch_network flag will now only fetch meta via network.
2019-08-26 09:27:10 +02:00
Thomas Guillem ee4afd6821 remove unused #include <vlc_input.h> 2019-06-03 16:15:55 +02:00
Thomas Guillem c67934b0b4 remove vlc_playlist_legacy 2019-05-10 09:43:31 +02:00
Steve Lhomme 6a4f370211 Revert "libvlc: add leak debugging code"
This reverts commit 496001e6a2.

The objects don't leak anymore.
2019-04-15 08:47:58 +02:00
Thomas Guillem 6bfa359434 libvlc: remove usage of static mutex
The main_playlist and interface list are now protected by a mutex of the libvlc
instance.

The old playlist is still protected by the old static mutex.
2019-04-10 14:11:51 +02:00
Victorien Le Couviour--Tuffet 84d7b79afb intf: switch to the new playlist
The intf parent change from playlist to libvlc.

For the transition, pl_Get() is still functional but will return a different
playlist than the main one. Interfaces relying on pl_Get() won't be able to
interact with other interfaces, control or medias added by command line. This
call will soon be removed.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2019-04-10 14:11:51 +02:00
Victorien Le Couviour--Tuffet a2e690595d libvlc: create intf legacy playlist vars
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2019-04-10 14:11:51 +02:00
Rémi Denis-Courmont efd4a8472e objects: remove constant (1) member 2019-03-17 03:23:59 +02:00
Steve Lhomme 496001e6a2 libvlc: add leak debugging code
disabled by default
2019-03-14 11:13:36 +01:00
Jean-Baptiste Kempf 4cf85b214b intf: fix win32 build 2019-03-08 18:31:40 +01:00
Thomas Guillem 40acc0491a intf: move linked-list head to libvlc_priv_t
For the playlist_t => vlc_playlist_t transition.
2019-03-08 09:45:50 +01:00
Rémi Denis-Courmont 07b7122857 objects: introduce vlc_object_delete()
Objects have one strong reference held by their "owner", and zero or
more weak references generated by vlc_object_hold() et al. This
provides a separate function to remove the strong reference than
vlc_object_release() to remove weak ones.

With this sole change, this is really only an annotation though.
2019-03-06 22:53:24 +02:00
Rémi Denis-Courmont 420f6350db messages: rationalize vlc_LogSwitchCreate() 2019-02-27 19:01:56 +02:00
Rémi Denis-Courmont fc558be98b messages: develop the final free() per logger
This removes a baroque static_assert().
2019-02-27 19:01:56 +02:00
Thomas Guillem 7f9fea630e core: lazy initialization of the new (main) playlist
This avoid to always create a player, vout, and an aout.
2019-02-21 13:10:55 +01:00
Rémi Denis-Courmont bc17cd8e67 libvlc: remove the private logger
The public logger can be used.
2019-02-20 20:02:33 +02:00
Rémi Denis-Courmont 91743e4de7 messages: simplify vlc_LogDeinit()
In the final deinitialization, there is no thread safety and
logger replacement. The existing logger is simply deleted.

Also rename it to vlc_LogDestroy() and take a logger pointer rather
than the VLC instance.
2019-02-20 17:35:01 +02:00
Steve Lhomme 5363279805 remove the $Id$ in the source code 2019-01-17 12:21:18 +01:00
Romain Vimont 3e0cc1942a media source: introduce media source/tree API
Add an API to manage "services discovery" easily from UI clients.

A "media source provider" allows to retrieve media sources (each
associated to a services discovery module).

A media source holds a media tree, containing both the media detected by
the services discovery module and the media detected by preparsing.
Clients may listen to the tree to be notified of changes.

A client may retrieve a media source at any time and listen to its
media tree, even if it is already populated, without race condition.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-11-26 11:56:16 +01:00
Rémi Denis-Courmont ce233a82f6 log: refuse to run without a logger 2018-11-18 17:56:52 +02:00
Romain Vimont 76e5753074 core: player: configure main player from vars
Initialize the main playlist player settings from VLC variables.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-11-15 17:22:07 +01:00
Romain Vimont cce2c6b2e8 core: playlist: configure main playlist from vars
Initialize the main playlist playback order and repeat mode from VLC
variables.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-11-15 17:22:07 +01:00
Romain Vimont 2477b6a479 core: playlist: expose a main playlist instance
Store a main instance of the playlist in libvlc, accessible via
vlc_intf_GetMainPlaylist().

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-11-15 17:22:07 +01:00
Thomas Guillem 034a3f75a2 core: move playlist to playlist_legacy
To make room for the new playlist.
This playlist_legacy will be removed once all modules are using the new
playlist.
2018-11-15 14:54:00 +01:00
Hugo Beauzée-Luyssen a9014afdac lib: Add thumbnailing support
Fix #17368
2018-11-12 17:09:05 +01:00
Hugo Beauzée-Luyssen 946b67f964 core: Add a thumbnailing API
ref #17368
2018-11-12 17:09:05 +01:00
Romain Vimont 7725b10254 fetcher: provide events in callbacks
Notify "fetch ended" in callbacks.

This will allow to move the "preparse ended" trigger from the fetcher to
the preparser, and make the fetcher more independant.
2018-08-20 13:51:28 +02:00
Romain Vimont 812579453b preparser: provide events in callbacks
The input thread used by the preparser is not exposed to the caller.
Add a "callbacks" parameter to receive preparsing events.
2018-08-20 13:51:28 +02:00
Filip Roséen d2ab9d8342 core: libvlc_MetadataRequest: use vlc_MetadataRequest
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-07-25 11:35:02 +02:00
Filip Roséen d2c29640ff core: add vlc_MetadataRequest
This function is to be used by entities within the core that would
like to spawn a metadata request. Such request will not have the
implicit recursiveness of libvlc_MetadataRequest (which is to be
called by users of libvlc).

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-07-25 11:35:02 +02:00
Hugo Beauzée-Luyssen 3218716868 libvlc: Instantiate media library module 2018-07-17 23:53:01 +02:00
Romain Vimont c784e8ce4f core: Move preparser out of the playlist
The preparser was implemented in playlist code, but it was (already)
independant of the playlist.

Therefore, move the implementation to a separate folder and rename the
functions.

Signed-off-by: Thomas Guillem <thomas@gllm.fr>
2018-07-02 10:13:40 +02:00
Rémi Denis-Courmont 26f6332745 libvlc: use var_InheritString() 2018-05-31 22:02:46 +03:00
Rémi Denis-Courmont 8d46058e2e vlm: read vlm-conf variable just once 2018-05-31 22:00:34 +03:00
Rémi Denis-Courmont 75dd0452bf libvlc: do not create pidfile variable pointlessly 2018-05-31 21:54:01 +03:00
Rémi Denis-Courmont bd00749be9 playlist: move pop-up menu variable 2018-05-31 21:07:31 +03:00
Rémi Denis-Courmont 4cedca0714 playlist: move FSC trigger and make it void 2018-05-31 21:00:14 +03:00
Rémi Denis-Courmont 6f485a389b playlist: move intf-boss variable 2018-05-31 20:06:41 +03:00
Rémi Denis-Courmont 4c1816844e playlist: move intf-show and make it void 2018-05-31 20:06:41 +03:00
Rémi Denis-Courmont 6d8f2d6fa3 libvlc: do not exit early without modules
Let the vlc binary instantiate LibVLC correctly. It will fail to initialize the
interface and handle the error commonly there.
2018-03-11 02:09:06 +02:00
Rémi Denis-Courmont 2a05a1ff46 libvlc: do not cache "stats" value
There are no reasons why it couldn´t change between two inputs.
2017-12-12 20:36:01 +02:00
Thomas Guillem fa27e5e41c actions: refactor init/deinit functions
Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
2017-08-09 10:48:05 +02:00
Rémi Denis-Courmont d1a46c49de core: remove stray #include 2017-06-18 17:40:41 +03:00
Rémi Denis-Courmont ba8117c4fb posix: move D-Bus one-instance to system_Configure()
This takes the platform-specific wart out of common initialization
code, and into the same callback as the equivalent Windows code.
2017-06-18 17:40:38 +03:00
Filip Roséen befb82c28d playlist: fix deadlock on destruction while preparser adds items to playlist
As we can have incoming requests to the preparser while we are
destroying libvlc, we can end up in a deadlock while we are removing
all playlist_item_t from the playlist, while an item being preparsed
tries to add additional items to the list.

These changes fixes the issue by introducing a preparser-deactivation
function, that will make sure that we:

 1) clear out any pending preparsing requests
 2) cancel the current item preparsing (blocking)
 3) prevent further requests to the preparser

fixes: #18151

Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
2017-03-29 17:35:29 +02:00
Rémi Denis-Courmont b0ac3e5cae libvlc: fix NULL dereference
The vlc_custom_create() macro assumes that the first parameter is a
valid pointer by way of the VLC_OBJECT() macro. So call the
vlc_custom_create() function instead.
2017-02-06 22:47:38 +02:00
Thomas Guillem b5cb4dadf8 libvlc: fix leaks if init fails 2016-09-20 17:10:17 +02:00
Rémi Denis-Courmont 17bd88b915 Revert "libvlc: delete preparser before interfaces"
This reverts commit 9e9b227443.

The preparser must obviously outlive the playlist (and thus interfaces).
This fixes use after free:

ERROR: AddressSanitizer: heap-use-after-free on address 0x611000005548 at pc 0x7fad5e11bffa bp 0x7fad50daac10 sp 0x7fad50daac08
READ of size 8 at 0x611000005548 thread T1
    #0 0x7fad5e11bff9 in playlist_preparser_fetcher_Push ../../src/playlist/preparser.c:128
    #1 0x7fad5e0e7640 in libvlc_ArtRequest ../../src/libvlc.c:648
    #2 0x7fad5e10ad37 in PlayItem ../../src/playlist/thread.c:232
    #3 0x7fad5e10d167 in Next ../../src/playlist/thread.c:478
    #4 0x7fad5e10d448 in Thread ../../src/playlist/thread.c:501
    #5 0x7fad5fba3463 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x7463)
    #6 0x7fad5f6dce5c in clone (/lib/x86_64-linux-gnu/libc.so.6+0xe8e5c)

0x611000005548 is located 8 bytes inside of 208-byte region [0x611000005540,0x611000005610)
freed by thread T0 here:
    #0 0x7fad60ea69d0 in free (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc19d0)
    #1 0x7fad5e11cf8f in playlist_preparser_Delete ../../src/playlist/preparser.c:184
    #2 0x7fad5e0e6b53 in libvlc_InternalCleanup ../../src/libvlc.c:512
    #3 0x7fad60b2ed14 in libvlc_release ../../lib/core.c:105
    #4 0x4024da in main ../../bin/vlc.c:275
    #5 0x7fad5f6145ef in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x205ef)

previously allocated by thread T0 here:
    #0 0x7fad60ea6ce8 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc1ce8)
    #1 0x7fad5e11b3cd in playlist_preparser_New ../../src/playlist/preparser.c:74
    #2 0x7fad5e0e62a2 in libvlc_InternalInit ../../src/libvlc.c:374
    #3 0x7fad60b2e6d3 in libvlc_new ../../lib/core.c:59
    #4 0x4022dd in main ../../bin/vlc.c:228
    #5 0x7fad5f6145ef in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x205ef)

Thread T1 created by T0 here:
    #0 0x7fad60e15f19 in pthread_create (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x30f19)
    #1 0x7fad5e30d9f6 in vlc_clone_attr ../../src/posix/thread.c:484
    #2 0x7fad5e30dbd8 in vlc_clone ../../src/posix/thread.c:496
    #3 0x7fad5e1091a9 in playlist_Activate ../../src/playlist/thread.c:54
    #4 0x7fad5e1117a0 in playlist_Create ../../src/playlist/engine.c:299
    #5 0x7fad5e106139 in intf_GetPlaylist ../../src/interface/interface.c:149
    #6 0x7fad5e1061d9 in intf_InsertItem ../../src/interface/interface.c:165
    #7 0x7fad5e0e72f7 in GetFilenames ../../src/libvlc.c:605
    #8 0x7fad5e0e6979 in libvlc_InternalInit ../../src/libvlc.c:488
    #9 0x7fad60b2e6d3 in libvlc_new ../../lib/core.c:59
    #10 0x4022dd in main ../../bin/vlc.c:228
    #11 0x7fad5f6145ef in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x205ef)

SUMMARY: AddressSanitizer: heap-use-after-free ../../src/playlist/preparser.c:128 in playlist_preparser_fetcher_Push
2016-06-16 23:39:28 +03:00