61 QString
decoderName()
const { QMutexLocker locker(&_decoderNameMutex);
return _decoderName; }
62 quint64
processedFrames()
const {
return _processedFrames.load(std::memory_order_relaxed); }
63 quint64
droppedFrames()
const {
return _droppedFrames.load(std::memory_order_relaxed); }
64 qint64
currentJitterNs()
const {
return _currentJitterNs.load(std::memory_order_relaxed); }
65 double qosProportion()
const {
return _qosProportion.load(std::memory_order_relaxed); }
66 int qosQuality()
const {
return _qosQuality.load(std::memory_order_relaxed); }
80 Q_INVOKABLE
void dumpPipelineGraph(
const QString &tag = QStringLiteral(
"manual"));
92 QString _redactedUri()
const;
94 static GstElement* _makeFileSink(
const QString& videoFile,
FILE_FORMAT format,
const GstCaps* inputCaps);
96 void _onNewSourcePad(GstPad *pad);
97 void _onNewDecoderPad(GstPad *pad);
99 void _ensureVideoSinkInPipeline();
100 bool _addVideoSink(GstPad *pad);
101 void _noteTeeFrame();
102 void _noteVideoSinkFrame();
103 void _noteEndOfStream();
107 void _shutdownDecodingBranch();
108 void _shutdownRecordingBranch();
109 void _logDecodebin3SelectedCodec(
GstElement *decodebin3);
111 bool _needDispatch();
116 void _scheduleReconnect(
const char *reason);
123 static gboolean _onBusMessage(GstBus *bus, GstMessage *message, gpointer user_data);
124 static void _onNewPad(
GstElement *element, GstPad *pad, gpointer data);
125 static GstPadProbeReturn _teeProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
126 static GstPadProbeReturn _videoSinkProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
127 static GstPadProbeReturn _eosProbe(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
128 static GstPadProbeReturn _keyframeWatch(GstPad *pad, GstPadProbeInfo *info, gpointer user_data);
134 mutable QMutex _pipelineMutex;
140 std::atomic<int> _reconnectAttempts = 0;
141 std::atomic<quint64> _reconnectEpoch = 0;
142 std::atomic<quint64> _sourceFrameCount =
144 gulong _teeProbeId = 0;
145 gulong _videoSinkProbeId = 0;
146 gulong _eosProbeId = 0;
147 GstPad *_eosProbePad =
nullptr;
148 gulong _keyframeWatchId = 0;
149 bool _recordingStopRequested =
false;
151 mutable QMutex _decoderNameMutex;
152 QString _decoderName;
153 std::atomic<quint64> _processedFrames{0};
154 std::atomic<quint64> _droppedFrames{0};
155 std::atomic<qint64> _currentJitterNs{0};
156 std::atomic<double> _qosProportion{1.0};
157 std::atomic<int> _qosQuality{1000000};
158 std::atomic<bool> _qosStatsDirty{
false};