6#include <QtMultimedia/private/qmultimedia_enum_to_string_converter_p.h>
7#include <QtCore/qspan.h>
9#include <pipewire/version.h>
10#include <spa/debug/pod.h>
82 QSpan<
const spa_dict_item> items{ dict.items, qsizetype(dict.n_items) };
84 QDebugStateSaver saver(dbg);
87 for (
const spa_dict_item &item : items)
88 dbg << item.key <<
"=" << item.value <<
", ";
92#if PW_CHECK_VERSION
(0
, 3
, 65
)
96struct QtSpaDebugContext : ::spa_debug_context
98 explicit QtSpaDebugContext(QDebug dbg)
99 : ::spa_debug_context{},
104 ::spa_debug_context::log = &doLog;
107 static void doLog(::spa_debug_context *ctx,
const char *fmt, ...)
111 QString logString = QString::vasprintf(fmt, args);
114 auto *self =
static_cast<QtSpaDebugContext *>(ctx);
115 self->dbg << logString;
123QDebug operator<<(QDebug dbg,
const spa_pod &pod)
125 QtSpaDebugContext context{ std::move(dbg) };
127 spa_debugc_pod(&context, 0,
nullptr, &pod);
128 return std::move(context.dbg);
135 dbg <<
"QDebug operator<<(QDebug, const spa_pod &) not implemented: minimum requirement: "
144 (PW_STREAM_STATE_ERROR,
"error")
145 (PW_STREAM_STATE_UNCONNECTED,
"unconnected")
146 (PW_STREAM_STATE_CONNECTING,
"connecting")
147 (PW_STREAM_STATE_PAUSED,
"paused")
148 (PW_STREAM_STATE_STREAMING,
"streaming")
157 dbg << QStringLiteral(u"pw_time{now: %1ns, rate: %2/%3, ticks: %4, delay: %5, queued: %6}")
160 .arg(state.rate.denom)
QDebug operator<<(QDebug dbg, const pw_time &state)
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"))
QDebug operator<<(QDebug dbg, const spa_dict &dict)
QDebug operator<<(QDebug dbg, const spa_pod &)
QT_MM_DEFINE_QDEBUG_ENUM(pw_stream_state)