[vlc-commits] vaapi: chroma: get the decoder device using filter_HoldDecoderDevice()

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


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Nov  8 14:20:38 2019 +0100| [859a840fce5d24dda11272e2421252f79bc4766b] | committer: Steve Lhomme

vaapi: chroma: get the decoder device using filter_HoldDecoderDevice()

Rather than the legacy vlc_vaapi_FilterHoldInstance().

The VADisplay is stored in the decoder device opaque.

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

 modules/hw/vaapi/chroma.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/hw/vaapi/chroma.c b/modules/hw/vaapi/chroma.c
index 62a7b5ebf1..c860de4d73 100644
--- a/modules/hw/vaapi/chroma.c
+++ b/modules/hw/vaapi/chroma.c
@@ -345,15 +345,15 @@ vlc_vaapi_OpenChroma(vlc_object_t *obj)
     filter_sys->image_fallback_failed = false;
     if (is_upload)
     {
-        filter_sys->dec_device = vlc_vaapi_FilterHoldInstance(filter,
-                                                               &filter_sys->dpy);
-
+        filter_sys->dec_device = filter_HoldDecoderDeviceType( filter, VLC_DECODER_DEVICE_VAAPI );
         if (filter_sys->dec_device == NULL)
         {
             free(filter_sys);
             return VLC_EGENERIC;
         }
 
+        filter_sys->dpy = filter_sys->dec_device->opaque;
+
         filter->vctx_out = vlc_video_context_Create( filter_sys->dec_device, VLC_VIDEO_CONTEXT_VAAPI, 0, NULL );
 
         filter_sys->dest_pics =
@@ -362,7 +362,7 @@ vlc_vaapi_OpenChroma(vlc_object_t *obj)
                               &filter->fmt_out.video);
         if (!filter_sys->dest_pics)
         {
-            vlc_vaapi_FilterReleaseInstance(filter, filter_sys->dec_device);
+            vlc_decoder_device_Release(filter_sys->dec_device);
             vlc_video_context_Release(filter->vctx_out);
             filter->vctx_out = NULL;
             free(filter_sys);
@@ -384,7 +384,7 @@ vlc_vaapi_OpenChroma(vlc_object_t *obj)
         if (is_upload)
         {
             picture_pool_Release(filter_sys->dest_pics);
-            vlc_vaapi_FilterReleaseInstance(filter, filter_sys->dec_device);
+            vlc_decoder_device_Release(filter_sys->dec_device);
             vlc_video_context_Release(filter->vctx_out);
             filter->vctx_out = NULL;
         }
@@ -411,7 +411,7 @@ vlc_vaapi_CloseChroma(vlc_object_t *obj)
     if (filter_sys->dest_pics)
         picture_pool_Release(filter_sys->dest_pics);
     if (filter_sys->dec_device != NULL)
-        vlc_vaapi_FilterReleaseInstance(filter, filter_sys->dec_device);
+        vlc_decoder_device_Release(filter_sys->dec_device);
     CopyCleanCache(&filter_sys->cache);
     if (filter->vctx_out)
         vlc_video_context_Release(filter->vctx_out);



More information about the vlc-commits mailing list