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_propertydict_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_PROPERTYDICT_H
5#define QPIPEWIRE_PROPERTYDICT_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
19
20#include <QtCore/qglobal.h>
21#include <QtCore/qspan.h>
22
23#include <pipewire/pipewire.h>
24
25#include <functional>
26#include <map>
27#include <optional>
28#include <string>
29#include <string_view>
30
31QT_BEGIN_NAMESPACE
32
33namespace QtPipeWire {
34
35// pw_properties
37
38// PwPropertyDict
40
41// parser
42PwPropertyDict toPropertyDict(const spa_dict &);
43
44// property getters
45// PW_KEY_MEDIA_CLASS
46std::optional<std::string_view> getMediaClass(const PwPropertyDict &);
47// PW_KEY_NODE_NAME
48std::optional<std::string_view> getNodeName(const PwPropertyDict &);
49// PW_KEY_NODE_DESCRIPTION
50std::optional<std::string_view> getNodeDescription(const PwPropertyDict &);
51// PW_KEY_DEVICE_SYSFS_PATH
52std::optional<std::string_view> getDeviceSysfsPath(const PwPropertyDict &);
53// PW_KEY_DEVICE_NAME
54std::optional<std::string_view> getDeviceName(const PwPropertyDict &);
55// PW_KEY_DEVICE_DESCRIPTION
56std::optional<std::string_view> getDeviceDescription(const PwPropertyDict &);
57// PW_KEY_DEVICE_ID
58std::optional<ObjectId> getDeviceId(const PwPropertyDict &);
59// PW_KEY_OBJECT_SERIAL
60std::optional<ObjectSerial> getObjectSerial(const PwPropertyDict &);
61
62// PW_KEY_METADATA_NAME
63std::optional<std::string_view> getMetadataName(const PwPropertyDict &);
64
65} // namespace QtPipeWire
66
67QT_END_NAMESPACE
68
69#endif // QPIPEWIRE_PROPERTYDICT_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)
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 &)
std::optional< std::string_view > getDeviceSysfsPath(const PwPropertyDict &)
std::optional< std::string_view > getDeviceName(const PwPropertyDict &)
StrongIdType< uint32_t, ObjectIdTag > ObjectId
std::optional< std::string_view > getDeviceDescription(const PwPropertyDict &)
StrongIdType< uint64_t, ObjectSerialTag > ObjectSerial
std::optional< std::string_view > getMediaClass(const PwPropertyDict &)
std::shared_ptr< ObjectRemoveObserver > SharedObjectRemoveObserver
std::optional< ObjectId > getDeviceId(const PwPropertyDict &)
std::error_code make_error_code(int errnoValue=errno)
std::optional< std::string_view > getNodeDescription(const PwPropertyDict &)
PwPropertiesHandle makeProperties(QSpan< const spa_dict_item >)
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
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