Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qaudioengine_pulse.cpp File Reference

(1d962ce5193d9a79eb23010eaa72f6b7a6fd991e)

#include <QtCore/qdebug.h>
#include <qaudiodevice.h>
#include <QGuiApplication>
#include <QIcon>
#include <QTimer>
#include "qaudioengine_pulse_p.h"
#include "qpulseaudiodevice_p.h"
#include "qpulsehelpers_p.h"
#include <sys/types.h>
#include <unistd.h>
#include <mutex>
+ Include dependency graph for qaudioengine_pulse.cpp:

Go to the source code of this file.

Functions

template<typename Info >
static QT_BEGIN_NAMESPACE bool updateDevicesMap (QReadWriteLock &lock, QByteArray defaultDeviceId, QMap< int, QAudioDevice > &devices, QAudioDevice::Mode mode, const Info &info)
 
static bool updateDevicesMap (QReadWriteLock &lock, QByteArray defaultDeviceId, QMap< int, QAudioDevice > &devices)
 
static void serverInfoCallback (pa_context *context, const pa_server_info *info, void *userdata)
 
static void sinkInfoCallback (pa_context *context, const pa_sink_info *info, int isLast, void *userdata)
 
static void sourceInfoCallback (pa_context *context, const pa_source_info *info, int isLast, void *userdata)
 
static void event_cb (pa_context *context, pa_subscription_event_type_t t, uint32_t index, void *userdata)
 
static void contextStateCallbackInit (pa_context *context, void *userdata)
 
static void contextStateCallback (pa_context *c, void *userdata)
 
 Q_GLOBAL_STATIC (QPulseAudioEngine, pulseEngine)
 

Function Documentation

◆ contextStateCallback()

static void contextStateCallback ( pa_context * c,
void * userdata )
static

Definition at line 276 of file qaudioengine_pulse.cpp.

References QMetaObject::invokeMethod(), Q_UNLIKELY, qCDebug, QtDebugMsg, Qt::QueuedConnection, and state.

+ Here is the call graph for this function:

◆ contextStateCallbackInit()

static void contextStateCallbackInit ( pa_context * context,
void * userdata )
static

Definition at line 265 of file qaudioengine_pulse.cpp.

References context, QPulseAudioEngine::mainloop(), Q_UNLIKELY, Q_UNUSED, qCDebug, and QtDebugMsg.

+ Here is the call graph for this function:

◆ event_cb()

static void event_cb ( pa_context * context,
pa_subscription_event_type_t t,
uint32_t index,
void * userdata )
static

Definition at line 209 of file qaudioengine_pulse.cpp.

References context, QPulseAudioEngine::m_sinkLock, QPulseAudioEngine::m_sinks, QPulseAudioEngine::m_sourceLock, QPulseAudioEngine::m_sources, qWarning, QMap< Key, T >::remove(), serverInfoCallback(), sinkInfoCallback(), and sourceInfoCallback().

+ Here is the call graph for this function:

◆ Q_GLOBAL_STATIC()

Q_GLOBAL_STATIC ( QPulseAudioEngine ,
pulseEngine  )

◆ serverInfoCallback()

static void serverInfoCallback ( pa_context * context,
const pa_server_info * info,
void * userdata )
static

Definition at line 63 of file qaudioengine_pulse.cpp.

References QPulseAudioEngine::audioInputsChanged(), QPulseAudioEngine::audioOutputsChanged(), context, emit, QString::fromUtf8(), info, QPulseAudioEngine::m_defaultSink, QPulseAudioEngine::m_defaultSource, QPulseAudioEngine::m_serverLock, QPulseAudioEngine::m_sinkLock, QPulseAudioEngine::m_sinks, QPulseAudioEngine::m_sourceLock, QPulseAudioEngine::m_sources, QPulseAudioEngine::mainloop(), Q_UNLIKELY, qCDebug, QStringLiteral, QtDebugMsg, qWarning, and updateDevicesMap().

Referenced by event_cb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sinkInfoCallback()

static void sinkInfoCallback ( pa_context * context,
const pa_sink_info * info,
int isLast,
void * userdata )
static

Definition at line 128 of file qaudioengine_pulse.cpp.

References QPulseAudioEngine::audioOutputsChanged(), context, emit, QString::fromUtf8(), info, QPulseAudioEngine::m_defaultSink, QPulseAudioEngine::m_sinkLock, QPulseAudioEngine::m_sinks, QPulseAudioEngine::mainloop(), QString::number(), QAudioDevice::Output, Q_ASSERT, Q_UNLIKELY, qCDebug, QStringLiteral, QtDebugMsg, qWarning, and updateDevicesMap().

Referenced by event_cb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sourceInfoCallback()

static void sourceInfoCallback ( pa_context * context,
const pa_source_info * info,
int isLast,
void * userdata )
static

Definition at line 169 of file qaudioengine_pulse.cpp.

References QPulseAudioEngine::audioInputsChanged(), context, emit, QString::fromUtf8(), info, QAudioDevice::Input, QPulseAudioEngine::m_defaultSource, QPulseAudioEngine::m_sourceLock, QPulseAudioEngine::m_sources, QPulseAudioEngine::mainloop(), QString::number(), Q_ASSERT, Q_UNLIKELY, Q_UNUSED, qCDebug, QStringLiteral, QtDebugMsg, and updateDevicesMap().

Referenced by event_cb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateDevicesMap() [1/2]

static bool updateDevicesMap ( QReadWriteLock & lock,
QByteArray defaultDeviceId,
QMap< int, QAudioDevice > & devices )
static

Definition at line 40 of file qaudioengine_pulse.cpp.

References device, lock, and Q_ASSERT.

◆ updateDevicesMap() [2/2]

template<typename Info >
static QT_BEGIN_NAMESPACE bool updateDevicesMap ( QReadWriteLock & lock,
QByteArray defaultDeviceId,
QMap< int, QAudioDevice > & devices,
QAudioDevice::Mode mode,
const Info & info )
static

Definition at line 20 of file qaudioengine_pulse.cpp.

References QPulseAudioInternal::channelConfigFromMap(), device, info, lock, and QPulseAudioInternal::sampleSpecToAudioFormat().

Referenced by serverInfoCallback(), sinkInfoCallback(), and sourceInfoCallback().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: