[vlc-devel] [PATCH 06/36] vdpau: chroma: get the decoder device using filter_HoldDecoderDevice()
Rémi Denis-Courmont
remi at remlab.net
Sat Nov 23 14:37:52 CET 2019
Le torstaina 21. marraskuuta 2019, 16.13.57 EET Steve Lhomme a écrit :
> Use vdp_get_x11() to get the VdpDevice since we already have the vdp from
> the decoder device.
> ---
> modules/hw/vdpau/chroma.c | 23 ++++++++++++++++++++---
> 1 file changed, 20 insertions(+), 3 deletions(-)
>
> diff --git a/modules/hw/vdpau/chroma.c b/modules/hw/vdpau/chroma.c
> index e2791eced4d..51a958ccc2d 100644
> --- a/modules/hw/vdpau/chroma.c
> +++ b/modules/hw/vdpau/chroma.c
> @@ -768,9 +768,21 @@ static int OutputOpen(vlc_object_t *obj)
> assert(filter->fmt_out.video.orientation == ORIENT_TOP_LEFT
>
> || filter->fmt_in.video.orientation ==
> || filter->fmt_out.video.orientation);
>
> + vlc_decoder_device *dec_device = filter_HoldDecoderDevice(filter);
> + if (dec_device == NULL)
> + return VLC_EGENERIC;
> + if (dec_device->type != VLC_DECODER_DEVICE_VDPAU)
> + {
> + vlc_decoder_device_Release(dec_device);
> + return VLC_EGENERIC;
> + }
Would be simpler to ask for the correct type up-front, and handle the checks
in common code. Few if any filters will support more than one device type.
--
雷米‧德尼-库尔蒙
http://www.remlab.net/
More information about the vlc-devel
mailing list