[vlc-devel] [PATCH] vaapi: remove always true parameter from vlc_vaapi_PoolNew()

Steve Lhomme robux4 at ycbcr.xyz
Mon Nov 18 14:27:47 CET 2019


---
 modules/hw/vaapi/chroma.c                     |  2 +-
 modules/hw/vaapi/filters.c                    |  3 +--
 modules/hw/vaapi/vlc_vaapi.c                  | 11 ++++-------
 modules/hw/vaapi/vlc_vaapi.h                  |  2 +-
 modules/video_output/opengl/converter_vaapi.c |  5 ++---
 5 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/modules/hw/vaapi/chroma.c b/modules/hw/vaapi/chroma.c
index 96346546302..ceaa635d37a 100644
--- a/modules/hw/vaapi/chroma.c
+++ b/modules/hw/vaapi/chroma.c
@@ -357,7 +357,7 @@ vlc_vaapi_OpenChroma(vlc_object_t *obj)
         filter_sys->dest_pics =
             vlc_vaapi_PoolNew(obj, filter_sys->dec_device, filter_sys->dpy,
                               DEST_PICS_POOL_SZ, &filter_sys->va_surface_ids,
-                              &filter->fmt_out.video, true);
+                              &filter->fmt_out.video);
         if (!filter_sys->dest_pics)
         {
             vlc_vaapi_FilterReleaseInstance(filter, filter_sys->dec_device);
diff --git a/modules/hw/vaapi/filters.c b/modules/hw/vaapi/filters.c
index ee81a114340..35fe72318cd 100644
--- a/modules/hw/vaapi/filters.c
+++ b/modules/hw/vaapi/filters.c
@@ -383,8 +383,7 @@ Open(filter_t * filter,
     filter_sys->dest_pics =
         vlc_vaapi_PoolNew(VLC_OBJECT(filter), filter_sys->va.dec_device,
                           filter_sys->va.dpy, DEST_PICS_POOL_SZ,
-                          &filter_sys->va.surface_ids, &filter->fmt_out.video,
-                          true);
+                          &filter_sys->va.surface_ids, &filter->fmt_out.video);
     if (!filter_sys->dest_pics)
         goto error;
 
diff --git a/modules/hw/vaapi/vlc_vaapi.c b/modules/hw/vaapi/vlc_vaapi.c
index 2a75ccaa535..fa15082dc5b 100644
--- a/modules/hw/vaapi/vlc_vaapi.c
+++ b/modules/hw/vaapi/vlc_vaapi.c
@@ -471,7 +471,7 @@ pic_sys_ctx_destroy_cb(struct picture_context_t *opaque)
 picture_pool_t *
 vlc_vaapi_PoolNew(vlc_object_t *o, vlc_decoder_device *dec_device,
                   VADisplay dpy, unsigned count, VASurfaceID **render_targets,
-                  const video_format_t *restrict fmt, bool b_force_fourcc)
+                  const video_format_t *restrict fmt)
 {
     unsigned va_rt_format;
     int va_fourcc;
@@ -491,14 +491,11 @@ vlc_vaapi_PoolNew(vlc_object_t *o, vlc_decoder_device *dec_device,
             .type = VASurfaceAttribPixelFormat,
             .flags = VA_SURFACE_ATTRIB_SETTABLE,
             .value.type    = VAGenericValueTypeInteger,
-            .value.value.i = b_force_fourcc ? va_fourcc : 0,
+            .value.value.i = va_fourcc,
         }
     };
-    if (b_force_fourcc)
-    {
-        attribs = fourcc_attribs;
-        num_attribs = 1;
-    }
+    attribs = fourcc_attribs;
+    num_attribs = 1;
 
     picture_t *pics[count];
 
diff --git a/modules/hw/vaapi/vlc_vaapi.h b/modules/hw/vaapi/vlc_vaapi.h
index 2a344b96308..a83e1df78ec 100644
--- a/modules/hw/vaapi/vlc_vaapi.h
+++ b/modules/hw/vaapi/vlc_vaapi.h
@@ -171,7 +171,7 @@ vlc_vaapi_CreateConfigChecked(vlc_object_t *o, VADisplay dpy,
 picture_pool_t *
 vlc_vaapi_PoolNew(vlc_object_t *o, vlc_decoder_device *dec_device,
                   VADisplay dpy, unsigned count, VASurfaceID **render_targets,
-                  const video_format_t *restrict fmt, bool b_force_fourcc);
+                  const video_format_t *restrict fmt);
 
 /* Get and hold the VADisplay instance attached to the picture sys */
 vlc_decoder_device *
diff --git a/modules/video_output/opengl/converter_vaapi.c b/modules/video_output/opengl/converter_vaapi.c
index b4d7fc8bef3..d53f01c138a 100644
--- a/modules/video_output/opengl/converter_vaapi.c
+++ b/modules/video_output/opengl/converter_vaapi.c
@@ -236,8 +236,7 @@ tc_vaegl_get_pool(const opengl_tex_converter_t *tc, unsigned requested_count)
     vlc_decoder_device *dec_device = vlc_video_context_HoldDevice(tc->vctx);
     picture_pool_t *pool =
         vlc_vaapi_PoolNew(VLC_OBJECT(tc->gl), dec_device, priv->vadpy,
-                          requested_count, &priv->va_surface_ids, &tc->fmt,
-                          true);
+                          requested_count, &priv->va_surface_ids, &tc->fmt);
     vlc_decoder_device_Release(dec_device);
     if (!pool)
         return NULL;
@@ -345,7 +344,7 @@ tc_va_check_derive_image(opengl_tex_converter_t *tc,
     VASurfaceID *va_surface_ids;
 
     picture_pool_t *pool = vlc_vaapi_PoolNew(o, dec_device, priv->vadpy, 1,
-                                             &va_surface_ids, &tc->fmt, true);
+                                             &va_surface_ids, &tc->fmt);
     if (!pool)
         return VLC_EGENERIC;
 
-- 
2.17.1



More information about the vlc-devel mailing list