[vlc-devel] [PATCH] avcodec: only assume DXVA2 is used if it's forced

Rémi Denis-Courmont remi at remlab.net
Mon Mar 30 19:06:27 CEST 2015


Le lundi 30 mars 2015, 18:44:31 Steve Lhomme a écrit :
> I see,
> https://mailman.videolan.org/pipermail/vlc-devel/2014-August/099420.html
> 
> So what you're saying is that it should be done differently ?

I mean that:
1) This patch is wrong.
2) The problem was brought up a long time ago but ignored.

> I agree on that.
> 
> Since at this point we know the input format, we could check if dxva2
> will actually be able to handle, using the regular module loading and
> decide if we want FF_THREAD_FRAME or not.

No, the format is not *fully* known at this point, at least not 
systematically. libavcodec provides the final format only upon get_format() or 
get_buffer() callback invocation. (In the latter case, it means that hardware 
acceleration is not supported.)

Hardware capability checking can only happen within ffmpeg_GetFormat(), 
specifically vlc_va_New().

> Another way could be to let avcodec pick it's decoder first and if
> it's DXVA2 then we disable FF_THREAD_FRAME. I'm not sure if it's
> possible to do it in that order, but it would be much cleaner and
> logical.

As far as I know, that is not possible with current libavcodec versions. To my 
knowledge, if you want to support both multi-threading and hardware 
acceleration, you must leave multi-threading enabled. It might be slightly 
less efficient than single threading and will waste memory if hardware 
acceleration is used.

> Also #14054 has other issues like bad plane alignment, so this change
> won't be sufficient. I'm not even sure frame threading is much
> superior to slice threading.

I guess DXVA2 used to fail completely with slice threading. I do not know the 
current situation.

-- 
Rémi Denis-Courmont
http://www.remlab.net/




More information about the vlc-devel mailing list