[vlc-devel] [PATCH v3 09/14] libvlc: allow selecting the video hardware acceleration

Steve Lhomme robux4 at ycbcr.xyz
Fri Feb 14 07:58:32 CET 2020


On 2020-02-13 18:56, Rémi Denis-Courmont wrote:
> Le torstaina 13. helmikuuta 2020, 17.44.50 EET Steve Lhomme a écrit :
>> The values in the enum reflect the currently available decoder devices.
>> ---
>>   include/vlc/libvlc_media_player.h | 53 +++++++++++++++++++++++++++++++
>>   lib/libvlc.sym                    |  1 +
>>   lib/media_player.c                | 22 +++++++++++++
>>   3 files changed, 76 insertions(+)
>>
>> diff --git a/include/vlc/libvlc_media_player.h
>> b/include/vlc/libvlc_media_player.h index 5e0255a10ac..ad19c383a0c 100644
>> --- a/include/vlc/libvlc_media_player.h
>> +++ b/include/vlc/libvlc_media_player.h
>> @@ -503,6 +503,59 @@ void libvlc_video_set_format_callbacks(
>> libvlc_media_player_t *mp, libvlc_video_cleanup_cb cleanup );
>>
>>
>> +/**
>> + * Enumeration of the Video hardware processing acceleration to be used.
>> + * can be passed to @a libvlc_video_set_video_acceleration
>> + */
>> +typedef enum libvlc_video_acceleration_t {
> 
> No way.
> 
> Plugins come and go. They can be added externally, or with new versions, they
> can be removed, and of course, they depend on the platform and build options.
> They cannot be described with an enum.

The documentation says there's no guarantee it will be respected. Most 
people will never need to touch this. Those who do that's because they 
have a reason to do it.

> We've already been through this mess in the past, e.g., with the audio
> "devices" (which really were audio channel maps). Not again.
> 
> Besides the application has no interactions with the hardware acceleration: it
> provides a window (or render callbacks) and LibVLC is supposed to find the best
> way to decode accordingly. In fact, VLC's understanding of hardware

There's at least the case of D3D9 which would pick the D3D11 decoder 
device which is not the optimal choice.
In other cases NVDEC might be preferred because it can decode more 
things than DXVA (4:4:4 for example). And yet it should not be picked by 
default in most cases because it requires an extra (GPU) copy.

IMO a simple enable/disable boolean doesn't cover all the use cases. And 
relying on passing a string to libvlc_new is not good enough either. It 
forces the same setup for all mediaplayers that the instance could have, 
including the preparser.

> acceleration is really an implementation detail that does not even make much
> sense externally - SIMD is also hardware acceleration, and yet it's not
> exposed. And you might need a combination of hardware acceleration depending
> on, say, the codec.
> 
> -- 
> Реми Дёни-Курмон
> http://www.remlab.net/
> 
> 
> 
> _______________________________________________
> 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