59 QString
decoderName()
const { QMutexLocker locker(&_decoderNameMutex);
return _decoderName; }
60 quint64
processedFrames()
const {
return _processedFrames.load(std::memory_order_relaxed); }
61 quint64
droppedFrames()
const {
return _droppedFrames.load(std::memory_order_relaxed); }
62 qint64
currentJitterNs()
const {
return _currentJitterNs.load(std::memory_order_relaxed); }
63 double qosProportion()
const {
return _qosProportion.load(std::memory_order_relaxed); }
64 int qosQuality()
const {
return _qosQuality.load(std::memory_order_relaxed); }
78 Q_INVOKABLE
void dumpPipelineGraph(
const QString &tag = QStringLiteral(
"manual"));
91 void _onNewSourcePad(GstPad *pad);
92 void _onNewDecoderPad(GstPad *pad);
94 void _ensureVideoSinkInPipeline();
95 bool _addVideoSink(GstPad *pad);
97 void _noteVideoSinkFrame();
98 void _noteEndOfStream();
102 void _shutdownDecodingBranch();
103 void _shutdownRecordingBranch();
104 void _logDecodebin3SelectedCodec(
GstElement *decodebin3);
106 bool _needDispatch();
111 void _scheduleReconnect(
const char *reason);
118 static gboolean _onBusMessage(GstBus *bus, GstMessage *message, gpointer user_data);
119 static void _onNewPad(
GstElement *element, GstPad *pad, gpointer data);
120 static GstPadProbeReturn _teeProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
121 static GstPadProbeReturn _videoSinkProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
122 static GstPadProbeReturn _eosProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
123 static GstPadProbeReturn _keyframeWatch(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
129 mutable QMutex _pipelineMutex;
135 std::atomic<int> _reconnectAttempts = 0;
136 std::atomic<quint64> _reconnectEpoch = 0;
137 std::atomic<quint64> _sourceFrameCount =
139 gulong _teeProbeId = 0;
140 gulong _videoSinkProbeId = 0;
141 gulong _eosProbeId = 0;
142 GstPad *_eosProbePad =
nullptr;
143 gulong _keyframeWatchId = 0;
144 bool _recordingStopRequested =
false;
146 mutable QMutex _decoderNameMutex;
147 QString _decoderName;
148 std::atomic<quint64> _processedFrames{0};
149 std::atomic<quint64> _droppedFrames{0};
150 std::atomic<qint64> _currentJitterNs{0};
151 std::atomic<double> _qosProportion{1.0};
152 std::atomic<int> _qosQuality{1000000};
153 std::atomic<bool> _qosStatsDirty{
false};