Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qaaudiostream_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 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 QAAUDIOSTREAM_P_H
5#define QAAUDIOSTREAM_P_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 <QtMultimedia/qaudioformat.h>
19
20#include <aaudio/AAudio.h>
21
22QT_BEGIN_NAMESPACE
23
24namespace QtAAudio {
25
26Q_DECLARE_LOGGING_CATEGORY(qLcAAudioStream)
27
28struct StreamBuilder;
29
30struct Stream
31{
32 explicit Stream(const StreamBuilder &builder);
33 ~Stream();
34
36
37 bool start();
38 void stop();
39 void pause();
40 void flush();
41
42 bool isOpen() const;
44
45private:
46 void close();
47
48 aaudio_result_t waitForTargetState(aaudio_stream_state_t targetState);
49
50 template <typename Functor>
51 aaudio_result_t requestWithExpectedState(Functor &&request, aaudio_stream_state_t expected);
52
53 // stream members
54 AAudioStream *m_stream{ nullptr };
55 bool m_areStreamParametersRespected{ false };
56};
57
66
89
90} // namespace QtAAudio
91
92QT_END_NAMESPACE
93
94#endif
constexpr int bufferSizeInBursts
void setMMapPolicy(int policy)
static aaudio_format_t aaudioFormat(const QAudioFormat::SampleFormat sampleFormat)
constexpr std::chrono::nanoseconds stateChangeTimeout
StreamBuilder(QAudioFormat format)
StreamParameterSet params
AAudioStream_errorCallback errorCallback
AAudioStream_dataCallback callback
aaudio_content_type_t outputContentType
aaudio_input_preset_t inputPreset
aaudio_sharing_mode_t sharingMode
Stream(const StreamBuilder &builder)
bool areStreamParametersRespected() const
bool isOpen() const