[vlc-commits] [Git][videolan/vlc][master] 2 commits: vaapi: filters: pass pipeline_params into CreateBuffer

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Tue Dec 17 23:15:51 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
997c2d48 by Thomas Guillem at 2024-12-17T23:02:52+00:00
vaapi: filters: pass pipeline_params into CreateBuffer

Avoid a Map, copy, Unmap.

- - - - -
6d56eb07 by Thomas Guillem at 2024-12-17T23:02:52+00:00
vaapi: filters: BeginPicture before rendering it

- - - - -


1 changed file:

- modules/hw/vaapi/filters.c


Changes:

=====================================
modules/hw/vaapi/filters.c
=====================================
@@ -231,39 +231,31 @@ Filter(filter_t * filter, picture_t * src,
                               filter_sys->va.dpy, filter_sys->va.buf))
         goto error;
 
-    if (vlc_vaapi_BeginPicture(VLC_OBJECT(filter),
-                               filter_sys->va.dpy, filter_sys->va.ctx,
-                               vlc_vaapi_PicGetSurface(dest)))
-        goto error;
-
     if (pf_prepare_render_surface)
         pf_prepare_render_surface(filter_sys->p_data);
 
-    VAProcPipelineParameterBuffer *     pipeline_params;
+    VAProcPipelineParameterBuffer pipeline_params = {
+        .surface = vlc_vaapi_PicGetSurface(src),
+        .filters = &filter_sys->va.buf,
+        .num_filters = 1,
+    };
+
+    if (filter_sys->b_pipeline_fast)
+        pipeline_params.pipeline_flags = VA_PROC_PIPELINE_FAST;
+    if (pf_update_pipeline_params)
+        pf_update_pipeline_params(filter_sys->p_data, &pipeline_params);
 
     pipeline_buf =
         vlc_vaapi_CreateBuffer(VLC_OBJECT(filter),
                                filter_sys->va.dpy, filter_sys->va.ctx,
                                VAProcPipelineParameterBufferType,
-                               sizeof(*pipeline_params), 1, NULL);
+                               sizeof(pipeline_params), 1, &pipeline_params);
     if (pipeline_buf == VA_INVALID_ID)
         goto error;
 
-    if (vlc_vaapi_MapBuffer(VLC_OBJECT(filter), filter_sys->va.dpy,
-                            pipeline_buf, (void **)&pipeline_params))
-        goto error;
-
-    *pipeline_params = (typeof(*pipeline_params)){0};
-    pipeline_params->surface = vlc_vaapi_PicGetSurface(src);
-    pipeline_params->filters = &filter_sys->va.buf;
-    pipeline_params->num_filters = 1;
-    if (filter_sys->b_pipeline_fast)
-        pipeline_params->pipeline_flags = VA_PROC_PIPELINE_FAST;
-    if (pf_update_pipeline_params)
-        pf_update_pipeline_params(filter_sys->p_data, pipeline_params);
-
-    if (vlc_vaapi_UnmapBuffer(VLC_OBJECT(filter),
-                              filter_sys->va.dpy, pipeline_buf))
+    if (vlc_vaapi_BeginPicture(VLC_OBJECT(filter),
+                               filter_sys->va.dpy, filter_sys->va.ctx,
+                               vlc_vaapi_PicGetSurface(dest)))
         goto error;
 
     if (vlc_vaapi_RenderPicture(VLC_OBJECT(filter),



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6256610531ef5a65681dd484568de36ea125a0e3...6d56eb0706560080ec94e788628af33f1c982b63

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6256610531ef5a65681dd484568de36ea125a0e3...6d56eb0706560080ec94e788628af33f1c982b63
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list