mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Correct compile errors with Qt6.7
This commit is contained in:
parent
2cde6a4d8f
commit
acc065e22b
@ -39,8 +39,8 @@ class AudioGrabberWindows : public AudioGrabber
|
|||||||
HANDLE notificationEvent;
|
HANDLE notificationEvent;
|
||||||
std::atomic<bool> isRunning{ false };
|
std::atomic<bool> isRunning{ false };
|
||||||
|
|
||||||
static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCTSTR deviceDescStr,
|
static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCWSTR deviceDescStr,
|
||||||
LPCTSTR deviceModelStr, LPVOID context)
|
LPCWSTR deviceModelStr, LPVOID context)
|
||||||
{
|
{
|
||||||
// Skip undefined audio devices
|
// Skip undefined audio devices
|
||||||
if (deviceIdGuid == NULL)
|
if (deviceIdGuid == NULL)
|
||||||
@ -50,12 +50,15 @@ static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCTSTR devic
|
|||||||
|
|
||||||
AudioGrabber::DeviceProperties device;
|
AudioGrabber::DeviceProperties device;
|
||||||
|
|
||||||
|
// Process Device Information
|
||||||
|
QString deviceName = QString::fromWCharArray(deviceDescStr);
|
||||||
|
|
||||||
// Process Device ID
|
// Process Device ID
|
||||||
LPOLESTR deviceIdStr;
|
LPOLESTR deviceIdStr;
|
||||||
HRESULT res = StringFromCLSID(*deviceIdGuid, &deviceIdStr);
|
HRESULT res = StringFromCLSID(*deviceIdGuid, &deviceIdStr);
|
||||||
if (FAILED(res))
|
if (FAILED(res))
|
||||||
{
|
{
|
||||||
Error(Logger::getInstance("AUDIOGRABBER"), "Failed to get CLSID-string for %s with error: 0x%08x: %s", deviceDescStr, res, std::system_category().message(res).c_str());
|
Error(Logger::getInstance("AUDIOGRABBER"), "Failed to get CLSID-string for %s with error: 0x%08x: %s", QSTRING_CSTR(deviceName), res, std::system_category().message(res).c_str());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,10 +66,7 @@ static BOOL CALLBACK DirectSoundEnumProcessor(LPGUID deviceIdGuid, LPCTSTR devic
|
|||||||
|
|
||||||
CoTaskMemFree(deviceIdStr);
|
CoTaskMemFree(deviceIdStr);
|
||||||
|
|
||||||
// Process Device Information
|
Debug(Logger::getInstance("AUDIOGRABBER"), "Found Audio Device: %s", QSTRING_CSTR(deviceName));
|
||||||
QString deviceName = QString::fromWCharArray(deviceDescStr);
|
|
||||||
|
|
||||||
Debug(Logger::getInstance("AUDIOGRABBER"), "Found Audio Device: %s", deviceDescStr);
|
|
||||||
|
|
||||||
device.id = deviceId;
|
device.id = deviceId;
|
||||||
device.name = deviceName;
|
device.name = deviceName;
|
||||||
|
@ -64,6 +64,9 @@ bool AudioGrabberWindows::configureCaptureInterface()
|
|||||||
// wFormatTag, nChannels, nSamplesPerSec, mAvgBytesPerSec,
|
// wFormatTag, nChannels, nSamplesPerSec, mAvgBytesPerSec,
|
||||||
// nBlockAlign, wBitsPerSample, cbSize
|
// nBlockAlign, wBitsPerSample, cbSize
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
#undef max
|
||||||
|
#endif
|
||||||
notificationSize = std::max(static_cast<DWORD>(1024), static_cast<DWORD>(audioFormat.nAvgBytesPerSec / 8));
|
notificationSize = std::max(static_cast<DWORD>(1024), static_cast<DWORD>(audioFormat.nAvgBytesPerSec / 8));
|
||||||
notificationSize -= notificationSize % audioFormat.nBlockAlign;
|
notificationSize -= notificationSize % audioFormat.nBlockAlign;
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
SET( CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber )
|
SET( CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber )
|
||||||
SET( CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/audio )
|
SET( CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/audio )
|
||||||
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
add_definitions(-DUNICODE -D_UNICODE)
|
||||||
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Windows.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Windows.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
|
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Windows.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Windows.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
|
||||||
elseif(${CMAKE_SYSTEM} MATCHES "Linux")
|
elseif(${CMAKE_SYSTEM} MATCHES "Linux")
|
||||||
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Linux.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Linux.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
|
FILE ( GLOB AUDIO_GRABBER_SOURCES "${CURRENT_HEADER_DIR}/Audio*Linux.h" "${CURRENT_HEADER_DIR}/AudioGrabber.h" "${CURRENT_HEADER_DIR}/AudioWrapper.h" "${CURRENT_SOURCE_DIR}/*.h" "${CURRENT_SOURCE_DIR}/*Linux.cpp" "${CURRENT_SOURCE_DIR}/AudioGrabber.cpp" "${CURRENT_SOURCE_DIR}/AudioWrapper.cpp")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user