Refactor/Create APT/DNF Repository (#1648)

This commit is contained in:
Paulchen-Panther
2023-11-16 21:05:56 +01:00
committed by GitHub
parent c9518db597
commit 91270966f9
165 changed files with 1918 additions and 2924 deletions

View File

@@ -1,4 +1,4 @@
#include <grabber/AudioGrabberWindows.h>
#include <grabber/audio/AudioGrabberWindows.h>
#include <climits>
@@ -71,7 +71,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
notificationSize -= notificationSize % audioFormat.nBlockAlign;
bufferCaptureSize = notificationSize * AUDIO_NOTIFICATION_COUNT;
DSCBUFFERDESC bufferDesc;
bufferDesc.dwSize = sizeof(DSCBUFFERDESC);
bufferDesc.dwFlags = 0;
@@ -80,7 +80,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
bufferDesc.lpwfxFormat = &audioFormat;
bufferDesc.dwFXCount = 0;
bufferDesc.lpDSCFXDesc = NULL;
// Create Capture Device's Buffer
LPDIRECTSOUNDCAPTUREBUFFER preBuffer;
if (FAILED(recordingDevice->CreateCaptureBuffer(&bufferDesc, &preBuffer, NULL)))
@@ -101,7 +101,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
}
preBuffer->Release();
// Create Notifications
LPDIRECTSOUNDNOTIFY8 notify;
@@ -112,7 +112,7 @@ bool AudioGrabberWindows::configureCaptureInterface()
recordingBuffer->Release();
return false;
}
// Create Events
notificationEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -133,11 +133,11 @@ bool AudioGrabberWindows::configureCaptureInterface()
positionNotify[i].dwOffset = (notificationSize * i) + notificationSize - 1;
positionNotify[i].hEventNotify = notificationEvent;
}
// Set Notifications
notify->SetNotificationPositions(AUDIO_NOTIFICATION_COUNT, positionNotify);
notify->Release();
return true;
}
@@ -162,12 +162,12 @@ bool AudioGrabberWindows::start()
}
Info(_log, "Capture audio from %s", QSTRING_CSTR(getDeviceName(_device)));
if (!this->configureCaptureInterface())
{
return false;
}
if (FAILED(recordingBuffer->Start(DSCBSTART_LOOPING)))
{
Error(_log, "Failed starting audio capture from '%s'", QSTRING_CSTR(getDeviceName(_device)));
@@ -214,7 +214,7 @@ void AudioGrabberWindows::stop()
{
Error(_log, "Audio capture failed to stop: '%s'", QSTRING_CSTR(getDeviceName(_device)));
}
if (FAILED(recordingBuffer->Release()))
{
Error(_log, "Failed to release recording buffer: '%s'", QSTRING_CSTR(getDeviceName(_device)));
@@ -306,7 +306,7 @@ void AudioGrabberWindows::processAudioBuffer()
// Buffer wrapped around, read second position
if (capturedAudio2 != NULL)
{
{
bufferCapturePosition += capturedAudio2Length;
bufferCapturePosition %= bufferCaptureSize; // Circular Buffer
}
@@ -318,13 +318,13 @@ void AudioGrabberWindows::processAudioBuffer()
{
CopyMemory(readBuffer + capturedAudioLength, capturedAudio2, capturedAudio2Length);
}
// Release Buffer Lock
recordingBuffer->Unlock(capturedAudio, capturedAudioLength, capturedAudio2, capturedAudio2Length);
// Process Audio Frame
this->processAudioFrame(readBuffer, frameSize);
delete[] readBuffer;
}