1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPULSEHELPER_H
5#define QPULSEHELPER_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include "qaudiodevice.h"
19#include <qaudioformat.h>
20#include <pulse/pulseaudio.h>
21#include <QtCore/QLoggingCategory>
22#include <QtCore/qdebug.h>
23
24QT_BEGIN_NAMESPACE
25
26Q_DECLARE_LOGGING_CATEGORY(qLcPulseAudioOut)
27Q_DECLARE_LOGGING_CATEGORY(qLcPulseAudioIn)
28Q_DECLARE_LOGGING_CATEGORY(qLcPulseAudioEngine)
29
30struct PAOperationDeleter
31{
32 void operator()(pa_operation *op) const { pa_operation_unref(o: op); }
33};
34
35using PAOperationUPtr = std::unique_ptr<pa_operation, PAOperationDeleter>;
36
37namespace QPulseAudioInternal
38{
39pa_sample_spec audioFormatToSampleSpec(const QAudioFormat &format);
40QAudioFormat sampleSpecToAudioFormat(const pa_sample_spec &spec);
41pa_channel_map channelMapForAudioFormat(const QAudioFormat &format);
42QAudioFormat::ChannelConfig channelConfigFromMap(const pa_channel_map &map);
43
44QUtf8StringView currentError(const pa_context *);
45QUtf8StringView currentError(const pa_stream *);
46
47} // namespace QPulseAudioInternal
48
49QDebug operator<<(QDebug, pa_stream_state_t);
50QDebug operator<<(QDebug, pa_sample_format);
51QDebug operator<<(QDebug, pa_context_state_t);
52
53QT_END_NAMESPACE
54
55#endif
56

Provided by KDAB

Privacy Policy
Learn to use CMake with our Intro Training
Find out more

source code of qtmultimedia/src/multimedia/pulseaudio/qpulsehelpers_p.h