[vlc-commits] va: print description in module

Rémi Denis-Courmont git at videolan.org
Tue Jan 15 17:24:06 CET 2019


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Jan 14 21:56:18 2019 +0200| [04d10eb8de3a47547a0d4c36e78598623d7218c3] | committer: Rémi Denis-Courmont

va: print description in module

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

 modules/codec/avcodec/d3d11va.c | 6 +++++-
 modules/codec/avcodec/dxva2.c   | 6 +++++-
 modules/codec/avcodec/vaapi.c   | 4 ++++
 modules/codec/avcodec/video.c   | 3 ---
 modules/hw/vdpau/avcodec.c      | 4 +++-
 5 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/modules/codec/avcodec/d3d11va.c b/modules/codec/avcodec/d3d11va.c
index 1f982ad7e3..6b1730a935 100644
--- a/modules/codec/avcodec/d3d11va.c
+++ b/modules/codec/avcodec/d3d11va.c
@@ -395,10 +395,14 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
     if (err != VLC_SUCCESS)
         goto error;
 
+    char *desc = DxDescribe(sys);
+    if (desc != NULL)
+        msg_Info(va, "Using %s", desc);
+
     ctx->hwaccel_context = &sys->hw;
 
     /* TODO print the hardware name/vendor for debugging purposes */
-    va->description = DxDescribe(sys);
+    va->description = desc;
     va->get     = Get;
 
     return VLC_SUCCESS;
diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 3a732b551f..60f24b234e 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -327,10 +327,14 @@ static int Open(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
     if (err != VLC_SUCCESS)
         goto error;
 
+    char *desc = DxDescribe(sys);
+    if (desc != NULL)
+        msg_Info(va, "Using %s", desc);
+
     ctx->hwaccel_context = &sys->hw;
 
     /* TODO print the hardware name/vendor for debugging purposes */
-    va->description = DxDescribe(sys);
+    va->description = desc;
     va->get     = Get;
     return VLC_SUCCESS;
 
diff --git a/modules/codec/avcodec/vaapi.c b/modules/codec/avcodec/vaapi.c
index d8fafed094..206efd873a 100644
--- a/modules/codec/avcodec/vaapi.c
+++ b/modules/codec/avcodec/vaapi.c
@@ -208,6 +208,8 @@ static int Create(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt,
     if (sys->hw_ctx.context_id == VA_INVALID_ID)
         goto error;
 
+    msg_Info(va, "Using %s", vaQueryVendorString(sys->hw_ctx.display));
+
     ctx->hwaccel_context = &sys->hw_ctx;
     va->sys = sys;
     va->description = vaQueryVendorString(sys->hw_ctx.display);
@@ -327,6 +329,8 @@ static int CreateDRM(vlc_va_t *va, AVCodecContext *ctx, enum PixelFormat pix_fmt
     if (sys->hw_ctx.context_id == VA_INVALID_ID)
         goto error;
 
+    msg_Info(va, "Using %s", vaQueryVendorString(sys->hw_ctx.display));
+
     ctx->hwaccel_context = &sys->hw_ctx;
     va->sys = sys;
     va->description = vaQueryVendorString(sys->hw_ctx.display);
diff --git a/modules/codec/avcodec/video.c b/modules/codec/avcodec/video.c
index e0909012c7..3c29cf7d62 100644
--- a/modules/codec/avcodec/video.c
+++ b/modules/codec/avcodec/video.c
@@ -1739,9 +1739,6 @@ no_reuse:
             continue; /* Unsupported codec profile or such */
         }
 
-        if (va->description != NULL)
-            msg_Info(p_dec, "Using %s for hardware decoding", va->description);
-
         p_sys->p_va = va;
         p_sys->pix_fmt = hwfmt;
         p_context->draw_horiz_band = NULL;
diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index 1eeef696b3..ac78d0808c 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -192,7 +192,9 @@ static int Open(vlc_va_t *va, AVCodecContext *avctx, enum PixelFormat pix_fmt,
                  i, refs);
 
     const char *infos;
-    if (vdp_get_information_string(sys->vdp, &infos) != VDP_STATUS_OK)
+    if (vdp_get_information_string(sys->vdp, &infos) == VDP_STATUS_OK)
+        msg_Info(va, "Using %s", infos);
+    else
         infos = "VDPAU";
 
     va->description = infos;



More information about the vlc-commits mailing list