[vlc-devel] [vlc-commits] va: mostly remove the setup callback

Rémi Denis-Courmont remi at remlab.net
Wed Apr 6 10:59:49 CEST 2016


Le 2016-04-06 10:39, Steve Lhomme a écrit :
> On Mon, Feb 29, 2016 at 5:38 PM, Steve Lhomme <robux4 at gmail.com> 
> wrote:
>> On Sun, Sep 27, 2015 at 9:57 PM, Rémi Denis-Courmont 
>> <git at videolan.org> wrote:
>>> vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun 
>>> Sep 27 16:01:52 2015 +0300| 
>>> [0ce8fcaeb1050c323ecaeef3b25c548698597799] | committer: Rémi 
>>> Denis-Courmont
>>>
>>> va: mostly remove the setup callback
>>>
>>> The coded video size is already fixed by the decoder when creating 
>>> the
>>> vidoe acceleration plugin, while the chroma is fixed by
>>> vlc_va_GetChroma(). This callback is useless.
>>>
>>>> 
>>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=0ce8fcaeb1050c323ecaeef3b25c548698597799
>>> ---
>>>
>>>  modules/codec/avcodec/va.c    |   10 ++++++++++
>>>  modules/codec/avcodec/va.h    |   12 +++---------
>>>  modules/codec/avcodec/vaapi.c |    6 ------
>>>  modules/codec/avcodec/vda.c   |    7 -------
>>>  modules/codec/avcodec/video.c |    2 --
>>>  modules/hw/vdpau/avcodec.c    |   21 ---------------------
>>>  6 files changed, 13 insertions(+), 45 deletions(-)
>>>
>>> diff --git a/modules/codec/avcodec/va.c 
>>> b/modules/codec/avcodec/va.c
>>> index 8c13e55..f534f89 100644
>>> --- a/modules/codec/avcodec/va.c
>>> +++ b/modules/codec/avcodec/va.c
>>> @@ -109,6 +109,16 @@ vlc_va_t *vlc_va_New(vlc_object_t *obj, 
>>> AVCodecContext *avctx,
>>>      if (va->module == NULL)
>>>      {
>>>          vlc_object_release(va);
>>> +#ifdef _WIN32
>>> +        return NULL;
>>> +    }
>>> +
>>> +    vlc_fourcc_t chroma;
>>> +    va->setup(va, &chroma);
>>> +    if (chroma != vlc_va_GetChroma(pix_fmt, AV_PIX_FMT_YUV420P))
>>> +    {   /* Mismatch, cannot work, fail */
>>> +        vlc_va_Delete(va, avctx);
>>> +#endif
>>
>> This broke the case of DXVA2 not outputting an opaque format when 
>> the
>> vout cannot handle it. In that case it silently outputs 
>> VLC_CODEC_YV12
>> and do the conversion on each frame coming out.
>>
>> vlc_va_GetChroma() has no way of knowing this is happening.
>
> Can this be reverted or we need to find a solution for how to handle
> DXVA2 and D3D11VA outputting textures that cannot be handled by the
> vout (D3D11 vs D3D9 mismatch or D3D11/D3D9 textures on
> DirectDraw/OpenGL/GDI output) ?

No. Anything the setup callback could do, the activation callback can 
do. Anything the activation callback cannot do, the setup callback could 
not do either without violationg assumptions from the avcodec video 
decoder or the video output core.

So there is no point in bringing it back.

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


More information about the vlc-devel mailing list