msdk: query platform when opening session
authorAaron Boxer <aaron.boxer@collabora.com>
Wed, 20 Nov 2019 19:09:34 +0000 (13:09 -0600)
committerHaihao Xiang <haihao.xiang@intel.com>
Fri, 22 Nov 2019 05:18:42 +0000 (05:18 +0000)
sys/msdk/msdk.c

index 47d0384..6f9cd3c 100644 (file)
@@ -190,10 +190,19 @@ msdk_open_session (mfxIMPL impl)
     GST_ERROR ("Query version failed (%s)", msdk_status_to_string (status));
     goto failed;
   }
+#if (MFX_VERSION >= 1019)
+  mfxPlatform platform = { 0 };
+  status = MFXVideoCORE_QueryPlatform (session, &platform);
+  if (MFX_ERR_NONE == status) {
+    GST_INFO ("Detected MFX platform with device code %d", platform.CodeName);
+  } else {
+    GST_WARNING ("Platform auto-detection failed with MFX status %d", status);
+  }
+#endif
 
-  GST_INFO ("MSDK implementation: 0x%04x (%s)", implementation,
+  GST_INFO ("MFX implementation: 0x%04x (%s)", implementation,
       implementation_names[MFX_IMPL_BASETYPE (implementation)]);
-  GST_INFO ("MSDK version: %d.%d", version.Major, version.Minor);
+  GST_INFO ("MFX version: %d.%d", version.Major, version.Minor);
 
   return session;