[vlc-commits] vdpau: improve decoder capability checks messages

Rémi Denis-Courmont git at videolan.org
Thu Jul 25 18:35:50 CEST 2013


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jul 25 19:35:32 2013 +0300| [a9be23416816ea7d7a134c401afe845f6d4ae666] | committer: Rémi Denis-Courmont

vdpau: improve decoder capability checks messages

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

 modules/hw/vdpau/avcodec.c |   36 ++++++++++++++++++++++--------------
 1 file changed, 22 insertions(+), 14 deletions(-)

diff --git a/modules/hw/vdpau/avcodec.c b/modules/hw/vdpau/avcodec.c
index 7bb4a30..0f3414c 100644
--- a/modules/hw/vdpau/avcodec.c
+++ b/modules/hw/vdpau/avcodec.c
@@ -297,32 +297,40 @@ static int Open(vlc_va_t *va, int codec, const es_format_t *fmt)
 
     /* Check capabilities */
     VdpBool support;
-    uint32_t lvl, mb, width, height;
+    uint32_t l, mb, w, h;
 
     if (vdp_video_surface_query_capabilities(sys->vdp, sys->device,
-              VDP_CHROMA_TYPE_420, &support, &width, &height) != VDP_STATUS_OK)
+              VDP_CHROMA_TYPE_420, &support, &w, &h) != VDP_STATUS_OK)
         support = VDP_FALSE;
-    if (!support || width < fmt->video.i_width || height < fmt->video.i_height)
+    if (!support)
     {
-        msg_Err(va, "video surface not supported: %s %ux%u",
-                 "YUV 4:2:0", fmt->video.i_width, fmt->video.i_height);
+        msg_Err(va, "video surface format not supported: %s", "YUV 4:2:0");
+        goto error;
+    }
+    msg_Dbg(va, "video surface limits: %"PRIu32"x%"PRIu32, w, h);
+    if (w < fmt->video.i_width || h < fmt->video.i_height)
+    {
+        msg_Err(va, "video surface above limits: %ux%u",
+                fmt->video.i_width, fmt->video.i_height);
         goto error;
     }
-    msg_Dbg(va, "video surface supported maximum: %s %"PRIu32"x%"PRIu32,
-            "YUV 4:2:0", width, height);
 
     if (vdp_decoder_query_capabilities(sys->vdp, sys->device, profile,
-                        &support, &lvl, &mb, &width, &height) != VDP_STATUS_OK)
+                                   &support, &l, &mb, &w, &h) != VDP_STATUS_OK)
         support = VDP_FALSE;
-    if (!support || (int)lvl < level
-     || width < fmt->video.i_width || height < fmt->video.i_height)
+    if (!support)
+    {
+        msg_Err(va, "decoder profile not supported: %u", profile);
+        goto error;
+    }
+    msg_Dbg(va, "decoder profile limits: level %"PRIu32" mb %"PRIu32" "
+            "%"PRIu32"x%"PRIu32, l, mb, w, h);
+    if ((int)l < level || w < fmt->video.i_width || h < fmt->video.i_height)
     {
-        msg_Err(va, "decoding profile not supported: %"PRIu32".%d %ux%u",
-                profile, lvl, fmt->video.i_width, fmt->video.i_height);
+        msg_Err(va, "decoder profile above limits: level %d %ux%u",
+                level, fmt->video.i_width, fmt->video.i_height);
         goto error;
     }
-    msg_Dbg(va, "decoding profile supported maximum: %"PRIu32".%"PRIu32" mb %"
-            PRIu32", %"PRIu32"x%"PRIu32, profile, lvl, mb, width, height);
 
     const char *infos;
     if (vdp_get_information_string(sys->vdp, &infos) != VDP_STATUS_OK)



More information about the vlc-commits mailing list