[vlc-devel] commit: A bit more explicit dxva2 describe function. (Laurent Aimar )

git version control git at videolan.org
Wed Jan 20 01:19:13 CET 2010


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Jan 17 19:41:06 2010 +0100| [9f4afd2f081af80f0a30e2f91cf608c4a97e32f0] | committer: Laurent Aimar 

A bit more explicit dxva2 describe function.

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

 modules/codec/avcodec/dxva2.c |   23 +++++++++++++++++++++--
 1 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index cf51f0d..5971c3b 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -587,11 +587,30 @@ static void D3dDestroyDevice(vlc_va_dxva2_t *va)
  */
 static char *DxDescribe(vlc_va_dxva2_t *va)
 {
+    static const struct {
+        unsigned id;
+        char     name[32];
+    } vendors [] = {
+        { 0x1002, "ATI" },
+        { 0x10DE, "NVIDIA" },
+        { 0x8086, "Intel" },
+        { 0x5333, "S3 Graphics" },
+        { 0, "" }
+    };
     D3DADAPTER_IDENTIFIER9 *id = &va->d3dai;
+
+    const char *vendor = "Unknown";
+    for (int i = 0; vendors[i].id != 0; i++) {
+        if (vendors[i].id == id->VendorId) {
+            vendor = vendors[i].name;
+            break;
+        }
+    }
+
     char *description;
-    if (asprintf(&description, "DXVA2 (%.*s, vendor %d, device %d, revision %d)",
+    if (asprintf(&description, "DXVA2 (%.*s, vendor %d(%s), device %d, revision %d)",
                  sizeof(id->Description), id->Description,
-                 id->VendorId, id->DeviceId, id->Revision) < 0)
+                 id->VendorId, vendor, id->DeviceId, id->Revision) < 0)
         return NULL;
     return description;
 }




More information about the vlc-devel mailing list