Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qaudiosystem_p.h
Go to the documentation of this file.
1
// Copyright (C) 2022 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
QAUDIOSYSTEM_H
5
#
define
QAUDIOSYSTEM_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
/
private
/
qaudiohelpers_p
.
h
>
19
#
include
<
QtMultimedia
/
private
/
qtmm_rtsan_support_p
.
h
>
20
#
include
<
QtMultimedia
/
qaudio
.
h
>
21
#
include
<
QtMultimedia
/
qaudiodevice
.
h
>
22
#
include
<
QtMultimedia
/
qaudioformat
.
h
>
23
#
include
<
QtMultimedia
/
qtmultimediaglobal
.
h
>
24
#
include
<
QtCore
/
private
/
qglobal_p
.
h
>
25
#
include
<
QtCore
/
qelapsedtimer
.
h
>
26
#
include
<
QtCore
/
qspan
.
h
>
27
28
#
include
<
optional
>
29
30
#
include
<
array
>
31
#
include
<
variant
>
32
33
#
include
<
stdlib
.
h
>
34
#
if
__has_include
(
<
alloca
.
h
>
)
35
#
include
<
alloca
.
h
>
36
#
endif
37
#
if
__has_include
(
<
malloc
.
h
>
)
38
#
include
<
malloc
.
h
>
39
#
endif
40
41
#
if
defined
(
Q_CC_MSVC
)
&&
!
defined
(
alloca
)
42
#
define
alloca
_alloca
43
#
endif
44
45
QT_BEGIN_NAMESPACE
46
47
class
QIODevice;
48
class
QAudioSink;
49
class
QAudioSource;
50
51
namespace
QtMultimediaPrivate
{
52
53
using
QtAudioPrivate
::
AudioSinkCallbackType
;
54
using
QtAudioPrivate
::
AudioSourceCallbackType
;
55
56
#
if
__cpp_lib_move_only_function
57
58
template
<
typename
SampleType
>
59
using
AudioSinkMoveOnlyCallbackType
=
std
::
move_only_function
<
void
(
QSpan
<
SampleType
>)>;
60
61
template
<
typename
SampleType
>
62
using
AudioSourceMoveOnlyCallbackType
=
std
::
move_only_function
<
void
(
QSpan
<
const
SampleType
>)>;
63
64
using
AudioSinkMoveOnlyCallback
=
65
std
::
variant
<
AudioSinkMoveOnlyCallbackType
<
float
>,
AudioSinkMoveOnlyCallbackType
<
uint8_t
>,
66
AudioSinkMoveOnlyCallbackType
<
int16_t
>,
67
AudioSinkMoveOnlyCallbackType
<
int32_t
>>;
68
69
using
AudioSourceMoveOnlyCallback
=
std
::
variant
<
70
AudioSourceMoveOnlyCallbackType
<
float
>,
AudioSourceMoveOnlyCallbackType
<
uint8_t
>,
71
AudioSourceMoveOnlyCallbackType
<
int16_t
>,
AudioSourceMoveOnlyCallbackType
<
int32_t
>>;
72
73
template
<
typename
V1
,
typename
V2
>
74
struct
variant_cat
;
75
76
template
<
typename
...
Ts1
,
typename
...
Ts2
>
77
struct
variant_cat
<
std
::
variant
<
Ts1
...>,
std
::
variant
<
Ts2
...>>
78
{
79
using
type
=
std
::
variant
<
Ts1
...,
Ts2
...>;
80
};
81
82
template
<
typename
V1
,
typename
V2
>
83
using
variant_cat_t
=
typename
variant_cat
<
V1
,
V2
>::
type
;
84
85
#
endif
86
87
///////////////////////////////////////////////////////////////////////////////////////////////////
88
89
enum
class
AudioEndpointRole
:
uint8_t
90
{
91
MediaPlayback
,
92
SoundEffect
,
93
Accessibility
,
94
Other
,
95
};
96
97
///////////////////////////////////////////////////////////////////////////////////////////////////
98
99
template
<
typename
>
100
struct
GetSampleTypeImpl
;
101
102
template
<>
103
struct
GetSampleTypeImpl
<
float
>
104
{
105
using
type
=
float
;
106
static
constexpr
QAudioFormat
::
SampleFormat
sample_format
=
QAudioFormat
::
SampleFormat
::
Float
;
107
};
108
109
template
<>
110
struct
GetSampleTypeImpl
<int32_t>
111
{
112
using
type
= int32_t;
113
static
constexpr
QAudioFormat
::
SampleFormat
sample_format
=
QAudioFormat
::
SampleFormat
::
Int32
;
114
};
115
template
<>
116
struct
GetSampleTypeImpl
<int16_t>
117
{
118
using
type
= int16_t;
119
static
constexpr
QAudioFormat
::
SampleFormat
sample_format
=
QAudioFormat
::
SampleFormat
::
Int16
;
120
};
121
122
template
<>
123
struct
GetSampleTypeImpl
<
uint8_t
>
124
{
125
using
type
=
uint8_t
;
126
static
constexpr
QAudioFormat
::
SampleFormat
sample_format
=
QAudioFormat
::
SampleFormat
::
UInt8
;
127
};
128
129
template
<
typename
T
>
130
struct
GetSampleTypeImpl
<
AudioSinkCallbackType
<
T
>> :
GetSampleTypeImpl
<
T
>
131
{
132
};
133
134
template
<
typename
T
>
135
struct
GetSampleTypeImpl
<
AudioSourceCallbackType
<
T
>> :
GetSampleTypeImpl
<
T
>
136
{
137
};
138
139
#
if
__cpp_lib_move_only_function
140
141
template
<
typename
T
>
142
struct
GetSampleTypeImpl
<
AudioSinkMoveOnlyCallbackType
<
T
>> :
GetSampleTypeImpl
<
T
>
143
{
144
};
145
146
template
<
typename
T
>
147
struct
GetSampleTypeImpl
<
AudioSourceMoveOnlyCallbackType
<
T
>> :
GetSampleTypeImpl
<
T
>
148
{
149
};
150
151
#
endif
152
153
template
<
typename
SampleTypeOrCallbackType>
154
using
GetSampleType
=
typename
GetSampleTypeImpl
<SampleTypeOrCallbackType>::
type
;
155
156
template
<
typename
SampleTypeOrCallbackType>
157
static
constexpr
QAudioFormat
::
SampleFormat
getSampleFormat
()
158
{
159
return
GetSampleTypeImpl
<SampleTypeOrCallbackType>::sample_format;
160
}
161
162
#
if
__cpp_lib_move_only_function
163
using
AudioSinkCallback
=
164
variant_cat_t
<
QtAudioPrivate
::
AudioSinkCallback
,
AudioSinkMoveOnlyCallback
>;
165
using
AudioSourceCallback
=
166
variant_cat_t
<
QtAudioPrivate
::
AudioSourceCallback
,
AudioSourceMoveOnlyCallback
>;
167
#
else
168
using
AudioSinkCallback
=
QtAudioPrivate
::
AudioSinkCallback
;
169
using
AudioSourceCallback
=
QtAudioPrivate
::
AudioSourceCallback
;
170
#
endif
171
172
template
<
typename
Callback>
173
inline
AudioSinkCallback
asAudioSinkCallback
(Callback &&cb)
174
{
175
if
constexpr
(std::is_same_v<Callback, AudioSinkCallback>) {
176
return
std
::forward<Callback>(cb);
177
}
else
{
178
return
std
::visit([](
auto
&&arg) -> AudioSinkCallback {
179
return
arg;
180
},
std
::forward<Callback>(cb));
181
}
182
}
183
template
<
typename
Callback>
184
inline
AudioSourceCallback
asAudioSourceCallback
(Callback &&cb)
185
{
186
if
constexpr
(std::is_same_v<Callback, AudioSourceCallback>) {
187
return
std
::forward<Callback>(cb);
188
}
else
{
189
return
std
::visit([](
auto
&&arg) -> AudioSourceCallback {
190
return
arg;
191
},
std
::forward<Callback>(cb));
192
}
193
}
194
195
template
<
typename
AnyAudioCallback>
196
constexpr
bool
validateAudioCallbackImpl
(
const
AnyAudioCallback &audioCallback,
197
const
QAudioFormat &format)
198
{
199
bool
isNonNullFunction =
std
::visit([](
const
auto
&cb) {
200
return
bool
(cb);
201
}, audioCallback);
202
203
if
(!isNonNullFunction)
204
return
false
;
205
206
bool
hasCorrectFormat =
std
::visit([&](
const
auto
&cb) {
207
return
getSampleFormat<std::decay_t<
decltype
(cb)>>() == format.sampleFormat();
208
}, audioCallback);
209
210
return
hasCorrectFormat;
211
}
212
213
constexpr
bool
validateAudioCallback
(
const
AudioSinkCallback &audioCallback,
214
const
QAudioFormat &format)
215
{
216
return
validateAudioCallbackImpl(audioCallback, format);
217
}
218
219
constexpr
bool
validateAudioCallback
(
const
AudioSourceCallback &audioCallback,
220
const
QAudioFormat &format)
221
{
222
return
validateAudioCallbackImpl(audioCallback, format);
223
}
224
225
// if the requested buffer is reasonably small (64kb, big enougth for 16 channels, 1024 frames,
226
// float32) we can use a stack-allocated temporary buffer.
227
// otherwise we allocate a heap buffer.
228
template
<
size_t
limit
= 1024 * 64,
typename
Functor
>
229
inline
auto
withTemporaryBuffer
(
size_t
bufferSize
,
Functor
&&
f
)
noexcept
Q_DECL_NONBLOCKING_FUNCTION
230
{
231
if
(
bufferSize
<=
limit
)
Q_LIKELY_BRANCH
{
232
#
ifdef
alloca
233
std
::
byte
*
stackBuffer
=
reinterpret_cast
<
std
::
byte
*>(alloca(
bufferSize
));
234
auto
stackBufferSpan
=
QSpan
<
std
::
byte
>{
235
stackBuffer
,
236
qsizetype
(
bufferSize
),
237
};
238
#
else
239
std
::
array
<
std
::
byte
,
limit
>
stackArray
;
240
auto
stackBufferSpan
=
QSpan
<
std
::
byte
>{
241
stackArray
,
242
qsizetype
(
bufferSize
),
243
};
244
#
endif
245
return
f
(
stackBufferSpan
);
246
}
else
{
247
QtPrivate
::
ScopedRTSanDisabler
allowAllocations
;
248
auto
heapBuffer
=
q20
::
make_unique_for_overwrite
<
std
::
byte
[]>(
bufferSize
);
249
auto
heapBufferSpan
=
QSpan
<
std
::
byte
>{
250
heapBuffer
.
get
(),
251
qsizetype
(
bufferSize
),
252
};
253
return
f
(
heapBufferSpan
);
254
}
255
}
256
257
namespace
impl
{
258
259
template
<
bool
IsSink
>
260
inline
void
261
runAudioCallback
(
std
::
conditional_t
<
IsSink
,
AudioSinkCallback
,
AudioSourceCallback
> &
audioCallback
,
262
QSpan
<
std
::
conditional_t
<
IsSink
,
std
::
byte
,
const
std
::
byte
>>
hostBuffer
,
263
const
QAudioFormat
&
format
)
264
{
265
Q_ASSERT
(!
hostBuffer
.
empty
());
266
267
bool
callbackIsValid
=
validateAudioCallback
(
audioCallback
,
format
);
268
Q_PRESUME
(
callbackIsValid
);
269
270
int
numberOfSamples
=
271
format
.
framesForBytes
(
qint32
(
hostBuffer
.
size
())) *
format
.
channelCount
();
272
273
std
::
visit
([&](
auto
&
callback
) {
274
using
FunctorType
=
std
::
decay_t
<
decltype
(
callback
)>;
275
Q_ASSERT
(
getSampleFormat
<
FunctorType
>() ==
format
.
sampleFormat
());
276
277
using
SampleType
=
GetSampleType
<
FunctorType
>;
278
279
bool
audioCallbackIsValid
=
bool
(
callback
);
280
Q_PRESUME
(
audioCallbackIsValid
);
281
using
HostBufferType
=
std
::
conditional_t
<
IsSink
,
SampleType
,
const
SampleType
>;
282
283
auto
buffer
=
QSpan
<
HostBufferType
>{
284
reinterpret_cast
<
HostBufferType
*>(
hostBuffer
.
data
()),
285
numberOfSamples
,
286
};
287
callback
(
buffer
);
288
},
audioCallback
);
289
}
290
291
}
// namespace impl
292
293
inline
void
runAudioCallback
(
AudioSinkCallback
&
audioCallback
,
QSpan
<
std
::
byte
>
hostBuffer
,
294
const
QAudioFormat
&
format
,
float
volume
)
295
{
296
impl
::
runAudioCallback
<
true
>(
audioCallback
,
hostBuffer
,
format
);
297
QAudioHelperInternal
::
applyVolume
(
volume
,
format
,
hostBuffer
,
hostBuffer
);
298
}
299
300
inline
void
runAudioCallback
(
AudioSinkCallback
&
audioCallback
,
QSpan
<
std
::
byte
>
hostBuffer
,
301
const
QAudioFormat
&
applicationFormat
,
float
volume
,
302
const
QAudioFormat
&
hostFormat
)
303
{
304
using
namespace
QAudioHelperInternal
;
305
const
int32_t
numberOfFrames
=
306
hostFormat
.
framesForBytes
(
qint32
(
hostBuffer
.
size
()));
307
const
int32_t
applicationBufferSize
=
applicationFormat
.
bytesForFrames
(
numberOfFrames
);
308
309
withTemporaryBuffer
(
applicationBufferSize
, [&](
QSpan
<
std
::
byte
>
tempBuffer
) {
310
runAudioCallback
(
audioCallback
,
tempBuffer
,
applicationFormat
,
volume
);
311
convertSampleFormat
(
tempBuffer
,
toNativeSampleFormat
(
applicationFormat
.
sampleFormat
()),
312
hostBuffer
,
toNativeSampleFormat
(
hostFormat
.
sampleFormat
()));
313
});
314
}
315
316
inline
void
runAudioCallback
(
AudioSinkCallback
&
audioCallback
,
QSpan
<
std
::
byte
>
hostBuffer
,
317
const
QAudioFormat
&
applicationFormat
,
float
volume
,
318
QAudioHelperInternal
::
NativeSampleFormat
nativeHostFormat
)
319
{
320
using
namespace
QAudioHelperInternal
;
321
const
int32_t
numberOfFrames
=
int32_t
(
322
hostBuffer
.
size
() / (
bytesPerSample
(
nativeHostFormat
) *
applicationFormat
.
channelCount
()));
323
const
int32_t
applicationBufferSize
=
applicationFormat
.
bytesForFrames
(
numberOfFrames
);
324
325
withTemporaryBuffer
(
applicationBufferSize
, [&](
QSpan
<
std
::
byte
>
tempBuffer
) {
326
runAudioCallback
(
audioCallback
,
tempBuffer
,
applicationFormat
,
volume
);
327
convertSampleFormat
(
tempBuffer
,
toNativeSampleFormat
(
applicationFormat
.
sampleFormat
()),
328
hostBuffer
,
nativeHostFormat
);
329
});
330
}
331
332
// NB: we we provide two overloads for running audio callbacks based on the host buffer:
333
// * if the host buffer is immutable, we need to apply the volume on a temporary buffer
334
// * if the host buffer is mutable, we can apply the volume in-place (currently unused)
335
inline
void
runAudioCallback
(
AudioSourceCallback
&
audioCallback
,
QSpan
<
const
std
::
byte
>
hostBuffer
,
336
const
QAudioFormat
&
format
,
float
volume
)
337
{
338
if
(
volume
== 1.0f) {
339
impl
::
runAudioCallback
<
false
>(
audioCallback
,
hostBuffer
,
format
);
340
}
else
{
341
withTemporaryBuffer
(
hostBuffer
.
size
(), [&](
QSpan
<
std
::
byte
>
tempBuffer
) {
342
QAudioHelperInternal
::
applyVolume
(
volume
,
format
,
hostBuffer
,
tempBuffer
);
343
impl
::
runAudioCallback
<
false
>(
audioCallback
,
tempBuffer
,
format
);
344
});
345
}
346
}
347
348
inline
void
runAudioCallback
(
AudioSourceCallback
&
audioCallback
,
QSpan
<
std
::
byte
>
hostBuffer
,
349
const
QAudioFormat
&
format
,
float
volume
)
350
{
351
QAudioHelperInternal
::
applyVolume
(
volume
,
format
,
hostBuffer
,
hostBuffer
);
352
impl
::
runAudioCallback
<
false
>(
audioCallback
,
hostBuffer
,
format
);
353
}
354
355
template
<
typename
HostBufferType
>
356
inline
void
runAudioCallback
(
AudioSourceCallback
&
audioCallback
,
QSpan
<
HostBufferType
>
hostBuffer
,
357
const
QAudioFormat
&
applicationFormat
,
float
volume
,
358
const
QAudioFormat
&
hostFormat
)
359
{
360
static_assert
(
std
::
is_same_v
<
HostBufferType
,
std
::
byte
>
361
||
std
::
is_same_v
<
HostBufferType
,
const
std
::
byte
>);
362
363
using
namespace
QAudioHelperInternal
;
364
365
const
int32_t
numberOfFrames
=
366
hostFormat
.
framesForBytes
(
qint32
(
hostBuffer
.
size
()));
367
const
int32_t
applicationBufferSize
=
applicationFormat
.
bytesForFrames
(
numberOfFrames
);
368
369
withTemporaryBuffer
(
applicationBufferSize
, [&](
QSpan
<
std
::
byte
>
tempBuffer
) {
370
convertSampleFormat
(
hostBuffer
,
toNativeSampleFormat
(
hostFormat
.
sampleFormat
()),
tempBuffer
,
371
toNativeSampleFormat
(
applicationFormat
.
sampleFormat
()));
372
runAudioCallback
(
audioCallback
,
tempBuffer
,
applicationFormat
,
volume
);
373
});
374
}
375
376
template
<
typename
HostBufferType
>
377
inline
void
runAudioCallback
(
AudioSourceCallback
&
audioCallback
,
QSpan
<
HostBufferType
>
hostBuffer
,
378
const
QAudioFormat
&
applicationFormat
,
float
volume
,
379
QAudioHelperInternal
::
NativeSampleFormat
nativeHostFormat
)
380
{
381
static_assert
(
std
::
is_same_v
<
HostBufferType
,
std
::
byte
>
382
||
std
::
is_same_v
<
HostBufferType
,
const
std
::
byte
>);
383
384
using
namespace
QAudioHelperInternal
;
385
386
const
int32_t
numberOfFrames
=
int32_t
(
387
hostBuffer
.
size
() / (
bytesPerSample
(
nativeHostFormat
) *
applicationFormat
.
channelCount
()));
388
const
int32_t
applicationBufferSize
=
applicationFormat
.
bytesForFrames
(
numberOfFrames
);
389
390
withTemporaryBuffer
(
applicationBufferSize
, [&](
QSpan
<
std
::
byte
>
tempBuffer
) {
391
convertSampleFormat
(
hostBuffer
,
nativeHostFormat
,
tempBuffer
,
392
toNativeSampleFormat
(
applicationFormat
.
sampleFormat
()));
393
runAudioCallback
(
audioCallback
,
tempBuffer
,
applicationFormat
,
volume
);
394
});
395
}
396
397
///////////////////////////////////////////////////////////////////////////////////////////////////
398
399
enum
class
NativePeriodFrames
:
uint32_t
{};
400
401
}
// namespace QtMultimediaPrivate
402
403
class
Q_MULTIMEDIA_EXPORT
QPlatformAudioEndpointBase
:
public
QObject
404
{
405
Q_OBJECT
406
407
public
:
408
using
NativePeriodFrames = QtMultimediaPrivate::NativePeriodFrames;
409
410
explicit
QPlatformAudioEndpointBase(QAudioDevice,
const
QAudioFormat &, QObject *parent);
411
~QPlatformAudioEndpointBase() override;
412
413
// LATER: can we devirtualize these functions
414
QAudio::Error error()
const
{
return
m_error; }
415
virtual
QAudio::State state()
const
{
return
m_inferredState; }
416
virtual
void
setError(QAudio::Error);
417
418
virtual
bool
isFormatSupported(
const
QAudioFormat &format)
const
;
419
QAudioFormat format()
const
{
return
m_format; }
420
421
virtual
void
setVolume(
float
volume) { m_volume = volume; }
422
float
volume()
const
{
return
m_volume; }
423
424
Q_SIGNALS:
425
void
stateChanged(QtAudio::State);
426
427
protected
:
428
enum
class
EmitStateSignal : uint8_t
429
{
430
True,
431
False,
432
};
433
434
void
updateStreamState(QAudio::State);
435
void
updateStreamIdle(
bool
idle, EmitStateSignal = EmitStateSignal::True);
436
437
const
QAudioDevice m_audioDevice;
438
const
QAudioFormat m_format;
439
440
private
:
441
void
inferState();
442
443
QAudio::State m_streamState = QAudio::StoppedState;
444
QAudio::State m_inferredState = QAudio::StoppedState;
445
QAudio::Error m_error{};
446
bool
m_streamIsIdle =
false
;
447
448
float
m_volume{ 1.f };
449
};
450
451
class
Q_MULTIMEDIA_EXPORT
QPlatformAudioSink
:
public
QPlatformAudioEndpointBase
452
{
453
Q_OBJECT
454
455
public
:
456
explicit
QPlatformAudioSink(QAudioDevice,
const
QAudioFormat &, QObject *parent);
457
~QPlatformAudioSink() override;
458
459
virtual
void
start(QIODevice *device) = 0;
460
virtual
QIODevice* start() = 0;
461
virtual
void
stop() = 0;
462
virtual
void
reset() = 0;
463
virtual
void
suspend() = 0;
464
virtual
void
resume() = 0;
465
virtual
qsizetype bytesFree()
const
= 0;
466
virtual
void
setBufferSize(qsizetype value) = 0;
467
virtual
qsizetype bufferSize()
const
= 0;
468
virtual
void
setNativePeriodFrames(std::optional<NativePeriodFrames>) { }
469
virtual
std::optional<NativePeriodFrames> nativePeriodFrames() {
return
std::nullopt; }
470
virtual
qint64 processedUSecs()
const
= 0;
471
472
using
AudioCallback = QtMultimediaPrivate::AudioSinkCallback;
473
474
virtual
void
start(AudioCallback &&) { }
475
virtual
bool
hasCallbackAPI() {
return
false
; }
476
477
QElapsedTimer elapsedTime;
478
479
static
QPlatformAudioSink *get(
const
QAudioSink &);
480
481
using
AudioEndpointRole = QtMultimediaPrivate::AudioEndpointRole;
482
virtual
void
setRole(AudioEndpointRole) { }
483
};
484
485
class
Q_MULTIMEDIA_EXPORT
QPlatformAudioSource
:
public
QPlatformAudioEndpointBase
486
{
487
Q_OBJECT
488
489
public
:
490
explicit
QPlatformAudioSource(QAudioDevice,
const
QAudioFormat &, QObject *parent);
491
~QPlatformAudioSource() override;
492
493
virtual
void
start(QIODevice *device) = 0;
494
virtual
QIODevice* start() = 0;
495
virtual
void
stop() = 0;
496
virtual
void
reset() = 0;
497
virtual
void
suspend() = 0;
498
virtual
void
resume() = 0;
499
virtual
qsizetype bytesReady()
const
= 0;
500
virtual
void
setBufferSize(qsizetype value) = 0;
501
virtual
void
setNativePeriodFrames(std::optional<NativePeriodFrames>) { }
502
virtual
std::optional<NativePeriodFrames> nativePeriodFrames() {
return
std::nullopt; }
503
virtual
qsizetype bufferSize()
const
= 0;
504
virtual
qint64 processedUSecs()
const
= 0;
505
506
using
AudioCallback = QtMultimediaPrivate::AudioSourceCallback;
507
508
virtual
void
start(AudioCallback &&) { }
509
virtual
bool
hasCallbackAPI() {
return
false
; }
510
511
QElapsedTimer elapsedTime;
512
513
static
QPlatformAudioSource *get(
const
QAudioSource &);
514
};
515
516
// forward declarations
517
namespace
QtMultimediaPrivate
{
518
class
QPlatformAudioSinkStream
;
519
class
QPlatformAudioSourceStream
;
520
}
// namespace QtMultimediaPrivate
521
522
QT_END_NAMESPACE
523
524
#
endif
// QAUDIOSYSTEM_H
QPlatformAudioEndpointBase
Definition
qaudiosystem_p.h:404
QPlatformAudioSink
Definition
qaudiosystem_p.h:452
QPlatformAudioSource
Definition
qaudiosystem_p.h:486
QtMultimediaPrivate::QPlatformAudioSinkStream
Definition
qaudiosystem_platform_stream_support_p.h:120
QtMultimediaPrivate::QPlatformAudioSourceStream
Definition
qaudiosystem_platform_stream_support_p.h:237
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
QtMultimediaPrivate::impl
Definition
qaudiosystem_p.h:257
QtMultimediaPrivate::asAudioSinkCallback
AudioSinkCallback asAudioSinkCallback(Callback &&cb)
Definition
qaudiosystem_p.h:173
QtMultimediaPrivate::validateAudioCallback
constexpr bool validateAudioCallback(const AudioSinkCallback &audioCallback, const QAudioFormat &format)
Definition
qaudiosystem_p.h:213
QtMultimediaPrivate::GetSampleType
typename GetSampleTypeImpl< SampleTypeOrCallbackType >::type GetSampleType
Definition
qaudiosystem_p.h:154
QtMultimediaPrivate::asAudioSourceCallback
AudioSourceCallback asAudioSourceCallback(Callback &&cb)
Definition
qaudiosystem_p.h:184
QtMultimediaPrivate::getSampleFormat
static constexpr QAudioFormat::SampleFormat getSampleFormat()
Definition
qaudiosystem_p.h:157
QtMultimediaPrivate::AudioEndpointRole
AudioEndpointRole
Definition
qaudiosystem_p.h:90
QtMultimediaPrivate::AudioEndpointRole::SoundEffect
@ SoundEffect
Definition
qaudiosystem_p.h:92
QtMultimediaPrivate::AudioEndpointRole::Other
@ Other
Definition
qaudiosystem_p.h:94
QtMultimediaPrivate::AudioEndpointRole::MediaPlayback
@ MediaPlayback
Definition
qaudiosystem_p.h:91
QtMultimediaPrivate::AudioEndpointRole::Accessibility
@ Accessibility
Definition
qaudiosystem_p.h:93
QtMultimediaPrivate::validateAudioCallbackImpl
constexpr bool validateAudioCallbackImpl(const AnyAudioCallback &audioCallback, const QAudioFormat &format)
Definition
qaudiosystem_p.h:196
std
[33]
Definition
src_corelib_tools_qhash.cpp:421
__has_include
#define __has_include(x)
Definition
qcompilerdetection.h:459
QtMultimediaPrivate::GetSampleTypeImpl< float >
Definition
qaudiosystem_p.h:104
QtMultimediaPrivate::GetSampleTypeImpl< float >::sample_format
static constexpr QAudioFormat::SampleFormat sample_format
Definition
qaudiosystem_p.h:106
QtMultimediaPrivate::GetSampleTypeImpl< float >::type
float type
Definition
qaudiosystem_p.h:105
QtMultimediaPrivate::GetSampleTypeImpl< int16_t >
Definition
qaudiosystem_p.h:117
QtMultimediaPrivate::GetSampleTypeImpl< int16_t >::sample_format
static constexpr QAudioFormat::SampleFormat sample_format
Definition
qaudiosystem_p.h:119
QtMultimediaPrivate::GetSampleTypeImpl< int16_t >::type
int16_t type
Definition
qaudiosystem_p.h:118
QtMultimediaPrivate::GetSampleTypeImpl< int32_t >
Definition
qaudiosystem_p.h:111
QtMultimediaPrivate::GetSampleTypeImpl< int32_t >::type
int32_t type
Definition
qaudiosystem_p.h:112
QtMultimediaPrivate::GetSampleTypeImpl< int32_t >::sample_format
static constexpr QAudioFormat::SampleFormat sample_format
Definition
qaudiosystem_p.h:113
QtMultimediaPrivate::GetSampleTypeImpl
Definition
qaudiosystem_p.h:100
qtmultimedia
src
multimedia
audio
qaudiosystem_p.h
Generated on
for Qt by
1.18.0