mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-08-24 08:01:31 +00:00
[client] usb audio: add microphone recording
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / idd (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Add a composite UAC2 microphone function with its own clock so recording and playback can use independent sample rates. Packetize asynchronous capture through usbredir, follow the host capture clock, and preserve the newest frames across stalls. Reconfigure active recording without another permission prompt and fix lost PipeWire capture wakeups.
This commit is contained in:
@@ -32,13 +32,19 @@ typedef struct LG_USBAudio LG_USBAudio;
|
||||
|
||||
typedef struct LG_USBAudioEventOps
|
||||
{
|
||||
void (*start)(void * opaque, uint32_t sampleRate, uint32_t channelMask);
|
||||
void (*stop)(void * opaque);
|
||||
void (*playbackStart)(
|
||||
void * opaque, uint32_t sampleRate, uint32_t channelMask);
|
||||
void (*playbackStop)(void * opaque);
|
||||
|
||||
/* Data is borrowed interleaved packed signed 24-bit PCM, little endian.
|
||||
* Channels are ordered by ascending set bits in the selected UAC channel
|
||||
* mask. */
|
||||
void (*data)(void * opaque, const void * data, size_t frames);
|
||||
void (*playbackData)(void * opaque, const void * data, size_t frames);
|
||||
|
||||
/* Repeated while active when the recording clock changes rate. */
|
||||
void (*recordStart)(
|
||||
void * opaque, uint32_t sampleRate, uint32_t channelMask);
|
||||
void (*recordStop)(void * opaque);
|
||||
}
|
||||
LG_USBAudioEventOps;
|
||||
|
||||
@@ -51,6 +57,14 @@ void lgUsbAudio_destroy(LG_USBAudio * audio);
|
||||
* feedback thread. */
|
||||
void lgUsbAudio_setFeedbackRate(LG_USBAudio * audio, double sampleRate);
|
||||
|
||||
/* Queue interleaved packed signed 24-bit microphone frames. This may be
|
||||
* called from the audio recording thread. */
|
||||
bool lgUsbAudio_recordData(
|
||||
LG_USBAudio * audio, const void * data, size_t frames);
|
||||
|
||||
/* This must be queried on the PureSpice processing thread. */
|
||||
bool lgUsbAudio_recording(const LG_USBAudio * audio);
|
||||
|
||||
const LG_USBRedirDeviceOps * lgUsbAudio_deviceOps(void);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user