Fix compatibility with old compiler versions 2.

This commit is contained in:
Gonzalo Exequiel Pedone 2020-10-09 14:14:34 -03:00
parent 5e7efa154b
commit ea40f960b4
No known key found for this signature in database
GPG key ID: B8B09E63E9B85BAF

View file

@ -71,7 +71,6 @@ namespace AkVCam
~BaseFilterPrivate();
IEnumPins *pinsForDevice(const std::string &deviceId);
void updatePins();
static WINBOOL enumWindowsProc(HWND handler, LPARAM userData);
static void serverStateChanged(void *userData,
IpcBridge::ServerState state);
static void frameReady(void *userData,
@ -90,6 +89,8 @@ namespace AkVCam
};
}
WINBOOL CALLBACK AkVCamEnumWindowsProc(HWND handler, LPARAM userData);
AkVCam::BaseFilter::BaseFilter(const GUID &clsid,
const std::string &filterName,
const std::string &vendor):
@ -428,15 +429,6 @@ void AkVCam::BaseFilterPrivate::updatePins()
AkVCamDevicePinCall(path, this, setControls, controls)
}
WINBOOL AkVCam::BaseFilterPrivate::enumWindowsProc(HWND handler,
LPARAM userData)
{
auto handlers = reinterpret_cast<std::vector<HWND> *>(userData);
handlers->push_back(handler);
return TRUE;
}
void AkVCam::BaseFilterPrivate::serverStateChanged(void *userData,
IpcBridge::ServerState state)
{
@ -484,7 +476,7 @@ void AkVCam::BaseFilterPrivate::devicesChanged(void *userData,
UNUSED(devices);
AkLogFunction();
std::vector<HWND> handlers;
EnumWindows(WNDENUMPROC(enumWindowsProc), LPARAM(&handlers));
EnumWindows(WNDENUMPROC(AkVCamEnumWindowsProc), LPARAM(&handlers));
for (auto &handler: handlers)
SendMessage(handler, WM_DEVICECHANGE, DBT_DEVNODES_CHANGED, 0);
@ -507,3 +499,11 @@ void AkVCam::BaseFilterPrivate::setControls(void *userData,
auto self = reinterpret_cast<BaseFilterPrivate *>(userData);
AkVCamDevicePinCall(deviceId, self, setControls, controls)
}
WINBOOL CALLBACK AkVCamEnumWindowsProc(HWND handler, LPARAM userData)
{
auto handlers = reinterpret_cast<std::vector<HWND> *>(userData);
handlers->push_back(handler);
return TRUE;
}