[vlc-commits] vaapi: filters: get the decoder device from the input vctx

Steve Lhomme git at videolan.org
Mon Dec 2 13:42:55 CET 2019


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Nov  8 14:19:10 2019 +0100| [a5d745e2e4e7b0f0e7a3bebfa5bca77518205f31] | committer: Steve Lhomme

vaapi: filters: get the decoder device from the input vctx

Rather than using vlc_vaapi_FilterHoldInstance().

The VADisplay is stored in the decoder device opaque.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a5d745e2e4e7b0f0e7a3bebfa5bca77518205f31
---

 modules/hw/vaapi/filters.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/modules/hw/vaapi/filters.c b/modules/hw/vaapi/filters.c
index 0e86004f5e..31ba2257c7 100644
--- a/modules/hw/vaapi/filters.c
+++ b/modules/hw/vaapi/filters.c
@@ -375,10 +375,9 @@ Open(filter_t * filter,
     filter_sys->va.conf = VA_INVALID_ID;
     filter_sys->va.ctx = VA_INVALID_ID;
     filter_sys->va.buf = VA_INVALID_ID;
-    filter_sys->va.dec_device =
-        vlc_vaapi_FilterHoldInstance(filter, &filter_sys->va.dpy);
-    if (!filter_sys->va.dec_device)
-        goto error;
+    filter_sys->va.dec_device = vlc_video_context_HoldDevice(filter->vctx_in);
+    filter_sys->va.dpy = filter_sys->va.dec_device->opaque;
+    assert(filter_sys->va.dec_device);
 
     filter_sys->dest_pics =
         vlc_vaapi_PoolNew(VLC_OBJECT(filter), filter->vctx_in,
@@ -458,7 +457,7 @@ error:
     if (filter_sys->dest_pics)
         picture_pool_Release(filter_sys->dest_pics);
     if (filter_sys->va.dec_device)
-        vlc_vaapi_FilterReleaseInstance(filter, filter_sys->va.dec_device);
+        vlc_decoder_device_Release(filter_sys->va.dec_device);
     free(filter_sys);
     return VLC_EGENERIC;
 }
@@ -471,7 +470,7 @@ Close(filter_t *filter, filter_sys_t * filter_sys)
     vlc_vaapi_DestroyBuffer(obj, filter_sys->va.dpy, filter_sys->va.buf);
     vlc_vaapi_DestroyContext(obj, filter_sys->va.dpy, filter_sys->va.ctx);
     vlc_vaapi_DestroyConfig(obj, filter_sys->va.dpy, filter_sys->va.conf);
-    vlc_vaapi_FilterReleaseInstance(filter, filter_sys->va.dec_device);
+    vlc_decoder_device_Release(filter_sys->va.dec_device);
     vlc_video_context_Release(filter->vctx_out);
     free(filter_sys);
 }



More information about the vlc-commits mailing list