6#include <QtCore/qspan.h>
7#include <QtMultimedia/private/qmultimedia_enum_to_string_converter_p.h>
9#include <pipewire/version.h>
10#include <spa/debug/pod.h>
17QDebug operator<<(QDebug dbg,
const spa_dict &dict)
19 QSpan<
const spa_dict_item> items{ dict.items, dict.n_items };
21 QDebugStateSaver saver(dbg);
24 for (
const spa_dict_item &item : items)
25 dbg << item.key <<
"=" << item.value <<
", ";
29#if PW_CHECK_VERSION
(0
, 3
, 65
)
33struct QtSpaDebugContext : ::spa_debug_context
35 explicit QtSpaDebugContext(QDebug dbg)
36 : ::spa_debug_context{},
41 ::spa_debug_context::log = &doLog;
44 static void doLog(::spa_debug_context *ctx,
const char *fmt, ...)
48 QString logString = QString::vasprintf(fmt, args);
51 auto *self =
static_cast<QtSpaDebugContext *>(ctx);
52 self->dbg << logString;
60QDebug operator<<(QDebug dbg,
const spa_pod &pod)
62 QtSpaDebugContext context{ std::move(dbg) };
64 spa_debugc_pod(&context, 0,
nullptr, &pod);
65 return std::move(context.dbg);
72 dbg <<
"QDebug operator<<(QDebug, const spa_pod &) not implemented: minimum requirement: "
81 (PW_STREAM_STATE_ERROR,
"error")
82 (PW_STREAM_STATE_UNCONNECTED,
"unconnected")
83 (PW_STREAM_STATE_CONNECTING,
"connecting")
84 (PW_STREAM_STATE_PAUSED,
"paused")
85 (PW_STREAM_STATE_STREAMING,
"streaming")
94 dbg << QStringLiteral(u"pw_time{now: %1ns, rate: %2/%3, ticks: %4, delay: %5, queued: %6}")
97 .arg(state.rate.denom)
Q_CORE_EXPORT QDebug operator<<(QDebug debug, QDir::Filters filters)
QT_MM_MAKE_STRING_RESOLVER(pw_stream_state, QtMultimediaPrivate::EnumName,(PW_STREAM_STATE_ERROR, "error")(PW_STREAM_STATE_UNCONNECTED, "unconnected")(PW_STREAM_STATE_CONNECTING, "connecting")(PW_STREAM_STATE_PAUSED, "paused")(PW_STREAM_STATE_STREAMING, "streaming"))
QT_MM_DEFINE_QDEBUG_ENUM(pw_stream_state)
QDebug operator<<(QDebug dbg, const pw_time &state)
QDebug operator<<(QDebug dbg, const spa_pod &pod)