qsv: Re-apply MinGW build workaround

Apply the changes of the commits
c80132e4a3 and
23261bccbb

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5032>
This commit is contained in:
Seungha Yang 2023-07-13 20:34:24 +09:00 committed by GStreamer Marge Bot
parent 1bc5dc778c
commit 25d10acaa2
2 changed files with 31 additions and 4 deletions

View file

@ -1522,15 +1522,27 @@ bool ConfigCtxVPL::CheckLowLatencyConfig(std::list<ConfigCtxVPL *> configCtxList
return bLowLatency;
}
#include <gst/gst.h>
bool ConfigCtxVPL::ParseDeviceIDx86(mfxChar *cDeviceID, mfxU32 &deviceID, mfxU32 &adapterIdx) {
std::string strDevID(cDeviceID);
// XXX: std::regex is crashing on Windows + gcc
#if 0
std::regex reDevIDAll("[0-9a-fA-F]+/[0-9]+");
std::regex reDevIDMin("[0-9a-fA-F]+");
#else
static const gchar *reDevIDAll = "[0-9a-fA-F]+/[0-9]+";
static const gchar *reDevIDMin = "[0-9a-fA-F]+";
if (!cDeviceID)
return false;
#endif
deviceID = DEVICE_ID_UNKNOWN;
adapterIdx = ADAPTER_IDX_UNKNOWN;
bool bHasAdapterIdx = false;
#if 0
if (std::regex_match(strDevID, reDevIDAll)) {
// check for DeviceID in format "devID/adapterIdx"
// devID = hex value
@ -1546,6 +1558,25 @@ bool ConfigCtxVPL::ParseDeviceIDx86(mfxChar *cDeviceID, mfxU32 &deviceID, mfxU32
// invalid format
return false;
}
#else
if (g_regex_match_simple(reDevIDAll, cDeviceID,
(GRegexCompileFlags)0, (GRegexMatchFlags)0)) {
// check for DeviceID in format "devID/adapterIdx"
// devID = hex value
// adapterIdx = decimal integer
bHasAdapterIdx = true;
}
else if (g_regex_match_simple(reDevIDMin, cDeviceID,
(GRegexCompileFlags)0, (GRegexMatchFlags)0)) {
// check for DeviceID in format "devID"
// (no adpaterIdx)
bHasAdapterIdx = false;
}
else {
// invalid format
return false;
}
#endif
// get deviceID (value before the slash, if present)
try {

View file

@ -19,16 +19,12 @@
#if defined(MEDIASDK_UWP_DISPATCHER)
#if defined(MFX_D3D9_ENABLED) && !defined(MFX_FORCE_D3D9_ENABLED)
#undef MFX_D3D9_ENABLED
#pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ \
" (" STRINGIFY(__LINE__) "):\nUsing of D3D9 disabled for UWP!\n\n")
#endif
#if defined(MFX_FORCE_D3D9_ENABLED)
#define MFX_D3D9_ENABLED
#endif
#else
#define MFX_D3D9_ENABLED
#pragma message("\n\nATTENTION:\nin file\n\t" __FILE__ \
" (" STRINGIFY(__LINE__) "):\nUsing of D3D9 enabled!\n\n")
#endif
#include "vpl/mfxdefs.h"