5#include <QtCore/QByteArray>
14 static const std::array<QByteArray, GstHw::kPathCount> s_fields = [] {
15 std::array<QByteArray, GstHw::kPathCount> fields;
16 for (std::size_t i = 0; i < fields.size(); ++i) {
21 const auto index =
static_cast<std::size_t
>(path);
22 return (index < s_fields.size()) ? s_fields[index].constData() :
nullptr;
28 if (sinkOrBin && GST_IS_QGC_VIDEO_SINK_BIN(sinkOrBin)) {
30 sinkOrBin = inner.get();
32 if (!sinkOrBin || !GST_IS_QGC_Q_VIDEO_SINK(sinkOrBin)) {
35 GstStructure* stats =
nullptr;
36 g_object_get(sinkOrBin,
"frame-stats", &stats,
nullptr);
56 if (
const quint64 count =
frameStatsGrowth(stats, since, field); count > 0) {
57 out.
line += QStringLiteral(
" %1:%2").arg(QLatin1String(field)).arg(count);
HwVideoBufferPath
GPU zero-copy path a frame is imported through; None means the frame takes the CPU path.
struct _GstElement GstElement
GstElement * gst_qgc_video_sink_bin_get_qvideosink(GstQgcVideoSinkBin *self)
Returns the internal qgcqvideosink element, transfer-full (caller unrefs); NULL if not yet constructe...
GstStructurePtr adoptStructure(GstStructure *structure) noexcept
std::unique_ptr< GstStructure, GstStructureDeleter > GstStructurePtr
std::unique_ptr< GstElement, GstObjectDeleter > GstElementPtr
GstElementPtr adoptElement(GstElement *element) noexcept
constexpr std::size_t kPathCount
constexpr const char * toString(HwVideoBufferPath path) noexcept
GstVideoSink that pushes decoded frames into a Qt QVideoSink; sole sink in qgcvideosinkbin....
const char * sinkFramesField(HwVideoBufferPath path)
quint64 frameStatsGrowth(const GstStructure *stats, const GstStructure *since, const char *field) noexcept
How far the guint64 field grew from since to stats, two "frame-stats" values of the same sink.
PathStats formatSinkStats(const GstStructure *stats, const GstStructure *since)
constexpr const char * kGpuFallbacksField
guint64 "frame-stats" field holding the frames a GPU path was tried for but the CPU delivered.
constexpr const char * kStreamDemotionsField
guint64 "frame-stats" field holding the caps epochs that started on a GPU path and fell back to the C...
GStreamer::GstStructurePtr frameStats(GstElement *sinkOrBin)
The "frame-stats" of sinkOrBin, a qgcqvideosink or the qgcvideosinkbin around one; null for other ele...
constexpr const char * kTiledDropsField
Formatted per-path frame counts + the total delivered through GPU paths.