[vlc-devel] [PATCH] nvdec: set a higher priority than libavcodec

Steve Lhomme robux4 at ycbcr.xyz
Wed Mar 18 08:12:23 CET 2020


On 2020-03-17 17:08, Steve Lhomme wrote:
> On 2020-03-17 17:02, Jean-Baptiste Kempf wrote:
>> What do other hw decoder do in terms of priority?
> 
> It doesn't really matter because they are loaded by lavc. So they don't 
> come before or after nvdec.

Actually, it does matter. nvdec will only be used if it finds the 
matching decoder device. So the first successfully picked decoder 
device, which decides which hardware decoder(s) can be used, will decide 
whether nvdec will be used or not.

For now on Windows nvdec has a lower priority than D3D11 & D3D9. On 
Linux it has the same priority as VDPAU+OpenGL and higher than VAAPI.

These values can be adjuster regardless of this patch. But it's 
currently not possible to enable nvdec easily (from the UI) without this 
patch.

>> Also, why is avcodec not the 100 prio?
> 
> It seems 100 is for decoders specialized in one codec that might be 
> better than broad lavc.
> 
>> On Tue, Mar 17, 2020, at 11:38, Steve Lhomme wrote:
>>> We can detect early if the stream will be usable or not without 
>>> loading any
>>> resources. If the codec is not handled or the decoder device picked 
>>> by the user
>>> or system doesn't match we will fallback to the next decoder (likely 
>>> lavc).
>>> ---
>>>   modules/hw/nvdec/nvdec.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/modules/hw/nvdec/nvdec.c b/modules/hw/nvdec/nvdec.c
>>> index ba6b0514542..81c5e8c2f47 100644
>>> --- a/modules/hw/nvdec/nvdec.c
>>> +++ b/modules/hw/nvdec/nvdec.c
>>> @@ -58,7 +58,7 @@ static const int ppsi_deinterlace_type[] = {
>>>   vlc_module_begin ()
>>>       set_description(N_("NVDEC video decoder"))
>>>       set_shortname("nvdec")
>>> -    set_capability("video decoder", 60)
>>> +    set_capability("video decoder", 80)
>>>       set_category(CAT_INPUT)
>>>       set_subcategory(SUBCAT_INPUT_VCODEC)
>>>       add_integer( "nvdec-deint", cudaVideoDeinterlaceMode_Bob,
>>> -- 
>>> 2.17.1
>>>
>>> _______________________________________________
>>> vlc-devel mailing list
>>> To unsubscribe or modify your subscription options:
>>> https://mailman.videolan.org/listinfo/vlc-devel
>>
>> -- 
>> Jean-Baptiste Kempf -  President
>> +33 672 704 734
>>
> _______________________________________________
> 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