|
|
|
|
@ -37,6 +37,11 @@ extern "C" {
|
|
|
|
|
|
|
|
|
|
#ifdef TEST_NULL_AUDIO |
|
|
|
|
static ma_device_data_proc captureCallback; |
|
|
|
|
static std::atomic<bool> failAudioEncoding{false}; |
|
|
|
|
extern "C" int __real_opus_codec_encode(opus_codec_encoder_t*, const int16_t*, int, uint8_t*, int); |
|
|
|
|
extern "C" int __wrap_opus_codec_encode(opus_codec_encoder_t* encoder, const int16_t* pcm, int frames, uint8_t* data, int capacity) { |
|
|
|
|
return failAudioEncoding.exchange(false) ? -1 : __real_opus_codec_encode(encoder, pcm, frames, data, capacity); |
|
|
|
|
} |
|
|
|
|
extern "C" ma_result __real_ma_context_init(const ma_backend*, ma_uint32, const ma_context_config*, ma_context*); |
|
|
|
|
extern "C" ma_result __real_ma_device_init(ma_context*, const ma_device_config*, ma_device*); |
|
|
|
|
extern "C" ma_result __wrap_ma_context_init(const ma_backend*, ma_uint32, const ma_context_config*, ma_context* context) { |
|
|
|
|
@ -282,7 +287,11 @@ private slots:
|
|
|
|
|
} |
|
|
|
|
QVERIFY(window); |
|
|
|
|
#endif |
|
|
|
|
QVERIFY(errors.isEmpty()); engine.stop(); QTRY_VERIFY_WITH_TIMEOUT(!engine.active(), 4000); |
|
|
|
|
QVERIFY(errors.isEmpty()); failAudioEncoding = true; |
|
|
|
|
QTRY_VERIFY(!engine.running()); QTRY_COMPARE(errors.size(), 1); |
|
|
|
|
QVERIFY(!errors.front().front().toString().contains("restored")); |
|
|
|
|
AudioCaptureLease microphone; QVERIFY(microphone.acquire()); microphone.release(); |
|
|
|
|
QTRY_VERIFY_WITH_TIMEOUT(!engine.active(), 4000); |
|
|
|
|
gui_stream_stop(202); sound->shutdown(); |
|
|
|
|
#else |
|
|
|
|
QSKIP("Qt screen capture or null audio unavailable"); |
|
|
|
|
|