This adds vlc_spawn(), vlc_spawnp() and vlc_waitpid() to factor the
common code around the posix_spawn() family. It is added as part of
the plugin API so that core code can use it (namely vlc_getProxyUrl()),
which would not be possible with a shared C source in modules/.
Win32 back-end may be provided later, e.g. based on old vlc_execve()
implementation, if/when this actually gets used on Windows.
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.
This API will be used by the aout, and could be used by any visualisation
module needing audio measurements.
This API allows to create "audio meter" filters plugins. This new type of
filter is measuring audio blocks without modifying them and send the
measurement via audio filters callbacks. These events are then propagated to
vlc_audio_meter events.
Currently, the FIFO helpers are tied to block_t. This has proven problematic
in the past: some code uses block_t only for the sake of block_fifo_t. It
will get worse with the introduction of separate vlc_frame_t and vlc_data_t.
This provides a generic C implementation of a thread-safe queue. It is very
much meant to be wrapped with more type-specific helpers.
This string id will be used to identify an ES track across different playback
instances.
For now, only ts/ps/bluray demuxers give stable ids, cf. future commits.
If we need to release the media tree before the preparse ends
the preparse callback will likely crash.
This allows to pass an optional task id to vlc_media_tree_Preparse and to
cancel it afterwards
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
The video context will be passed to various modules up to the display where it
will be ultimately released when the last associated picture will be released.
It needs to be refcounted and we need a destructor to do this final release.
By default the video context holds a reference to the matching decoder device.
This reference is released with the video context.
The first part is to create the decoder device.
The second part is to create the display module (or other depending on the
decoder owner).
Turn decoder_UpdateVideoFormat() is calling the two new functions.
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.