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
qpipewire_spa_pod_support_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 QPIPEWIRE_SPA_POD_SUPPORT_P_H
5#define QPIPEWIRE_SPA_POD_SUPPORT_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 <QtCore/qglobal.h>
19#include <QtCore/qlist.h>
20#include <QtCore/qspan.h>
21#include <QtMultimedia/qaudioformat.h>
22#include <QtMultimedia/private/qaudio_qspan_support_p.h>
23#include <QtMultimedia/private/qpipewire_spa_pod_parser_support_p.h>
24
25#if __has_include(<spa/param/audio/iec958.h>)
26# include <spa/param/audio/iec958.h>
27#else
29#endif
30#include <spa/param/audio/raw.h>
31#include <spa/pod/pod.h>
32
33QT_BEGIN_NAMESPACE
34
35namespace QtPipeWire {
36
38{
39 static std::optional<SpaObjectAudioFormat> parse(const struct spa_pod_object *obj);
40 static std::optional<SpaObjectAudioFormat> parse(const struct spa_pod *pod);
41
42 int channelCount = 0;
43 std::variant<int, std::vector<int>, SpaRange<int>> rates;
46};
47
48spa_audio_info_raw asSpaAudioInfoRaw(const QAudioFormat &);
49
72
73} // namespace QtPipeWire
74
75QT_END_NAMESPACE
76
77#endif // QPIPEWIRE_SPA_POD_SUPPORT_P_H
void registerStreamReference(std::shared_ptr< QPipewireAudioStream >)
void unregisterStreamReference(const std::shared_ptr< QPipewireAudioStream > &)
const PwCoreConnectionHandle & coreConnection() const
void audioSourcesChanged(QList< QAudioDevice >)
void unregisterObserver(const SharedObjectRemoveObserver &)
std::optional< ObjectSerial > findSourceNodeSerial(std::string_view nodeName) const
void setDefaultAudioSink(std::variant< QByteArray, NoDefaultDeviceType >)
DeviceLists getDeviceLists(bool verifyThreading=true)
void setDefaultAudioSource(std::variant< QByteArray, NoDefaultDeviceType >)
std::optional< ObjectId > findObjectId(ObjectSerial)
std::optional< ObjectSerial > findSinkNodeSerial(std::string_view nodeName) const
static constexpr NoDefaultDeviceType NoDefaultDevice
void objectAdded(ObjectId, uint32_t permissions, PipewireRegistryType, uint32_t version, const spa_dict &props)
std::optional< ObjectSerial > findObjectSerial(ObjectId)
bool registerObserver(SharedObjectRemoveObserver)
std::optional< PipewireRegistryType > parsePipewireRegistryType(std::string_view sv)
constexpr std::array channelPositions7Dot1
constexpr std::array channelPositions3Dot1
constexpr std::array channelPositions5Dot0
static std::atomic_int s_sequenceNumberAllocator
std::unique_ptr< pw_core, PwCoreConnectionDeleter > PwCoreConnectionHandle
std::optional< std::string_view > getMetadataName(const PwPropertyDict &)
std::optional< ObjectSerial > getObjectSerial(const PwPropertyDict &)
std::optional< std::string_view > getNodeName(const PwPropertyDict &)
PwPropertyDict toPropertyDict(const spa_dict &)
spa_audio_info_raw asSpaAudioInfoRaw(const QAudioFormat &)
std::optional< std::string_view > getDeviceSysfsPath(const PwPropertyDict &)
std::optional< std::string_view > getDeviceName(const PwPropertyDict &)
constexpr std::array channelPositions5Dot1
constexpr std::array channelPositionsStereo
constexpr std::array channelPositions7Dot0
StrongIdType< uint32_t, ObjectIdTag > ObjectId
std::optional< std::string_view > getDeviceDescription(const PwPropertyDict &)
StrongIdType< uint64_t, ObjectSerialTag > ObjectSerial
constexpr std::array channelPositionsMono
std::optional< std::string_view > getMediaClass(const PwPropertyDict &)
constexpr std::array channelPositions2Dot1
std::shared_ptr< ObjectRemoveObserver > SharedObjectRemoveObserver
std::optional< ObjectId > getDeviceId(const PwPropertyDict &)
constexpr std::array channelPositions3Dot0
std::error_code make_error_code(int errnoValue=errno)
std::optional< std::string_view > getNodeDescription(const PwPropertyDict &)
PwPropertiesHandle makeProperties(QSpan< const spa_dict_item >)
#define __has_include(x)
bool pw_check_library_version(int major, int minor, int micro)
QDebug operator<<(QDebug dbg, const pw_time &state)
QDebug operator<<(QDebug dbg, const spa_dict &dict)
QDebug operator<<(QDebug dbg, enum pw_stream_state)
#define QT_MM_GUARDED_BY(Mutex)
QDebug operator<<(QDebug dbg, const spa_pod &pod)
q23::expected< void, int > asyncWait(pw_core *coreConnection, std::function< void()> handler)
q23::expected< bool, int > sync(pw_core *coreConnection, std::optional< std::chrono::nanoseconds > timeout={})
void operator()(Type *handle) const
NodeEventListener(PwNodeHandle, NodeHandler)
std::function< void(const struct pw_node_info *)> InfoHandler
std::function< void(int, uint32_t, uint32_t, uint32_t, const struct spa_pod *)> ParamHandler
void operator()(pw_core *handle) const
std::optional< QList< spa_audio_channel > > channelPositions
static std::optional< SpaObjectAudioFormat > parse(const struct spa_pod *pod)
static std::optional< SpaObjectAudioFormat > parse(const struct spa_pod_object *obj)
friend QDebug operator<<(QDebug dbg, const StrongIdType &self)
friend bool comparesEqual(const StrongIdType &lhs, const StrongIdType &rhs) noexcept
friend Qt::strong_ordering compareThreeWay(const StrongIdType &lhs, const StrongIdType &rhs) noexcept