This will be used by libvlc_media to store the media instance into an
input_item. This will allow to get the media corresponding to an item
when propagating media events.
We already count the number of displayed frames, the number of dropped frames
(called lost). We should also count the frames that are actually displayed but
not in the desired time. It usually indicates the decoder is too slow or the
rendering to the display is too slow even though it may not be directly
visible (movements not smooth).
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.
This effectively split input_item_parser_id_Release in 2 functions,
allowing an asynchronous cancellation to occur.
Otherwise, the input thread would invoke the callback synchronously
while the thread cancelling the preparser is blocked joining the input
thread. Both those thread are very likely to be called with a mutex
held, which would cause a deadlock.
This function doesn't use a background thread, contrary to
libvlc_MetadataRequest(). It will be used by the Medialibrary that has its own
background thread.
The function input_item_node_RemoveNode(), declared in vlc_input_item.h,
was not exported (contrary to input_item_node_AppendNode()).
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
Expose a function which does not lock internally so that we can retrieve
several meta values in a row without locking/unlocking.
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
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.
A duration cannot be invalid and the define is used for items where a duration
should not be set like nodes and directories.
It's also used by input_item_New() on items that don't have the duration when
the source is parsed by may get it when parsed in the input thread.
Add a new parameter: psz_flatpath. If not NULL, readdir_helper_additem() will
un-flatten the folder hierarchy. It will create an input item for each sub
folders (separated by '/') of psz_nullpath.
Example: a stream directory that have the following items:
- "foo/bar/item1"
- "foo/bar/item2"
will output the following items while using this new parameter:
- foo
- bar
- item1
- item2
This functionality can be used by "stream directory" modules that have a
flattened folder hierarchy, like libarchive.
Access modules should not need this functionality.