Quoting Xiang, Haihao (2022-07-12 08:27:32)
> +static int qsv_va_update_config(void *ctx, mfxHDL handle, mfxConfig cfg)
> +{
> +#if CONFIG_VAAPI
> +#if VA_CHECK_VERSION(1, 5, 0)
> +#define LOCAL_VADISPLAYPCIID VADisplayPCIID
> +#else
> +#define LOCAL_VADISPLAYPCIID 21
> +#endif
> +    mfxStatus sts;
> +    VADisplay dpy = handle;
> +    VAStatus vas;
> +    VADisplayAttribute attr = {
> +        .type = LOCAL_VADISPLAYPCIID
> +    };
> +    mfxVariant impl_value;
> +
> +    vas = vaGetDisplayAttributes(dpy, &attr, 1);
> +    if (vas == VA_STATUS_SUCCESS && attr.flags != 
> VA_DISPLAY_ATTRIB_NOT_SUPPORTED) {
> +        impl_value.Type = MFX_VARIANT_TYPE_U16;
> +        impl_value.Data.U16 = (attr.value & 0xFFFF);
> +        sts = MFXSetConfigFilterProperty(cfg,
> +                                         (const mfxU8 
> *)"mfxExtendedDeviceId.DeviceID", impl_value);
> +        if (sts != MFX_ERR_NONE) {
> +            av_log(ctx, AV_LOG_ERROR, "Error adding a MFX configuration"
> +                   "DeviceID property: %d.\n", sts);
> +            goto fail;
> +        }
> +    } else
> +        av_log(ctx, AV_LOG_WARNING, "Cannot get device id from the driver, 
> the default "
> +               "MFX implementation will be loaded for this device. Please 
> consider to "
> +               "upgrade the driver to support VAAPI 1.5.0. \n");

I would still prefer to fail here. The user requested a specific device,
disregarding that request is evil.


-- 
Anton Khirnov
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to