فهرست منبع

obs-qsv11: Fix QSV failing on multi-vendor multi-GPU systems

Adds index correction present in QSV test binary to Windows encoder
initialization as well. This is necessary when the adapter index of the
Intel GPU is not the same as the "implementation" index in MFX.
derrod 1 سال پیش
والد
کامیت
7a870fd923
1فایلهای تغییر یافته به همراه9 افزوده شده و 4 حذف شده
  1. 9 4
      plugins/obs-qsv11/common_utils_windows.cpp

+ 9 - 4
plugins/obs-qsv11/common_utils_windows.cpp

@@ -33,26 +33,31 @@ mfxStatus Initialize(mfxVersion ver, mfxSession *pSession,
 	obs_video_info ovi;
 	obs_video_info ovi;
 	obs_get_video_info(&ovi);
 	obs_get_video_info(&ovi);
 	mfxU32 adapter_idx = ovi.adapter;
 	mfxU32 adapter_idx = ovi.adapter;
+	mfxU32 idx_adjustment = 0;
 
 
 	// Select current adapter - will be iGPU if exists due to adapter reordering
 	// Select current adapter - will be iGPU if exists due to adapter reordering
 	if (codec == QSV_CODEC_AV1 && !adapters[adapter_idx].supports_av1) {
 	if (codec == QSV_CODEC_AV1 && !adapters[adapter_idx].supports_av1) {
-		for (mfxU32 i = 0; i < 4; i++) {
+		for (mfxU32 i = 0; i < MAX_ADAPTERS; i++) {
+			if (!adapters[i].is_intel) {
+				idx_adjustment++;
+				continue;
+			}
 			if (adapters[i].supports_av1) {
 			if (adapters[i].supports_av1) {
 				adapter_idx = i;
 				adapter_idx = i;
 				break;
 				break;
 			}
 			}
 		}
 		}
 	} else if (!adapters[adapter_idx].is_intel) {
 	} else if (!adapters[adapter_idx].is_intel) {
-		for (mfxU32 i = 0; i < 4; i++) {
+		for (mfxU32 i = 0; i < MAX_ADAPTERS; i++) {
 			if (adapters[i].is_intel) {
 			if (adapters[i].is_intel) {
 				adapter_idx = i;
 				adapter_idx = i;
 				break;
 				break;
 			}
 			}
+			idx_adjustment++;
 		}
 		}
 	}
 	}
 
 
-	adapter_index = adapter_idx;
-
+	adapter_idx -= idx_adjustment;
 	mfxStatus sts = MFX_ERR_NONE;
 	mfxStatus sts = MFX_ERR_NONE;
 	mfxVariant impl;
 	mfxVariant impl;