Add internal audio diagnostics and isolate customer SDK exports
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "audio_playback.h"
|
||||
|
||||
#if GVFG_INTERNAL_DIAGNOSTICS
|
||||
#include "internal_diagnostics.h"
|
||||
#endif
|
||||
@@ -13,12 +15,8 @@
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
#include <chrono>
|
||||
#include <condition_variable>
|
||||
#include <cstdint>
|
||||
#include <deque>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <vector>
|
||||
|
||||
class QTimer;
|
||||
|
||||
@@ -42,6 +40,7 @@ public:
|
||||
bool frameAvailable(int channel) const;
|
||||
bool cachedSignalStatus(int channel, gvfg_signal_status_t *status) const;
|
||||
QString sdkVersion() const;
|
||||
QString gigabyteLibVersion() const;
|
||||
|
||||
public slots:
|
||||
void refreshDevices();
|
||||
@@ -69,12 +68,12 @@ signals:
|
||||
private:
|
||||
bool openDevice();
|
||||
bool applyOutputFormat(int channel);
|
||||
bool prepareAudio(int channel);
|
||||
void closeDeviceSession(bool clearSelection);
|
||||
void closeDeviceIfIdle();
|
||||
|
||||
struct ChannelRuntime
|
||||
{
|
||||
struct AudioPacket { std::vector<uint8_t> pcm; };
|
||||
bool opened = false;
|
||||
bool zeroCopy = false;
|
||||
bool requestedAudio = false;
|
||||
@@ -82,17 +81,11 @@ private:
|
||||
void *previewTarget = nullptr;
|
||||
gvfg_preview_handle previewHandle = nullptr;
|
||||
std::atomic<bool> running{false}, stopRequested{false}, signalConnected{false};
|
||||
std::mutex signalMutex;
|
||||
std::condition_variable signalReady;
|
||||
std::atomic<bool> frameAvailable{false}, previewVisible{false}, captureThreadExited{true};
|
||||
std::thread captureThread, audioThread, audioPlaybackThread;
|
||||
std::mutex audioQueueMutex;
|
||||
std::condition_variable audioQueueReady;
|
||||
std::deque<AudioPacket> audioQueue;
|
||||
std::thread captureThread, audioThread;
|
||||
AudioPlayback audioPlayback;
|
||||
bool audioEnabled = false;
|
||||
gvfg_audio_format_t audioFormat{};
|
||||
uint64_t audioReceivedFrames = 0;
|
||||
uint64_t audioReleaseFailedFrames = 0, audioOutputFailedFrames = 0;
|
||||
std::atomic<uint64_t> videoFailed{0};
|
||||
gvfg_preview_delivery_stats_t previewBaseline{};
|
||||
uint64_t lastLoggedPreviewFailures = 0;
|
||||
@@ -114,7 +107,6 @@ private:
|
||||
#endif
|
||||
void captureReadLoop(int channel);
|
||||
void audioReadLoop(int channel);
|
||||
void audioPlaybackLoop(int channel);
|
||||
void joinCaptureThread(int channel);
|
||||
void joinAudioThread(int channel);
|
||||
void logDeliveryStatus(int channel, bool finalSnapshot = false);
|
||||
|
||||
Reference in New Issue
Block a user