Merge branch 'hyperion-project:master' into comments

This commit is contained in:
Thinner77 2024-06-15 13:34:38 +02:00 committed by GitHub
commit b79a7139ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 40 additions and 12 deletions
.github/workflows
dependencies/external
include
grabber/video/mediafoundation
utils
libsrc/grabber
dda
video/mediafoundation

@ -163,19 +163,26 @@ jobs:
uses: actions/cache@v4
with:
path: C:\Users\runneradmin\AppData\Local\Temp\chocolatey
key: ${{ runner.os }}${{ inputs.qt_version == '6' && '-chocolatey-qt6' || '-chocolatey' }}
key: ${{ runner.os }}${{ '-chocolatey' }}
- name: 📥 Install DirectX SDK, OpenSSL, libjpeg-turbo ${{ inputs.qt_version == '6' && 'and Vulkan-SDK' || '' }}
- name: 📥 Install DirectX SDK, OpenSSL, libjpeg-turbo
shell: powershell
run: |
choco install --no-progress directx-sdk ${{env.VULKAN_SDK}} -y
choco install --no-progress directx-sdk -y
choco install --no-progress ${{env.OPENSSL}} -y
Invoke-WebRequest https://netcologne.dl.sourceforge.net/project/libjpeg-turbo/3.0.1/libjpeg-turbo-3.0.1-vc64.exe -OutFile libjpeg-turbo.exe -UserAgent NativeHost
.\libjpeg-turbo /S
env:
VULKAN_SDK: ${{ inputs.qt_version == '6' && 'vulkan-sdk' || '' }}
OPENSSL: ${{ inputs.qt_version == '6' && 'openssl' || 'openssl --version=1.1.1.2100' }}
- name: Install Vulkan SDK
if: ${{ inputs.qt_version == '6' }}
uses: jakoch/install-vulkan-sdk-action@v1.0.3
with:
install_runtime: false
cache: true
stripdown: true
- name: 📥 Install Qt
uses: jurplel/install-qt-action@v4
with:

@ -1 +1 @@
Subproject commit 0100f6a5779831fa7a651e4b67ef389a8752bd9b
Subproject commit 595bf0007ab1929570c7671f091313c8fc20644e

@ -1 +1 @@
Subproject commit edb8fec9882084344a314368ac7fd957a187519c
Subproject commit 2ca6c285a0dd3f33982dd57299012dacab1ff206

@ -1 +1 @@
Subproject commit 7f94235e552599141950d7a4a3eaf93bc87d1b22
Subproject commit 3d9f7c430a5ae1385512908801492d4421c3cdb7

@ -46,6 +46,7 @@ public:
int numerator = 0;
int denominator = 0;
PixelFormat pf = PixelFormat::NO_CHANGE;
long defstride = 0;
GUID guid = GUID_NULL;
};

@ -124,10 +124,10 @@ inline QString pixelFormatToString(const PixelFormat& pixelFormat)
enum class FlipMode
{
NO_CHANGE,
HORIZONTAL,
VERTICAL,
BOTH,
NO_CHANGE
BOTH
};
inline FlipMode parseFlipMode(const QString& flipMode)

@ -174,7 +174,7 @@ int DDAGrabber::grabFrame(Image<ColorRgb> &image)
// Acquire the next frame.
CComPtr<IDXGIResource> desktopResource;
DXGI_OUTDUPL_FRAME_INFO frameInfo;
hr = d->desktopDuplication->AcquireNextFrame(INFINITE, &frameInfo, &desktopResource);
hr = d->desktopDuplication->AcquireNextFrame(500, &frameInfo, &desktopResource);
if (hr == DXGI_ERROR_ACCESS_LOST || hr == DXGI_ERROR_INVALID_CALL)
{
if (!restartCapture())
@ -185,7 +185,7 @@ int DDAGrabber::grabFrame(Image<ColorRgb> &image)
}
if (hr == DXGI_ERROR_WAIT_TIMEOUT)
{
// This shouldn't happen since we specified an INFINITE timeout.
// Nothing changed on the screen in the 500ms we waited.
return 0;
}
RETURN_IF_ERROR(hr, "Failed to acquire next frame", 0);

@ -363,6 +363,18 @@ done:
_height = props.height;
_frameByteSize = _width * _height * 3;
_lineLength = _width * 3;
// adjust flipMode for bottom-up images
if (props.defstride < 0)
{
if (_flipMode == FlipMode::NO_CHANGE)
_flipMode = FlipMode::HORIZONTAL;
else if (_flipMode == FlipMode::HORIZONTAL)
_flipMode = FlipMode::NO_CHANGE;
else if (_flipMode == FlipMode::VERTICAL)
_flipMode = FlipMode::BOTH;
else if (_flipMode == FlipMode::BOTH)
_flipMode = FlipMode::VERTICAL;
}
}
// Cleanup
@ -436,6 +448,14 @@ void MFGrabber::enumVideoCaptureDevices()
properties.denominator = denominator;
properties.pf = pixelformat;
properties.guid = format;
HRESULT hr = pType->GetUINT32(MF_MT_DEFAULT_STRIDE, (UINT32*)&properties.defstride);
if (FAILED(hr))
{
hr = MFGetStrideForBitmapInfoHeader(format.Data1, width, &properties.defstride);
if (FAILED(hr))
DebugIf (verbose, _log, "failed to get default stride");
}
devicePropertyList.append(properties);
DebugIf (verbose, _log, "%s %d x %d @ %d fps (%s)", QSTRING_CSTR(dev), properties.width, properties.height, properties.fps, QSTRING_CSTR(pixelFormatToString(properties.pf)));
@ -797,7 +817,7 @@ QJsonArray MFGrabber::discover(const QJsonObject& params)
resolution_default["width"] = 640;
resolution_default["height"] = 480;
resolution_default["fps"] = 25;
format_default["format"] = "bgr24";
format_default["format"] = "rgb24";
format_default["resolution"] = resolution_default;
video_inputs_default["inputIdx"] = 0;
video_inputs_default["standards"] = "PAL";