diff mbox series

[FFmpeg-devel,v3,1/4] lavu: Remove libva 1.x support

Message ID b8688f34-787a-4272-8542-cff93a876b70@jkqxz.net
State New
Headers show
Series [FFmpeg-devel,v3,1/4] lavu: Remove libva 1.x support | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Mark Thompson April 22, 2024, 9:41 p.m. UTC
libva 2.0 was released in 2017 and the 2.x versions are included in all
supported distributions nowadays.
---
Rebased.

I think we can also drop the other quirks?  They are for the proprietary media SDK driver (which I think is dead?) and the VDPAU wrapper (which I don't think was ever updated for libva 2?).


 libavutil/hwcontext_vaapi.c | 22 ----------------------
 1 file changed, 22 deletions(-)

Comments

Xiang, Haihao April 24, 2024, 2:06 p.m. UTC | #1
On Ma, 2024-04-22 at 22:41 +0100, Mark Thompson wrote:
> libva 2.0 was released in 2017 and the 2.x versions are included in all
> supported distributions nowadays.
> ---
> Rebased.
> 
> I think we can also drop the other quirks?  They are for the proprietary media
> SDK driver (which I think is dead?) and the VDPAU wrapper (which I don't think
> was ever updated for libva 2?).

Agree, please drop these quirks in a new patch. 

BTW I think we should require VA-API 1.x firstly, otherwise if someone has VA-
API 0.x, he/she will get errors when building this commit. 

Thanks
Haihao

> 
> 
>  libavutil/hwcontext_vaapi.c | 22 ----------------------
>  1 file changed, 22 deletions(-)
> 
> diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
> index 56d03aa4cd..84bcb78087 100644
> --- a/libavutil/hwcontext_vaapi.c
> +++ b/libavutil/hwcontext_vaapi.c
> @@ -372,14 +372,6 @@ static const struct {
>      const char *match_string;
>      unsigned int quirks;
>  } vaapi_driver_quirks_table[] = {
> -#if !VA_CHECK_VERSION(1, 0, 0)
> -    // The i965 driver did not conform before version 2.0.
> -    {
> -        "Intel i965 (Quick Sync)",
> -        "i965",
> -        AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,
> -    },
> -#endif
>      {
>          "Intel iHD",
>          "ubit",
> @@ -1413,7 +1405,6 @@ fail:
>  }
>  #endif
> 
> -#if VA_CHECK_VERSION(0, 36, 0)
>  typedef struct VAAPIDRMImageBufferMapping {
>      VAImage      image;
>      VABufferInfo buffer_info;
> @@ -1573,7 +1564,6 @@ fail:
>      av_freep(&mapping);
>      return err;
>  }
> -#endif
> 
>  static int vaapi_map_to_drm(AVHWFramesContext *hwfc, AVFrame *dst,
>                              const AVFrame *src, int flags)
> @@ -1584,10 +1574,7 @@ static int vaapi_map_to_drm(AVHWFramesContext *hwfc,
> AVFrame *dst,
>      if (err != AVERROR(ENOSYS))
>          return err;
>  #endif
> -#if VA_CHECK_VERSION(0, 36, 0)
>      return vaapi_map_to_drm_abh(hwfc, dst, src, flags);
> -#endif
> -    return AVERROR(ENOSYS);
>  }
> 
>  #endif /* CONFIG_LIBDRM */
> @@ -1637,7 +1624,6 @@ static void vaapi_device_free(AVHWDeviceContext *ctx)
>      av_freep(&priv);
>  }
> 
> -#if CONFIG_VAAPI_1
>  static void vaapi_device_log_error(void *context, const char *message)
>  {
>      AVHWDeviceContext *ctx = context;
> @@ -1651,7 +1637,6 @@ static void vaapi_device_log_info(void *context, const
> char *message)
> 
>      av_log(ctx, AV_LOG_VERBOSE, "libva: %s", message);
>  }
> -#endif
> 
>  static int vaapi_device_connect(AVHWDeviceContext *ctx,
>                                  VADisplay display)
> @@ -1660,10 +1645,8 @@ static int vaapi_device_connect(AVHWDeviceContext *ctx,
>      int major, minor;
>      VAStatus vas;
> 
> -#if CONFIG_VAAPI_1
>      vaSetErrorCallback(display, &vaapi_device_log_error, ctx);
>      vaSetInfoCallback (display, &vaapi_device_log_info,  ctx);
> -#endif
> 
>      hwctx->display = display;
> 
> @@ -1907,7 +1890,6 @@ static int vaapi_device_create(AVHWDeviceContext *ctx,
> const char *device,
> 
>      ent = av_dict_get(opts, "driver", NULL, 0);
>      if (ent) {
> -#if VA_CHECK_VERSION(0, 38, 0)
>          VAStatus vas;
>          vas = vaSetDriverName(display, ent->value);
>          if (vas != VA_STATUS_SUCCESS) {
> @@ -1916,10 +1898,6 @@ static int vaapi_device_create(AVHWDeviceContext *ctx,
> const char *device,
>              vaTerminate(display);
>              return AVERROR_EXTERNAL;
>          }
> -#else
> -        av_log(ctx, AV_LOG_WARNING, "Driver name setting is not "
> -               "supported with this VAAPI version.\n");
> -#endif
>      }
> 
>      return vaapi_device_connect(ctx, display);
Mark Thompson April 28, 2024, 2:21 p.m. UTC | #2
On 24/04/2024 15:06, Xiang, Haihao wrote:
> On Ma, 2024-04-22 at 22:41 +0100, Mark Thompson wrote:
>> libva 2.0 was released in 2017 and the 2.x versions are included in all
>> supported distributions nowadays.
>> ---
>> Rebased.
>>
>> I think we can also drop the other quirks?  They are for the proprietary media
>> SDK driver (which I think is dead?) and the VDPAU wrapper (which I don't think
>> was ever updated for libva 2?).
> 
> Agree, please drop these quirks in a new patch. 

Sure.

> BTW I think we should require VA-API 1.x firstly, otherwise if someone has VA-
> API 0.x, he/she will get errors when building this commit. 

I was intending to squash but had them split for review, though as you say they can stay split with more careful ordering - I will do this.

Thanks,

- Mark
diff mbox series

Patch

diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 56d03aa4cd..84bcb78087 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -372,14 +372,6 @@  static const struct {
     const char *match_string;
     unsigned int quirks;
 } vaapi_driver_quirks_table[] = {
-#if !VA_CHECK_VERSION(1, 0, 0)
-    // The i965 driver did not conform before version 2.0.
-    {
-        "Intel i965 (Quick Sync)",
-        "i965",
-        AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS,
-    },
-#endif
     {
         "Intel iHD",
         "ubit",
@@ -1413,7 +1405,6 @@  fail:
 }
 #endif

-#if VA_CHECK_VERSION(0, 36, 0)
 typedef struct VAAPIDRMImageBufferMapping {
     VAImage      image;
     VABufferInfo buffer_info;
@@ -1573,7 +1564,6 @@  fail:
     av_freep(&mapping);
     return err;
 }
-#endif

 static int vaapi_map_to_drm(AVHWFramesContext *hwfc, AVFrame *dst,
                             const AVFrame *src, int flags)
@@ -1584,10 +1574,7 @@  static int vaapi_map_to_drm(AVHWFramesContext *hwfc, AVFrame *dst,
     if (err != AVERROR(ENOSYS))
         return err;
 #endif
-#if VA_CHECK_VERSION(0, 36, 0)
     return vaapi_map_to_drm_abh(hwfc, dst, src, flags);
-#endif
-    return AVERROR(ENOSYS);
 }

 #endif /* CONFIG_LIBDRM */
@@ -1637,7 +1624,6 @@  static void vaapi_device_free(AVHWDeviceContext *ctx)
     av_freep(&priv);
 }

-#if CONFIG_VAAPI_1
 static void vaapi_device_log_error(void *context, const char *message)
 {
     AVHWDeviceContext *ctx = context;
@@ -1651,7 +1637,6 @@  static void vaapi_device_log_info(void *context, const char *message)

     av_log(ctx, AV_LOG_VERBOSE, "libva: %s", message);
 }
-#endif

 static int vaapi_device_connect(AVHWDeviceContext *ctx,
                                 VADisplay display)
@@ -1660,10 +1645,8 @@  static int vaapi_device_connect(AVHWDeviceContext *ctx,
     int major, minor;
     VAStatus vas;

-#if CONFIG_VAAPI_1
     vaSetErrorCallback(display, &vaapi_device_log_error, ctx);
     vaSetInfoCallback (display, &vaapi_device_log_info,  ctx);
-#endif

     hwctx->display = display;

@@ -1907,7 +1890,6 @@  static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,

     ent = av_dict_get(opts, "driver", NULL, 0);
     if (ent) {
-#if VA_CHECK_VERSION(0, 38, 0)
         VAStatus vas;
         vas = vaSetDriverName(display, ent->value);
         if (vas != VA_STATUS_SUCCESS) {
@@ -1916,10 +1898,6 @@  static int vaapi_device_create(AVHWDeviceContext *ctx, const char *device,
             vaTerminate(display);
             return AVERROR_EXTERNAL;
         }
-#else
-        av_log(ctx, AV_LOG_WARNING, "Driver name setting is not "
-               "supported with this VAAPI version.\n");
-#endif
     }

     return vaapi_device_connect(ctx, display);