Commit Graph

843 Commits

Author SHA1 Message Date
Romain Vimont fb48df6fdf executor: introduce new executor API
Introduce a new API to execute "runnables" from background threads.

The final design is a result of discussions on the mailing-list:
 - <https://mailman.videolan.org/pipermail/vlc-devel/2020-August/136696.html>
 - <https://mailman.videolan.org/pipermail/vlc-devel/2020-September/136944.html>

Signed-off-by: Alexandre Janniaux <ajanni@videolabs.io>
2020-10-23 16:34:09 +02:00
Rémi Denis-Courmont 319efddd43 sout: deinline sout_stream_t calls 2020-10-12 18:02:45 +03:00
Rémi Denis-Courmont 96d67cec94 demux: de-inline demux_Demux() 2020-09-28 17:39:55 +03:00
Rémi Denis-Courmont 656a30c61a modules: export vlc_module_map() 2020-09-26 09:39:51 +03:00
Rémi Denis-Courmont 616b8d744e modules: export vlc_module_match() 2020-09-26 09:39:51 +03:00
Steve Lhomme 9d04aca6c0 picture_fifo: replace picture_fifo_Peek with picture_fifo_IsEmpty
The only use of picture_fifo_Peek() is to check whether the FIFO is empty.
No need to get a picture and release it just after for that.
2020-09-21 07:09:27 +02:00
Steve Lhomme a8321cde7b picture_fifo: remove unused picture_fifo_OffsetDate
Anyone who needs this can probably handle the shift on their side.
2020-09-21 07:09:27 +02:00
Rémi Denis-Courmont d549d93e40 vlc_spawn: vector posix_spawn/fork code
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.
2020-09-20 12:52:21 +03:00
Steve Lhomme d5916041b9 display: remove unused vout_display_SendEventPicturesInvalid()
And related internal variable/functions.
2020-09-03 07:47:22 +02:00
Thomas Guillem e8f1730814 player: add a metadata listener API
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.
2020-08-26 16:01:11 +02:00
Thomas Guillem 0d87079613 aout: add the vlc_audio_meter API
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.
2020-08-26 16:01:11 +02:00
Steve Lhomme d055a8dc15 picture_pool: make picture_pool_GetSize private 2020-07-29 10:05:58 +02:00
Steve Lhomme a0fcf5cf69 codec: remove unused decoder_AbortPictures()
Unused since 6fc5e2bc5f
2020-07-29 10:05:57 +02:00
Thomas Guillem d3dd117c8d player: add vlc_player_aout_Reset 2020-07-24 09:08:46 +02:00
Thomas Guillem a11d8d8c94 input: unexport input_resource_ResetAout() 2020-07-24 09:08:46 +02:00
Thomas Guillem a64695dd92 Revert "input: remove unused input_resource_ResetAout() function"
This reverts commit 72d3ebd544.
2020-07-24 09:08:46 +02:00
Alexandre Janniaux 5579c0e6ea src: export filter_chain_ForEach
...so that the function can be used in modules.
2020-06-25 12:46:25 +02:00
Hugo Beauzée-Luyssen 7cbdb33cce medialib: Add bookmark support 2020-06-22 15:12:29 +02:00
Thomas Guillem e6b0d55fc0 core: fix vlc_es_id_IsStrIdStable not exposed 2020-06-11 14:13:29 +02:00
Rémi Denis-Courmont c2b0572541 sdp: take last function out of core
This really does not seem to belong there. Move it in the modules
directory where its two users are located.
2020-04-20 18:05:26 +03:00
Marvin Scholz 828fafb3d9 src: remove old md5 API 2020-04-16 12:06:12 +02:00
Marvin Scholz c4ada92ee8 src: add cleaner md5 API
This API is intended to replace the existing MD5 hashing API.
It uses properly prefixed functions and has documentation.
2020-04-16 12:06:12 +02:00
Marvin Scholz 5f38902ab7 strings: add function to hex-encode binary data 2020-04-16 12:06:12 +02:00
Rémi Denis-Courmont 217f20bf73 threads: add vlc_sem_trywait() 2020-04-13 19:52:29 +03:00
Rémi Denis-Courmont 40fccf9121 queue: add generic queue/FIFO helpers
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.
2020-04-13 13:50:16 +03:00
Rémi Denis-Courmont 6cef4a3d6d fifo: inline trivial functions 2020-04-13 13:17:26 +03:00
Rémi Denis-Courmont 8073567ad3 sdp: remove no longer used sdp_AddMedia() 2020-04-02 17:11:02 +03:00
Rémi Denis-Courmont b58aacd574 sdp: remove no longer used sdp_AddAttribute() 2020-04-02 17:11:02 +03:00
Rémi Denis-Courmont 6f7144d819 network: add convenience wrappers for send/sendto/sendmsg 2020-03-29 17:07:17 +03:00
Thomas Guillem 3d275aded4 decoder: rename input_Decoder*() to vlc_input_decoder_()
In order to match with vlc_input_decoder_t.
2020-03-19 09:20:23 +01:00
Steve Lhomme fb89621ad5 vlc_threads: remove unused vlc_thread_self / vlc_thread_equal / vlc_osthread_t 2020-03-02 14:49:00 +01:00
Thomas Guillem dacc3d5ab3 player: add vlc_player_SelectTracksByStringIds() 2020-02-28 20:29:35 +01:00
Thomas Guillem 985385db73 es_out: add vlc_es_id_GetStrId()
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.
2020-02-28 20:29:35 +01:00
Rémi Denis-Courmont a18c4d6570 thread: remove vlc_cond_destroy() 2020-02-21 19:17:53 +02:00
Rémi Denis-Courmont a3226cf890 thread: remove vlc_mutex_destroy() 2020-02-21 19:16:09 +02:00
Rémi Denis-Courmont e7eb4a46fe thread: remove the mutex mark system
This is now redundant.
2020-02-21 19:15:58 +02:00
Rémi Denis-Courmont 91ddbab8e4 thread: add vlc_sem_timedwait() 2020-02-17 18:47:14 +02:00
Rémi Denis-Courmont 6d324addef thread: remove vlc_sem_destroy()
This has become a useless no-op on all platforms.
2020-02-17 18:44:05 +02:00
Pierre Lamot dffaaca48e media_tree: allow preparse tasks to be canceled
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>
2020-02-13 11:06:27 +01:00
Steve Lhomme 735bf79324 picture_pool: don't make picture_pool_NewExtended public anymore
It's strictly equivalent to picture_pool_New().
2020-01-23 11:35:59 +01:00
Hugo Beauzée-Luyssen 24ae03977d player: Expose vlc_player_RestorePlaybackPos 2020-01-23 09:25:43 +01:00
Steve Lhomme 6286e6bf94 encoder: add vlc_ prefix to the new API
encoder_ APIs didn't exist so far.
2020-01-08 13:09:50 +01:00
Steve Lhomme 61b6c9b08a encoder: add a function to get the decoder device to use with the encoder
Similar to decoder_GetDecoderDevice() but for the encoder.
2020-01-08 12:41:55 +01:00
Steve Lhomme 36a7c36829 decoder device: allow modules to create a decoder device
Like the transcoder or the mosaic bridge.
2019-12-09 11:50:25 +01:00
Steve Lhomme 651ca66cc7 filter_chain: add function to get the current output video context
Similar to how we get the current output video format.
2019-12-02 13:42:15 +01:00
Steve Lhomme 8e31e10cd3 video context: allow storing typed extra data in the video context
Each video context can store extra objects, like the IDirect3DDevice9* for D3D9,
which is not found in the decoder device.
2019-10-18 09:46:29 +02:00
Steve Lhomme b195f2d937 video context: make the video context structure private
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.
2019-10-18 09:46:26 +02:00
Steve Lhomme 4dbf653b84 video context: add a Create/Release function for the video context 2019-10-18 09:46:26 +02:00
Steve Lhomme 5c2a870b7e decoder: split the decoder format update in 2 parts
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.
2019-10-18 09:46:24 +02:00
Thomas Guillem 9733154628 player: add the timer API
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.
2019-09-23 13:30:30 +02:00